Home › Forums › All Other Themes › Moving javascripts above the footer
- This topic has 9 replies, 3 voices, and was last updated 8 years, 8 months ago by Sonl Sinha.
-
AuthorPosts
-
March 17, 2016 at 6:28 pm #27286
HI Guys,
I would like to move some javascript outside my <head> section.
How should I do that?March 22, 2016 at 5:27 am #27652Hi,
You have to do that manually unfortunately via appearance>editor>header.php
Regards,
DaveMarch 22, 2016 at 6:19 am #27674Hi Dave,
I understand that the scripts are generated within this section
<?php
wp_head();
$themename = wp_get_theme();
$themename = preg_replace(“/\W/”, “_”, strtolower($themename) );
if( !get_option( $themename ) ) {
require get_template_directory() . ‘/index-default.php’;
exit;
}
?>Are you suggesting that I should replace the code by static? Or is there any other way I can edit the script section and implement some of them in the footer?
Regards,
Ronald
March 22, 2016 at 12:02 pm #27747Hi Ronald,
All the javascripts listed on functions.php
Regards,
DaveMarch 22, 2016 at 12:07 pm #27748Hi Dave,
Thank you for the reply. I have discovered the functions.php section.
But my question remains: is there any other way I can edit the script section and implement some of them in the footer?Regards,
RonaldMarch 29, 2016 at 9:29 am #28481Hi Dave,
Do you have a answer for my question?
Regards,
RonaldMarch 29, 2016 at 11:41 am #28508Hi Ronald,
Actually this is quite difficult as this would involve shifting all of the javascripts manually to the footer and then ensuring whether this would work or not.
Are you doing this for getting Google page speed ranking?
Regards,
ShriMarch 29, 2016 at 11:51 am #28511Hi Shri,
Yes I would like to move some of the scripts/css out of the header to gain loading speeds and satisfying users.
Is there any way I can achieve this and if there is, how to go about it?
Regards,
Ronald
April 20, 2016 at 9:49 am #30997Hi Shri & Dave,
Any luck finding an answer?
Regards,
Ronald
April 20, 2016 at 12:21 pm #31016Hi Ronald,
Unfortunately shifting javascripts to footer breaks functioning of the theme.
Regards,
Shri -
AuthorPosts
- You must be logged in to reply to this topic.