How can I get Wordpress archives by username?

I need to get the archives of one author and exclude all the others, Wordpress wp get archives () does not have such a filter. How can I remove all the others except one author from the archives?

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

<?php wp_get_archives('type=monthly'); ?>
+3
source share
1 answer

Above my head:

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

You do not get anything pre-formatted as from wp_get_archives, just a list of messages, but you get messages from the author. If you need to do more fancy things or want to run WP Loop, you can also create your own object WP_Query.

+3
source

Source: https://habr.com/ru/post/1716286/


All Articles