Site logo

Archived topic

How To Replace Default Author Box On Author Archive With Simple Author Box?

1 reply · Started by Sunil on September 18, 2021

Viewing posts 1–2 of 2

Hello

I'm looking to add social icons in my author box on author archive pages. We have around 50 authors so adding hooks for every author manually would be a tedious job. Is there a hook that you can provide me that adds author social links to default author boxes?

If not, how can I remove default author box from author archive and replace it with simple author box?
I got the php of simple author box and added it to the author archive page but the page now has two author boxes. I'd want only one with the social links in it.

Hi there,

You can remove the default layout for the author archive page by adding this PHP snippet.

add_action( 'wp', function() {
    if ( is_author() ) {
       remove_action( 'generate_archive_title', 'generate_archive_title' );
       remove_action( 'generate_after_archive_title', 'generate_do_archive_description' );
    }
} );

This removes the page title(the author's name) and the description (author's description/bio).

But if you only need to hook things on either the description or the archive title, you can use the hook specified on my snippet which are generate_archive_title and generate_after_archive_title

This archived topic is closed to new replies.