Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I uploaded a few .js files, so my js folder is in the root (The same level as wp-contents). I have a few .js files, but I just uploaded the masonry library and when I try to access it via domain.com/js/masory.js, it just goes to a 404. Is there something I am supposed to do with Wordpress ? The weird thing is, my other javascript in the same file works and it doesn't go to the 404.

For example, my custom.js (jQuery stuff) works, but the other doesn't:

<script language="javascript" type="text/javascript" src="http://domain.com/js/jquery.eachdelay-0.0.1.js"></script>
<script language="javascript" type="text/javascript" src="http://domain.com/js/jquery.masonry.min.js"></script>
share|improve this question
add comment

2 Answers

you should place your Javascript files in a subfolder of your theme rather than adding folders to the base structure of WP.

share|improve this answer
add comment

What I usually do is create a folder for the scripts inside the theme folder then place this line to the header.php

<script language="javascript" type="text/javascript" src="<?php bloginfo('template_directory'); ?>/scriptsfolder/script.js"></script>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.