Site logo

Archived topic

Repositioning the category description

7 replies · Started by Cristiano on May 22, 2022

Viewing posts 1–8 of 8

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. :)

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!

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.

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.

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

It worked! Thank you really much!!

No problem :)

This archived topic is closed to new replies.