• Resolved lukelukeluke

    (@lukelukeluke)


    I feel like I’m losing my marbles but Jquery doesn’t seem to load with this theme. I checked it out on the demo site too and it doesn’t load. Whats up with that?

Viewing 9 replies - 1 through 9 (of 9 total)
  • I downloaded the theme and tried just an alert on page load inside footer.php and like yours the alert did not work. Console showed $ is not a function.

    
    <script type="text/javascript">
      $(document).ready(function(){
        alert("jQuery loaded");
      });
    </script>
    

    So I tried replacing the ‘$’ with jQuery, i.e.

    
    <script type="text/javascript">
      jQuery(document).ready(function(){
        alert("jQuery loaded");
      });
    </script>
    

    which worked for me. Can you try the same and let me know how it goes? To me it looks like ‘$’ is conflicting with something else within the theme.

    Thread Starter lukelukeluke

    (@lukelukeluke)

    Its weird. It seems to be loading sometimes but not all the time. Think I’m going to start with another clean WP installation and see what happens

    Hope that helps! Please let me know about your findings.

    Thread Starter lukelukeluke

    (@lukelukeluke)

    I’ve got a brand new blank WP installation. I installed Quark from within WP and put your alert script in footer and look at the console – https://joanna.lukeseall.co.uk/

    If you look at page source code you can see that jquery is not being enqueued.

    This is super weird.

    Thread Starter lukelukeluke

    (@lukelukeluke)

    Jquery on default 2017 Wp theme works fine.

    Hmm I see it too!! That’s really weird.
    The theme seems like not loading jQuery at all which is pretty odd.

    Inside theme folder I don’t see any jQuery file except jQuery.validate.min. The strange thing is if jQuery is being ignored / not loaded how validate will work??
    It is Quark theme itself creating the problem I believe!

    What if you manually enqueue jQuery inside your functions.php?

    Thread Starter lukelukeluke

    (@lukelukeluke)

    Yeah its fine if I enqueue it myself but I’m just a bit concerned that it is not working how it is supposed to. There may be other things not working on this theme that I haven’t spotted yet.

    Were you trying it on a blank WP installation before?

    No. Actually I installed this theme for the first time today and installed it on my existing application.

    Theme Author Anthony Hortin

    (@ahortin)

    I answered this one via email but for anyone else…

    One thing that’s worth noting about WordPress, is that WordPress won’t load jQuery automatically. It only loads it when a theme or a plugin lists it as a dependency. So, if you have a brand new install of WordPress, with Quark activated and no other plugins, you won’t see jQuery load on the homepage (either using a static homepage, or showing the blog posts). This is because those pages don’t actually use jQuery. If you browse to a blog page with an image or gallery though, you should see it load. Once you also start activating plugins, it should also load as well (if they use jQuery).

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Jquery not loading’ is closed to new replies.