Support » Themes and Templates » Author Post Link

  • I’ve got a section on a theme were I’ve called the author’s gravatar to show up as a picture that accompanies their post. I want to make to if a visitor clicks on that gravatar it would take them to the author’s page with their information and past posts.

    So the code that calls the gravatar is:
    <?php echo get_avatar( get_the_author_email(), '70' ); ?>

    So I tried this just to see if it would work:
    a href=" <?php author_post_link();?>" <?php echo get_avatar( get_the_author_email(), '70' ); ?> /a

    And that didn’t work. So is there a way I can put the author’s link to their page and link it back to their gravatar picture?

Viewing 2 replies - 1 through 2 (of 2 total)
  • You have some minor incorrections in the code shown, but I guess they are caused by the copy-paste.

    That aught to work, what sort of error do you get?

    MAC

    Thread Starter Erik

    (@buckycat7)

    For whatever reason the code wasn’t showing up correctly, so I removed the <> brackets and it seem to show okay, so I know the code syntax is wrong.

    The the_author_post_link command creates it own link and anchor tags. So just the anchor tag looks like this: (simplify)

    <a href="<a href="/author/user">user</a>"><image></a>

    So I just want a way to dynamically creates the link to the author page so I can make the gravatar a clickable link.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Author Post Link’ is closed to new replies.