Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm working on a website where I've set has_archive to 'true' on a custom post type and now when I call the wp_get_archives in my template code for just the regular blog posts, it's pulling the archive numbers for the custom post type as well. Is there any way to eliminate the archive posts from the custom post types when using wp_get_archives for the regular blog post pages?

Below is what I'm using to show the archives on the blog sidebar

<select name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;">
<option value=""><?php echo esc_attr( __( 'Select Month' ) ); ?></option>
<?php wp_get_archives( 'type=monthly&format=option&show_post_count=1' ); ?>
</select>
share|improve this question
I think I solved my problem. I needed to refresh the permalinks. Once I did that, it started showing the archives correctly. – john_the_geek Jan 2 at 2:53
1  
Please post your solution as an answer and accept it – bungeshea Jan 2 at 3:12
Your plugin for the custom post types should refresh the permalinks in an activation hook anyway. – toscho Jan 2 at 6:07

closed as too localized by toscho Jan 3 at 21:36

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.