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

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
Danny

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
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

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

    • Michael Kummer
      By Michael Kummer+
      Hi guys!
      Looking at the slow_errors log of WordPress, I have noticed that Pagelines is #1. The site in question is michaelkummer.com  - see
      Michael Kummer Information -- 96752
      --------------------------------------------------
      slow_errors: 4518
      slow_errors_common: [pool site-96752] script_filename = /www//wp-admin/admin-ajax.php +++ dump failed
      slow_errors_common_total: 372
      slow_errors_common_themes_and_plugins: /wp-content/plugins/pl-platform: 1246
      /wp-content/themes/pl-framework: 746
      My hoster is Flywheel is they are usually pretty good when it comes to performance. So I was wondering if anyone else has experienced those issues and if there are any solutions.
      Thanks
      Michael
    • 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!
×