Jump to content

Archived

This topic is now archived and is closed to further replies.

shannoga

Loading JS at the end of the page

Recommended Posts

shannoga    0
shannoga

Hi

 

I have a slowness problem in one of my websites (http://heseg.com), and I am trying to better the speed.

I am using a child theme with costume sections and I am importing those assets in the function section_head() method.

Is there a way to move the JS imports to the bottom of the page to prevent a delay in the page upload?

 

Thanks

Shani

Share this post


Link to post
Share on other sites
shannoga    0
shannoga

Thanks

 

Is that Pagelines limit or WP limit?

And can you point me how can I improve this issue as I am using many scripts in my website?

 

Thanks

Shani

Share this post


Link to post
Share on other sites
bluecloud    3
bluecloud

To include JS file use the section_scripts() functions.

 

e.g.:

function section_scripts() {
   wp_enqueue_script( 'masonry_js', $this->base_url.'/jquery.masonry.min.js', array('jquery'), '2.1.05', true );
}

Note the last 'true' parameter, this is to include the JS in the footer

http://codex.wordpress.org/Function_Reference/wp_enqueue_script

Share this post


Link to post
Share on other sites

  • Similar Content

    • DanatTLFN
      By DanatTLFN
      Hi Pagelines Team, 
      Following on from my last thread about moving to WPEngine, I recently spoke to GoDaddy over the phone. 
      The reason for the move was due to an increase the recent downtime of my site. They taught me how to clear the cache on my site but after doing this we noticed that the reource limit would quickly spike.
       
      I spoke to their hosting department employee and he told me that I should contact my theme provider and ask for any further information on why this might be happening?
      Kind regards,
      Dan
       
    • Queue-it
      By Queue-it+
      Hi,
      Our site has experience an huge down load time since yesterday and we can't find the solution at the moment. 
      Could you also have a look at that? https://queue-it.com/
      We have plenty of plugins that are not up to date, but we have a replicate of this site that has the same exact settings and updates with plugins but it performs a lot better.
       
    • Steve Kayser
      By Steve Kayser+
      I am still trying to get my site to write to the server and I ran the debug. Below is what I get. How can I fix this? Really appreciate the help folks! - Steve

      DMS Internal Warning
      Less Subsystem
      Unable to set filesystem credentials
    • lexlex88
      By lexlex88
      Hi, 
       
      I've been struggling with optimizing my site speed for a few days. I ultimately moved from shared hosting to DV, and although I now have a lower google-pagespeed rating, my site is actually faster and much more responsive. Same thing on tools.pingdom.com, I went from a 91 to an 81, but the site is still faster than it was before. 
       
      Anyway, I found the DMS js scripts in the attached screenshot are slowing me down, is there anyway to suppress them? Are they necessary, can I remove them? 
       
      parallax
      pl.common
      bootstrap
      easing
      fitvids
      resize
      viewport
      waypoints
      migrate
       
      I could sacrifice the parallax and animations at least for speed if thats the case, but I'm sure theres a way to keep all these and optimize the performance. 
       
      Any help would be greatly appreciated.
       
      Site in question is: designsqr.com
       
      Thanks!
    • arno
      By arno+
      While a had a webpage open to edit in DMS (in a Chrome tab), I noticed that this Chrome tab kept drawing 5%-7% of the CPU power (i7 processor). Even though I hadn't been on that tab for more than a day.
       
      Is that a known issue? Is there any way to work around this problem?
×