Tag Info

Hot answers tagged

2

Notice that you don't need echo to display the result, since echo=1 is the default settings of wp_get_archives(). As @PieterGoosen explained, the wp_get_archives() function doesn't support the exclude parameter. But we can use _exclude_terms, the custom parameter of the wp_get_archives() function, to exclude posts with some given terms. Here's an ...


1

You can use the pre_get_posts action to set posts_per_page to -1 on the monthly archive pages. I said wrongly in a comment to use is_archive() as your conditional. The problem with is_archive() is, it returns true on all archives, which includes category and taxonomy archive pages as well. I would suggest to make use of is_date() and is_month() if you ...


1

Your code won't work as there are no exclude parameter in wp_get_archives(). Here is the list of valid parameters and their defaults <?php $args = array( 'type' => 'monthly', 'limit' => '', 'format' => 'html', 'before' => '', 'after' => '', 'show_post_count' => ...



Only top voted, non community-wiki answers of a minimum length are eligible