Title: CSS &amp; JS not loading
Last modified: August 21, 2016

---

# CSS & JS not loading

 *  [Peter Hardy-vanDoorn](https://wordpress.org/support/users/petervandoorn/)
 * (@petervandoorn)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/css-js-not-loading/)
 * It’s great that the latest version of VFB now only loads the CSS and JS only 
   on pages which have the form embedded, but this has caused a problem for me.
 * Using my own page temple I pull the contents of some pages together into one 
   page and, whilst the shortcode is being fired correctly and displays the HTML,
   because the page itself is not being displayed, the CSS and JS are not being 
   injected into the wp_head() call.
 * I know this is a fairly unusual way of doing things, but I’m sure it might cause
   others problems too. Therefore, would it be possible to have an option in the
   settings to “Always load CSS/JS”?
 * Cheers
 * Peter
 * [http://wordpress.org/plugins/visual-form-builder/](http://wordpress.org/plugins/visual-form-builder/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Matthew Muro](https://wordpress.org/support/users/mmuro/)
 * (@mmuro)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/css-js-not-loading/#post-4048836)
 * I can add an option for always loading the CSS, but the JS should load no matter
   what. It’s part of the shortcode function and should enqueue properly if you 
   have wp_footer in your theme.
 * I’m not really sure I understand what you are describing. Link?
 *  Thread Starter [Peter Hardy-vanDoorn](https://wordpress.org/support/users/petervandoorn/)
 * (@petervandoorn)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/css-js-not-loading/#post-4048854)
 * Hi Matt.
 * I’m not surprised that you’re a little confused, and I must confess that what
   I’m doing is a little odd, but it does throw up an interesting issue!
 * Here’s the site in question: [http://www.cjlarkin.com](http://www.cjlarkin.com)(
   I have added the CSS and JS links manually so that it’s working, btw).
 * What you’re seeing is a single page site, but each of the concertina sections
   is actually a WP page, pulled in using a custom loop where post_type = “page”(
   pages, after all, are just posts!)
 * The page that contains the form, New Applicants, has the shortcode in the content,
   and that is being called correctly. However, as the shortcode is not being called
   in the actual page, VFB obviously does not know to load the CSS and JS.
 * I do have wp_head() and wp_footer() where they should be.
 * I haven’t tried it, but I would imagine the same would happen if someone used
   the shortcode in a normal post. So, I was wondering, for awkward sods like me,
   if you could add a preference to make VFB always load the files like it used 
   to to!
 * Cheers
 * Peter
 *  Plugin Author [Matthew Muro](https://wordpress.org/support/users/mmuro/)
 * (@mmuro)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/css-js-not-loading/#post-4048866)
 * The setting is easy enough and is actually way more useful when using the Pro
   version (due to the template tag).
 * Until that’s added to the free version, I suggest adding a proper enqueue to 
   your theme’s functions.php (which will essentially load it everywhere).
 *     ```
       function my_scripts_method() {
       	wp_enqueue_style( 'visual-form-builder-css' );
       	wp_enqueue_style( 'vfb-jqueryui-css' );
       }
   
       add_action( 'wp_enqueue_scripts', 'my_scripts_method' );
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘CSS & JS not loading’ is closed to new replies.

 * ![](https://ps.w.org/visual-form-builder/assets/icon-256x256.png?rev=1205840)
 * [Visual Form Builder](https://wordpress.org/plugins/visual-form-builder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/visual-form-builder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/visual-form-builder/)
 * [Active Topics](https://wordpress.org/support/plugin/visual-form-builder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/visual-form-builder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/visual-form-builder/reviews/)

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * 3 replies
 * 2 participants
 * Last reply from: [Matthew Muro](https://wordpress.org/support/users/mmuro/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/css-js-not-loading/#post-4048866)
 * Status: not resolved