• Hi all,

    I’m trying to edit the author/tag page, I want to create a list of articles by the clicked author/tag, is this possible?.

    I’m basically using the same template that I use for category page but instead of arraying by category I need them arraying by author/tag.

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Okay so what’s the code you’re using and what is the result?

    Thread Starter CombatPost

    (@combatpost)

    Hi Rajesh,

    The code I’m currently using is:

    <?php
    global $post;
    $current_author = get_query_var('author');
    $author_posts=  get_posts( 'author='.$user->id.'&posts_per_page=15' );
    foreach ($author_posts as $author_post) :
    setup_postdata($post);
    ?>

    The results I get is that when I click on an Author’s name, it displays a list of the same article from which I clicked the name from. So if the article was named ‘Hello World’ and I clicked the authors name, it would display a list of 15 ‘Hello World’ articles.

    Hey CombatPost,

    I’m sorry if I’m misunderstanding what you’re hoping to do, but does WordPress’ sample author template provide any insight?

    Is there something else you’re trying to accomplish that isn’t described in that template?

    Thread Starter CombatPost

    (@combatpost)

    Hi,

    My mistake, I was misreading the sample templates. Got it all working fine now, thanks for the replies.

    Try changing

    setup_postdata($post);

    to

    setup_postdata($author_post);
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Array articles by author/tag?’ is closed to new replies.