Jump to content


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


Loading JS at the end of the page

Recommended Posts




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?




Share this post

Link to post
Share on other sites

Hi Shani,


Unfortunately, section_head is meant for custom scripts, see here - http://phpxref.pagelines.com/nav.html?includes/class.sections.php.html


If you're experiencing performance issues, then its most likely related to your server environment.

Please search our forums, before posting!

Share this post

Link to post
Share on other sites



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?




Share this post

Link to post
Share on other sites

To include JS file use the section_scripts() functions.



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


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,
    • Queue-it
      By Queue-it+
      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
      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? 
      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
    • 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?