Codeless
  • Support Home
  • Themes
  • Support
  • WordPress Tutorials
    • How to Start a Blog
    • Best Website Builders
    • Best Small Business Hosting
    • Email Marketing Services
    • Cheap WordPress Hosting
  • Video Tutorials

Community Forums

How I can make the Jquery load on footer?

jqueryJquery on footerJquery on Headwp_enqueue_script ('jquery')
    • 8 years, 7 months ago comunicaciondigitalgk
      Participant

      Expired

      I need to load the Jquery theme at the end of the page footer.

      I try editing the file

      functions.php line 245.

      Changing

      wp_enqueue_script (‘jquery’);

      by

      wp_enqueue_script (‘jquery’,’/wp-includes/js/jquery/jquery.js’,”,”,true);

      I also tried with:

      wp_enqueue_script (‘jquery’)

      wp_enqueue_script ($in_footer = true)

      but none of the options worked.

      Please. For results in loading speed I need the call to jquery.js file is loaded last, after all the others.

       

    • 8 years, 7 months ago Kris
      Participant

      Hello,

      Sorry for the delay!
      Edit the file functions_tower.php.

      Find the function codeless_register_scripts().
      Change the ‘false’ parameter to true, ex:

      wp_register_script('smoothscroll', SIMPLE_BASE_URL.'js/smoothscroll.js', array('jquery'), 1, true );

      Best regards!

      • This reply was modified 8 years, 7 months ago by Ruco.
      • This reply was modified 8 years, 7 months ago by Ruco.
    • 8 years, 7 months ago comunicaciondigitalgk
      Participant

      Expired

      Hello, all script already are in “true” parameter.

      Sorry, but this answer does not solve my problem. :(

      • This reply was modified 8 years, 7 months ago by comunicaciondigitalgk.
    • 8 years, 7 months ago Mirela
      Participant

      Hello,

      The scripts are already loaded in footer, not in header. The scripts you see in header are the ones that are generated from theme options.
      Please read in this article: https://developer.wordpress.org/reference/functions/wp_register_script/ a more detailed explaination of the wp_enqueue_script() function, structure.

      As you can see, what you have tried earlier, adding this line: wp_enqueue_script ($in_footer = true); in the functions file, has no effect because that variable is already set to true in file functions-tower.php

      What you missed is that $in_footer variable if set to ‘true’, will enqueue the scripts before </body> instead of in the <head>. If set to the default ‘false’, then the scripts will enqueue inside the <head> tag.

      Please see screenshot1 and screenshot2 the position of scripts. I have marked them in red line.

      Best regards!

      • This reply was modified 8 years, 7 months ago by Mirela.
    • 8 years, 7 months ago comunicaciondigitalgk
      Participant

      Expired

      Hi Mihaila, thanks for your response.

      You see my problem is only one line of script, and is specifically for:

      <script src="https://dimesahn.com/wp-includes/js/jquery/jquery.js?ver=1.12.4" type="text/javascript"></script><script type="text/javascript">
      
      

      Screenshot1

      Which it is on line 9.

      That line of code is the only one that is giving me problems “Pagespeed Insights” and is delaying loading the content.

      Even in its demo version (CONSTRUCTION & BUILDINGS) which is precisely what I use for my website, the script appears inside the head:

      Screentshot2

      How can I do to specifically charge that line of code in the footer?

    • 8 years, 7 months ago Mirela
      Participant

      Hello,

      Sorry but this is not possible. I can recommend you to use other options to boost your site’s speed. Read this article for more detailed information:

      How i increased more than 70% the speed of my website

      Best regards!

Viewing 5 reply threads

You must be logged in to reply to this topic.

Login

Log In
Register

Renew Support

  • Renew Specular Support
  • Renew Tower Support
  • Renew Folie Support
  • Renew Handel Support
  • Renew June Support
  • Renew Picante Support
  • Renew Thype Support
  • Renew Regn Support

Search Forums

Forums

  • Bygge – Construction Theme
  • Converta – Software Theme
  • Folie – The WordPress Website Builder
  • Handel – Responsive Multi-Purpose Business Theme
  • June WooCommerce WordPress Theme
  • Livecast – Podcast Theme
  • Picante – Restaurant & Food WordPress Theme
  • Regn | Agency & Business WordPress Theme
  • Remake – Minimal Portfolio & Agency Theme
  • Specular – Multi-Purpose WordPress Theme
  • Suggest us Features
  • Tower – Business-Driven Multipurpose WP Theme
  • Vibrance – Photography Theme

Site Links

  • Support Policy
  • Specular Support Forum
  • Video Tutorials
  • Knowledge Base
  • Guides and Reviews

Useful Articles

  • Build a Website
  • Web Design & Development
  • Hosting
  • WordPress

Login

Log In
Register Lost Password