Title: Help please&#8230;Script loading format breaks page functionality
Last modified: August 21, 2016

---

# Help please…Script loading format breaks page functionality

 *  [clsimco](https://wordpress.org/support/users/clsimco/)
 * (@clsimco)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/help-pleasescript-loading-format-breaks-page-functionality/)
 * Thanks for reading, and in advance, your help.
 * I’m really a a novice but am learning as I go and have encountered this problem
   when trying to get an Isotope gallery to work on a page on my site. As a result
   of trying to solve that I have encountered a couple of oddities.
 * In order:
 * Live site is : clsimco.com
    Page with Isotope is: clsimco.com > About > Gallery
 * Problem is: Script loading function written into the theme (bootstral-WP) allows
   scripts to load and things to work correctly but when you check developer tools
   there are 404 errors for those same scripts that are working on the pages. Eg:
   drop-down menus and modals etc. work.
 * I then added a page for Isotope Gallery and using existing loading function Isotope
   will not work.
 * I investigated and came up with this info:
    functions.php enqueues the scripts
   like this
 *     ```
       <code>
       function bootstrapwp_scripts_loader() {
   
           if (is_singular() && comments_open() && get_option('thread_comments')) {
   
               wp_enqueue_script('comment-reply');
   
           }
   
           wp_enqueue_script('bootstrap-js', get_template_directory_uri() . '/assets/js/test-js/bootstrap/js/bootstrap.min.js', array('jquery'), '1.0', true);
           wp_enqueue_script('demo.js', get_template_directory_uri() . '/assets/js/bootstrapwp.demo.js', array('jquery'),'1.0',true);
       </code>
       ```
   
 * etc.etc. You see the forward slash / before the start of the complete ed url.
 * Footer Template has the following code:
 *     ```
       <code>
        <?php wp_footer(); // js scripts are inserted using this function ?>
           <script src="//use.edgefonts.net/cardo:n4,i4,n7:all;pontano-sans:n4:all;meddon:n4:all.js"></script>
       	<script src="<?php echo get_template_directory_uri(); ?>assets/js/bootstrapwp.demo.js" type="text/javascript"></script>
       	<script src="<?php echo get_template_directory_uri(); ?>assets/js/test-js/jquery-1.8.3.min.js" type="text/javascript"></script>
       	<script src="<?php echo get_template_directory_uri(); ?>assets/js/test-js/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
       </code>
       ```
   
 * Note the lack of the forward slash / at the beginning of the url
 * You can View Source on the home page and gallery page to see an view my comments
   to help
 * Where the REAL problem lies and is where I am at is this:
 * Something seems at odds in the script loading.
    As a result I do not seem to 
   be able to use the same script loading to get the Gallery page to work with isotope
   AND have the menus work. Or if the menus work Isotope does not work.
 * My workaround for the moment is to have separate footer templates with different
   coding so the Gallery Isotope will work, but the menus do not, and have another
   footer template for the rest of the site and it works fine but produces 404’s.
 * Any ideas much appreciated. Im stumped

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/help-pleasescript-loading-format-breaks-page-functionality/#post-4807158)
 * There’s more going on than the slash thing. First of all, it appears your pages
   will not validate. Correcting any significant validation errors could help things.
   There are also javascript console errors. Without looking any further, it appears
   some script is trying to run in WP noConflict mode using the $ shortcut without
   a noConflict wrapper. This could certainly cause something to not work. Resolving
   these before getting too excited will at least eliminate potential factors for
   further confusion.
 * Unless you have a folder named ‘bootstrapwp-v1.2-childassets’ there is no point
   in letting such code exist. The true issue is there is a conflict somewhere. 
   To minimize the impact of including code with the correct path is to only enqueue
   it on the gallery page. You can determine if the gallery page is requested from`
   get_queried_object()` or `$_SERVER['REQUEST_URI']`
 * Actually finding the conflict and patching it can be very challenging. Let’s 
   hope correcting the validation and javascript errors resolves the conflict.

Viewing 1 replies (of 1 total)

The topic ‘Help please…Script loading format breaks page functionality’ is closed
to new replies.

## Tags

 * [Coding](https://wordpress.org/support/topic-tag/coding/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [jquery](https://wordpress.org/support/topic-tag/jquery/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/help-pleasescript-loading-format-breaks-page-functionality/#post-4807158)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
