Site logo

[Support request] redirecting author archive links to about page

Home Forums Support [Support request] redirecting author archive links to about page

Home Forums Support redirecting author archive links to about page

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2175484
    Todd Sindlinger

    Thanks for responding, you guys – Yes, I am the only author of my website. I thought it would be nice to redirect author archive links to my about page. Do you have a code snippet I could try adding to theme’s function php to handle this? I have a staging sight to give it a try. Thanks so much!

    #2175487
    David
    Staff
    Customer Support

    Hi there,

    this is the PHP Snippet:

    add_filter( 'generate_post_author_output', function() {
        printf( ' <span class="byline">%1$s</span>',
            sprintf( '<span class="byline">%1$s<span class="author vcard" %5$s><a class="url fn n" href="https://LINK-TO-ABOUT-PAGE" title="%3$s" rel="author" itemprop="url"><span class="author-name" itemprop="name">%4$s</span></a></span></span> ',
    			apply_filters( 'generate_inside_post_meta_item_output', '', 'author' ),
    			esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    			/* translators: 1: Author name */
    			esc_attr( sprintf( __( 'View all posts by %s', 'generatepress' ), get_the_author() ) ),
    			esc_html( get_the_author() ),
    			generate_get_microdata( 'post-author' )
            ) 
        );
    } );

    In the code you will see this URL

    https://LINK-TO-ABOUT-PAGE

    Change that to the URL of your About page.

    #2175508
    Todd Sindlinger

    Thanks for all your help, David. I was successful in creating that redirect in a different way. By the way, I am very pleased with GeneratePress pro, it has everything I need! Your support forum is also awesome and greatly appreciated. Stay safe and be well…

    #2175511
    David
    Staff
    Customer Support

    Glad to hear that!

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