[Resolved] PHP for custom back-to-top image stopped working

Home Forums Support [Resolved] PHP for custom back-to-top image stopped working

Home Forums Support PHP for custom back-to-top image stopped working

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2388197
    Elizabeth

    The website that I’m working with is https://www.nagareprivatestudio.com/. I have been using the code below to use a custom back-to-top image in the functions.php file. The back-to-top custom image had been working up until the last week or so. Any suggestions are welcome.

    // Custom image in the Back to Top button
    add_filter( ‘generate_back_to_top_output’, ‘tu_custom_back_to_top_icon’ );
    function tu_custom_back_to_top_icon() {
    printf(

    Back to top
    <span class=”screen-reader-text”>%5$s</span>
    ‘,
    esc_attr__( ‘Scroll back to top’,’generatepress’ ),
    absint( apply_filters( ‘generate_back_to_top_scroll_speed’, 400 ) ),
    absint( apply_filters( ‘generate_back_to_top_start_scroll’, 300 ) ),
    esc_attr( apply_filters( ‘generate_back_to_top_icon’,’fa-angle-up’ ) ),
    __( ‘Scroll back to top’,’generatepress’ )
    );
    }

    #2388484
    Ying
    Staff
    Customer Support

    Hi there,

    There’s inline style added to the back to top button:
    https://www.screencast.com/t/kpGAupAsSkRV

    It’s not added by GP, can you disable all plugins except GP premium to test?

    If you have other custom function, can you try to disable them as well?

    #2388895
    Elizabeth

    Hi Ying,

    Thank you for the screenshot of the inline code. The original PHP snippet from this older post, https://generatepress.com/forums/topic/back-to-top-button-change/, had the inline code that was causing the issue. I’m guessing that it used to hide the default back-to-top button.

    I removed style=”opacity:0;visibility:hidden;” from the original snippet and the custom image is visible again.

    #2390239
    Ying
    Staff
    Customer Support

    Awesome 🙂

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