Reputation: 13537
I have two special users on my site. Let's call them user1 and user2. User 1 manages "user page 1" and user2 manages "user page 2". I want their posts to appear when I click on these links and only see their posts in Wordpress.
Upvotes: 0
Views: 725
Reputation: 2493
Copy your index page loop and then change query from post_per_page query to this and you're done.
$query = new WP_Query( 'author_name=rami' );
Upvotes: 0
Reputation: 986
You can use the get_author_posts_url()
to create a link to a page listing a specific author's posts: http://codex.wordpress.org/Function_Reference/get_author_posts_url
The format of the link (if you just want to go ahead and test it in your browser first) will be http://www.yoursite.com/author/authorname
.
Hope that helps!
Upvotes: 0
Reputation: 4212
You can use wp_qurey() function to show posts from specific authors.
Display posts by author, using author id:
$query = new WP_Query( 'author=123' );
Display posts by author, using author 'user_nicename':
$query = new WP_Query( 'author_name=rami' );
More details here - http://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters
Upvotes: 2