[Resolved] Removing Category Description on Page 2

Home Forums Support [Resolved] Removing Category Description on Page 2

Home Forums Support Removing Category Description on Page 2

  • This topic has 6 replies, 2 voices, and was last updated 4 years ago by David.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1199075
    Rachel

    Hi,

    I would like the Category Description to only show on page 1 of the category archive, and not on pages 2 onwards.
    Is there a setting in GP that will allow me to control this?

    Thanks,
    Rachel

    #1199225
    David
    Staff
    Customer Support

    Hi there,

    you can add this PHP snippet:

    add_action( 'wp', function() {
        if ( is_paged() ) {
            remove_action( 'generate_after_archive_title', 'generate_do_archive_description' );
        }
    } );
    #1199270
    Rachel

    Hi David, where do I add the snippet? Is it a hook in elements? If so, which type of hook is it?
    Thanks
    Rachel

    #1199278
    David
    Staff
    Customer Support

    This article explains where to add the code:

    https://docs.generatepress.com/article/adding-php/

    #1202224
    Rachel

    Ok thanks, will do.

    #1202226
    Rachel

    Works great, thanks.

    #1204719
    David
    Staff
    Customer Support

    Glad to be of help

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