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

    Hi Guys,

    I’m trying to run this jqery code in a code block:

    <script>
    jQuery( document ).ready(function() {

    jQuery(“.image-overlay”).click(function() {
    jQuery( “#header” ).hide();
    });

    jQuery(“.rfbwp-close”).click(function() {
    jQuery( “#header” ).show();
    });

    });

    </script>

    It works when I pass it through the console on dev tools, but for some reason it’s not loading with the page. Could you help me out? Thanks!

    #587823

    Hey jesseaborden!

    Please add following code to Functions.php file in Appearance > Editor

    function avia_custom_logo_app(){
    if(is_page(15644)){
    ?>
    <script>
    jQuery( document ).ready(function() {
    jQuery(".image-overlay").click(function() {
    jQuery( "#header").hide();
    });
    jQuery(".rfbwp-close").click(function() {
    jQuery("#header").show();
    });
    });
    </script>
    <?php
    }}
    add_action('wp_footer', 'avia_custom_logo_app');

    Best regards,
    Yigit

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