Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get Wordpress archives by author username?

Tags:

php

wordpress

I need to get archives of one author and exlude all others, Wordpress wp get archives() doesn't have that kind of filter. How can I fitler all other others except one author from archives?

http://codex.wordpress.org/Template_Tags/wp_get_archives

<?php wp_get_archives('type=monthly'); ?>
like image 894
newbie Avatar asked Oct 15 '25 00:10

newbie


1 Answers

Just off the top of my head:

get_posts(array('author_name' => 'the_authors_name'))

You don't get anything preformatted like from wp_get_archives, just the list of posts, but you get the posts by author. If you need to do more fancy things or want to run a WP Loop you can do a custom WP_Query object as well.

like image 98
Gipetto Avatar answered Oct 17 '25 13:10

Gipetto



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!