Code does not work when save offline or applied to other site (5 posts)

  1. vkhu
    Posted 1 year ago #

    Hi guys. Just recently, I ran across this amazing piece of work: http://codepen.io/yesimaaron/pen/CFpeL

    I tried to save the page for offline studying. However, when I reopen the offline html file, the menu button doesn't work.

    Specifically, everything load like normal, but I can keep clicking the menu button on the top right corner till kingdom come and nothing will happen. If the menu is already open when I save it, it will stay open. If it's not, nothing can get it to load.

    I tried to copy the code to my site, and the same thing happened. No matter how many time I click the button, nothing will come down.

    Can anyone explain this, please?

  2. How are you enqueuing the JS files?

  3. vkhu
    Posted 1 year ago #

    I just put all the JS in a <script> tag inside the header.php. Is that wrong? I'm quite new to this whole coding thing.

  4. Sort of wrong.

    Better question: how are you loading jQuery?

    Is this a custom theme you are using, pre-made, where did you get it from?

    Sorry, for so many questions but the more information you give the better we can understand what is happening. :)

  5. vkhu
    Posted 1 year ago #

    I create a function.php file and add the following code:

    add_action( 'wp_enqueue_script', 'load_jquery' );
    function load_jquery() {
        wp_enqueue_script( 'jquery' );

    As for the theme, I'm creating a child theme of the theme customizr.

Topic Closed

This topic has been closed to new replies.

About this Topic