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?
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