[Resolved] Back to top button missing

Home Forums Support [Resolved] Back to top button missing

Home Forums Support Back to top button missing

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #474786
    Radek

    Hi Tom or somebody,

    there is no back to top button on 3 of my sites instead setting is set to enable.
    Can You look at it ?
    http://www.pivnicejamajka.cz

    Thanx a lot
    Radek

    #474895
    Leo
    Staff
    Customer Support

    Hi there,

    Can you try #1 here to eliminate plugin conflict first?
    https://docs.generatepress.com/article/debugging-tips/

    Thanks!

    #476211
    Radek

    Hi, looks like NextGEN Gallery plugin (Yes I use it on all 3 sites) is the culprit…
    What can I do ?

    #476750
    Tom
    Lead Developer
    Lead Developer

    I’m not sure how NextGen does it, but it somehow blocks the back to top button from being hooked into wp_footer, which is a core WP hook.

    Are you a big fan of NextGen? If not, we’ve experienced way less issues using something like Envira Gallery.

    #476819
    Radek

    Yes, NextGen is one of the oldest and most used gallery plugin (Ofcourse, You know this πŸ˜‰ ), so I’d liku to stay with them. Are You contact their support, or what can I do for help You ?

    Thanx Radek

    #477378
    Tom
    Lead Developer
    Lead Developer

    It seems that NextGen moves the scripts up above the back to top button HTML (for some reason).

    You can force it to show up above the scripts (hopefully) using this PHP:

    add_action( 'after_setup_theme', 'tu_move_back_to_top_button' );
    function tu_move_back_to_top_button() {
        remove_action( 'wp_footer', 'generate_back_to_top' );
        add_action( 'wp_footer', 'generate_back_to_top', 0 );
    }
    #477720
    Radek

    It does not help. My child theme functions.php:

    <?php
    // Exit if accessed directly
    if ( !defined('ABSPATH')) exit;
    
    /* Add custom functions below */
    
    load_theme_textdomain( 'generate', get_stylesheet_directory() . '/languages' );
    
    /* back to top button conflict with NextGen gallery */
    add_action( 'after_setup_theme', 'tu_move_back_to_top_button' );
    function tu_move_back_to_top_button() {
        remove_action( 'wp_footer', 'generate_back_to_top' );
        add_action( 'wp_footer', 'generate_back_to_top', 0 );
    }
    #478529
    Tom
    Lead Developer
    Lead Developer

    Crazy, try this instead:

    add_action( 'after_setup_theme', 'tu_move_back_to_top_button' );
    function tu_move_back_to_top_button() {
        remove_action( 'wp_footer', 'generate_back_to_top' );
        add_action( 'generate_before_footer', 'generate_back_to_top', 0 );
    }
    #478584
    Radek

    Yes it works. But this is workaround, are You going to contact NextGen to solve this conflict ? Thanx for help and info πŸ˜‰

    #478988
    Tom
    Lead Developer
    Lead Developer

    I’ll try, but I assume they have a reason for moving the scripts around (although I can’t think of any good ones).

    It may just be necessary to make this tweak if you want to use NextGen.

    #479377
    Radek

    OK, great support as always πŸ˜‰
    Thanx

    #479913
    Tom
    Lead Developer
    Lead Developer

    No problem! πŸ™‚

    #992157
    james

    Just want to comment to TOM, you are awesome!

    #992405
    Tom
    Lead Developer
    Lead Developer

    Thank you! πŸ™‚

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