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

    Hi there,
    I’m trying to add custom jquery to the child theme, and can’t find exactly where to place it. I’ve reviewed the following documentation:
    https://kriesi.at/support/topic/custom-js/

    I have added the following code to the functions.php file in the child theme.
    /* register custom javscript */
    wp_register_script( ‘custom-js’, $template_url.’/js/custom-js.js’, ‘jquery’, “1”, true);
    wp_enqueue_script( ‘custom-js’ );

    And have created a js folder in the file theme and placed in it a custom js file entitled custom-js.js, adding the following code:
    $(document).ready(function() {
    $(“.blog-categories”).insertAfter(“#SingleMapLocation”);
    });
    });

    Please advise. Thank you kindly

    #570674

    Hey LeJager!

    Try this instead.

    add_action( 'wp_header', 'enfold_customization_extra_js' );
    function enfold_customization_extra_js() {
    ?>
    <script type = "text/javascript">
    
    insert your javascript here
    
    </script>
    <?php
    }

    Regards,
    Elliott

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