[Resolved] Repositioning the category description

Home Forums Support [Resolved] Repositioning the category description

Home Forums Support Repositioning the category description

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2228940
    Cristiano

    Hello, I used the code provided by Ton in this thread:
    https://generatepress.com/forums/topic/moving-the-category-description-to-the-bottom/#post-949883

    That worked for me. But, I’m just experiencing a little issue with the author archive page. The description occurs twice on this page.
    Is it possible that this code will not function on this page? thank you for your attention

    I sent the examples to the restricted area.

    Thanks

    #2228995
    Fernando
    Customer Support

    Hi Cristiano,

    To clarify, how are you adding this section? https://share.getcloudapp.com/yAu1XRq8

    If you’re adding it through a Block Element, Can you try removing the description from that Block Element.

    Kindly let us know how it goes. 🙂

    #2229491
    Cristiano

    Hello fernando,

    I created a block element to customize the author archives page with information extracted from the author’s meta and I also created another block element with the author box to position single post pages after the articles.

    My question is whether the snippet that was provided could work Moving the category description to the bottom, on the category’s archive pages, except on the author archives page.

    I would like the author archives page to keep working in the default wordpress template and without duplicating the meta info.

    Thanks!

    #2229765
    David
    Staff
    Customer Support

    Hi there,

    on your Author Archive you have a Block Element ( in Appearance > Elements ) which is adding the content at the top of the archive.

    #2233398
    Cristiano

    Yes, I have a Block Element in Author Archive, so I need your help modify the function provided here on the forum

    add_action( 'wp', function() {
        remove_action( 'generate_after_archive_title', 'generate_do_archive_description' );
    
        if ( is_archive() ) {
            add_action( 'generate_after_main_content', 'generate_do_archive_description' );
        }
    } );

    I need a conditional function to keep moving the category description to the bottom. This is OK!

    But that doesn’t work on the author archive page.

    #2233843
    Ying
    Staff
    Customer Support

    To be clear, you want to remove the default description from author archive page?

    If so, try this:

    add_action( 'wp', function() {
        remove_action( 'generate_after_archive_title', 'generate_do_archive_description' );
    
        if ( is_archive() && !is_author() ) {
            add_action( 'generate_after_main_content', 'generate_do_archive_description' );
        }
    } );
    #2233862
    Cristiano

    It worked! Thank you really much!!

    #2233949
    Ying
    Staff
    Customer Support

    No problem 🙂

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