Hi Kriesi team,
I would like to open several hidden color sections on one page using several buttons (one button per section).
I assigned a unique class to the button and assigned a unique ID to the color section to be opened.
Then I used this code from Yigit (https://kriesi.at/support/topic/hidding-color-section/):
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’);
The code works great as long as I have defined one button and a section and the information is used accordingly in the code.
The moment I adjust the code for another section, I get a critical error.
Can you help me?
Best regards
Grobi
Hey Grobi,
Are you adding the same function name again? You need to use a different function name or combine the code into one function.
I am closing this thread as a duplicate. Please do not post duplicate threads.
Best regards,
Victoria
Hi,
Best regards,
Victoria