Forums

Change link in author area of php (2 posts)

  1. lilts520
    Member
    Posted 1 year ago #

    How can I update the "get_author_posts_url" area to just link to the homepage rather then the author area? In other words, I want to delete the ability to click on a link to see past author posts, and replace it with a simple link back to the main homepage.

    This is the code I have in the template:
    a class="url fn n" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" title="<?php printf( esc_attr__( 'View all posts by %s', ), get_the_author() ); ?>"><?php the_author(); ?></span>" title="<?php the_time(); ?>" rel="bookmark">

    Would appreciate any help!

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 1 year ago #

    Just change the link reference... the href

    href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>

    to

    href="<?php get_bloginfo('url'); ?>

    Thats the gist.... I can't see your code properly as you didn't post it using the code button or in between backticks, there may be a few other things you wanna change to make it make sense....

Topic Closed

This topic has been closed to new replies.

About this Topic