jQuery autocomplete not displaying results in wordpress subsections

I am using the jQuery autocomplete on a site that I am building. It works perfectly everywhere but, in a section of the site where I am using wordpress, the results aren’t displayed.

The weirdest part is that in the home of that section, it works, but when I go to a subsection or an article, it doesn’t.

Read More

This is the home of the wordpress section, the autocomplete search is top left:
http://www.metagame.gg/news/

This is a subsection where it is not working:
http://www.metagame.gg/news/category/opinion/

I have been trying to figure out what is happening, but I couldn’t fix it.

Any idea?

Thank you in advance.

Related posts

Leave a Reply

1 comment

  1. you have 5 errors which is most probably the reason your JavaScript not working

    Failed to load resource: the server responded with a status of 404
    (Not Found) jquery-migrate.min.js?ver=1.4.0:2 JQMIGRATE: Migrate is
    installed, version 1.4.0
    http://www.metagame.gg/news/category/js/jquery.js Failed to load
    resource: the server responded with a status of 404 (Not Found)
    http://www.metagame.gg/news/category/js/jquery-ui.js Failed to load
    resource: the server responded with a status of 404 (Not Found)
    http://www.metagame.gg/:406 Uncaught TypeError: $ is not a function
    http://www.metagame.gg/news/category/opinion/style.css Failed to load
    resource: the server responded with a status of 404 (Not Found)

    mainly there is 2 missing js files (http://www.metagame.gg/news/category/js/jquery.js & http://www.metagame.gg/news/category/js/jquery-ui.js) and a missing CSS http://www.metagame.gg/news/category/opinion/style.css

    further investigation:

    you’re using a relative path for the jQuery and jQuery-UI which explains why on homepage you can find root/js/jquery.js but not in root/news/category/js/jquery.js.
    you need to reference root/js/jquery.js from all other pages as well.