• Hi all!

    I’ve created a section inside my theme’s single.php to include the author’s gravatar and bio.

    I’m trying to insert links to all the author’s posts (an author.php page), as well as the author’s email etc. but the links keeps linking back to the current post displayed.

    What am I doing wrong???

    Any help would be appreciated!

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • What am I doing wrong???

    Having no idea what you are actually doing, its hard to say what you are doing wrong.

    Thread Starter jacogriesel

    (@jacogriesel)

    This is the link I’m trying to create to point to an archive page with all the author’s posts:

    <p>Read all <strong><?php the_author(); ?>'s</strong> entries <a href="<?php the_author_posts(); ?>"><strong>here...</strong></a></p>

    This is the link to the author’s email address:

    <a href="<?php the_author_email(); ?>"><img src="<?php bloginfo('template_url'); ?>/images/authoricons/email.png" alt="Send <?php the_author(); ?> an email" border="0" title="Send <?php the_author(); ?> an email" /></a>

    All this is inside the loop on the single page, and it all links back to the current post being displayed. What am I doing wrong?

    Any help would be much appreciated.

    1. the_author_posts() returns a count of the posts written by the author, not the URL. Its in the codex. You want the_author_link() or maybe the_author_meta().
    2. Your email link has no ‘mailto:’ component. Again, see the codex. Also notice that the_author_email is deprecated.
    Thread Starter jacogriesel

    (@jacogriesel)

    Thanks a lot! I’ll look into it and report back!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Links inside loop not working – HELP NEEDED!’ is closed to new replies.