Site logo

Archived topic

Back to top button missing

13 replies · Started by Radek on January 19, 2018

Viewing posts 1–14 of 14

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

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

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.

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

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 );
}

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 );
}

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 );
}

Yes it works. But this is workaround, are You going to contact NextGen to solve this conflict ? Thanx for help and info ;)

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.

OK, great support as always ;)
Thanx

No problem! :)

Just want to comment to TOM, you are awesome!

Thank you! :)

This archived topic is closed to new replies.