Tagged: , ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1146974

    I was able to get the Hide/show color section to work at the bottom of the page listed in the private section for the link “+ALL AWARDS”.

    I need to make a second button on the same page work the same exact way (+ALL UPDATES) but when I simply duplicate the script in my child’s functions.php file, I get errors.

    How can I make a second button behave the same on the same page?

    #1147311

    Hey VIA_Architecture,

    So you are using this code?

    function add_custom_cs(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery("#your-unique-color-section-id").hide();
    jQuery( ".your-custom-button-class" ).click(function() {
      jQuery( "#your-unique-color-section-id" ).toggle();
    });
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_cs');

    You need to change the name of the function in both places if you want to copy it, in the code above it’s add_custom_cs.

    Best regards,
    Rikard

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.