Jump to content


Photo
- - - - -

Loading JS at the end of the page

performance

  • Please log in to reply
3 replies to this topic

#1 shannoga

shannoga

    Member

  • Members

  • 18 posts
  • Country: Country Flag

Posted 13 August 2013 - 01:55 AM

Hi

 

I have a slowness problem in one of my websites (

Please Login or Register to see this Hidden Content

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



#2 Danny

Danny

    Is Awesome!

  • Moderators
  • 16385 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 13 August 2013 - 09:44 AM

Hi Shani,

 

Unfortunately, section_head is meant for custom scripts, see here - 

Please Login or Register to see this Hidden Content

 

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



#3 shannoga

shannoga

    Member

  • Members

  • 18 posts
  • Country: Country Flag

Posted 13 August 2013 - 10:03 AM

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



#4 bluecloud

bluecloud

    Advanced Member

  • Members
  • 44 posts
  • LocationHillegom
  • Framework Version:latest (always)
  • Country: Country Flag

Posted 13 August 2013 - 10:43 AM

To include JS file use the section_scripts() functions.

 

e.g.:

Please Login or Register to see this Hidden Content

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

Please Login or Register to see this Hidden Content







Also tagged with one or more of these keywords: performance