Title: Array articles by author/tag?
Last modified: August 21, 2016

---

# Array articles by author/tag?

 *  [CombatPost](https://wordpress.org/support/users/combatpost/)
 * (@combatpost)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/array-articles-by-authortag/)
 * 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)

 *  [Rajesh Soni](https://wordpress.org/support/users/rajeshsoni/)
 * (@rajeshsoni)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/array-articles-by-authortag/#post-4300933)
 * Okay so what’s the code you’re using and what is the result?
 *  Thread Starter [CombatPost](https://wordpress.org/support/users/combatpost/)
 * (@combatpost)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/array-articles-by-authortag/#post-4300974)
 * 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.
 *  [jtyarks](https://wordpress.org/support/users/jtyarks/)
 * (@jtyarks)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/array-articles-by-authortag/#post-4300992)
 * Hey CombatPost,
 * I’m sorry if I’m misunderstanding what you’re hoping to do, but does [WordPress’ sample author template](http://codex.wordpress.org/Author_Templates#Sample_Template_File)
   provide any insight?
 * Is there something else you’re trying to accomplish that isn’t described in that
   template?
 *  Thread Starter [CombatPost](https://wordpress.org/support/users/combatpost/)
 * (@combatpost)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/array-articles-by-authortag/#post-4300994)
 * Hi,
 * My mistake, I was misreading the sample templates. Got it all working fine now,
   thanks for the replies.
 *  [Rajesh Soni](https://wordpress.org/support/users/rajeshsoni/)
 * (@rajeshsoni)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/array-articles-by-authortag/#post-4300995)
 * 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.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 3 participants
 * Last reply from: [Rajesh Soni](https://wordpress.org/support/users/rajeshsoni/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/array-articles-by-authortag/#post-4300995)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
