[Support request] How To Replace Default Author Box On Author Archive With Simple Author Box?

Home Forums Support [Support request] How To Replace Default Author Box On Author Archive With Simple Author Box?

Home Forums Support How To Replace Default Author Box On Author Archive With Simple Author Box?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1935297
    Sunil

    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.

    #1935311
    Elvin
    Staff
    Customer Support

    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

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