Home Forums Weaver Xtreme Theme the wp_head() and wp_footer()

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #75025
    Yvonne
    Participant
    Doesn't the Weaver Xtreme template use the wp_head() and wp_footer() functions.
    I wanted to load required scripts in the footer or header to improve page performance
    #75026
    User
    Moderator

    @sariwo

    There is a capability of sorts here:  Admin > Appearance > Weaver Xtreme Admin > Advanced Options.

    See:  <HEAD> Section tab and HTML Insertion tab

    Regards.

    #75027
    scrambler
    Moderator

    I am not 100% why you mention these functions. May be explain in more details so @weaver can pitch in.

    If you need script to be in a specific location, you can use the HTML Insertion area like header or footer ones.

    We use to be able to inset PHP in content areas by activating PHP in Xtreme option but I believe that was removed for security concerns. There may be plugins that allow you to insert PHP in content, or @weaver may know more

    #75028
    Weaver
    Keymaster

    Weaver Xtreme calls wp_head() and wp_footer() in the appropriate places. It adds its own functionality with wp_head and wp_footer  via an add_action calls (as is standard WP practice for themes).

    You could create a child theme to replace Weaver’s own wp_head actions. Creating a child theme requires a fairly technical understanding of the parent theme – including understanding at least part of the theme’s source code.

    The question is what “required scripts” are you talking about? Weaver already optimizes the loading of the scripts it requires in the header or footer as needed, so I’m not really sure what you might have in mind. If you need to access theme code, the appropriate way to do that is with a child theme.

    Plugins have their own rules and standards for adding scripts.

    And the fact of the matter is that tweaking the order of loading scripts really has essentially zero measurable effects on loading a site, at least for very slow internet access speeds. Even the 2 or 3 Mb access rates found on 4G phones, script optimization has minimal effects. Loading huge scripts that do a lot of processing might make a difference, so it depends if users with old phones using  are a critical part of your target audience.

    But with today’s typically fast internet connections, it has become very difficult to detect much speed difference for a WordPress site. It is likely more productive to put your efforts into overall site design and content.

    #75032
    Yvonne
    Participant

    @Weaver @Scrambler

    Wtyczka do optymalizacji strony pod kątem wydajności ma opcję przenoszenia skryptów do stopki. Nie muszę nic wpisywać i szukać, robi to sama. Ale już wszystko sprawdziłem i nasz/Twój motyw jest idealny, ponieważ wszystko działało idealnie

    Translation (added by moderator):

    The page optimization plugin for performance has an option to move scripts to the footer. I don’t have to type anything in or search, it does it itself. But I already checked everything and our/your theme is perfect because everything worked perfectly

    #75033
    scrambler
    Moderator

    If you change the execution order of the theme script, you will most likely break the theme. when each weaver script is activated is essential to their well working.

    So I would not mess with the theme script execution order.

    If this is about other scripts that you added, you can add them yourself in the area you like.

    #75822
    Yvonne
    Participant

    @Weaver  @Scrambler

    Smush PRO inserts the lazy image loading script into the footer or header. For this to work, the theme must support the wp_footer() or wp_head() functions.

    #75823
    scrambler
    Moderator

    If the plugin moves its own scripts (not the theme one), then there is no issue

    #75824
    Weaver
    Keymaster

    Weaver Xtreme supports wp_head and wp_footer in the standard way.

    Are you sure you really need lazy load? With host and services like iCloud today, lazy loading can be less important. Lazy loading helps for long pages, or ones with many images. And it should be applied only to images below the fold. Just providing this comment because setting up effective lazy loading might require extra effort and site content maintenance that might not be worth the effort.

    #75825
    User
    Moderator

    @sariwo

    I am in agreement with Weaver regarding lazy-load.

    If you have your images optimized by Smush or Cloudinary or such, the images are all delivered at the best possible size and format for the device receiving them.

    If you run any such image optimized site through https://tools.pingdom.com/ you will see all the images are delivered as one group (consecutively and at the same time), and all within <0.1s from the first to last.

    From that Pingdom chart data, it is clear that adding a few more images will have no measurable impact in the delivery the site as a whole.

    I have a fully optimized Cloudinary image site and by turning “lazy-load” off, I achieved a noticeable and measurable reduction in both bandwith and load speed.

    If however, one has an non-optimized site with overly large image files, then certainly lazy-load will provide improved initial load times for users.  But I’m sure that is not what you have designed  😊

    Hope this helps!

    #75829
    Yvonne
    Participant

    Thanks guys. The website https://tools.pingdom.com/ really helped me a lot and I fixed my lazy loading.

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.