Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I know you guys have seen hundreds if not thousands of 404 questions. I assure you I have done everything in my power. 1. updates permalinks 2. using /%post_id%/%postname%/ for structure 3. have been working on a clean 3.2 install 4. no plugins or extra functions

now not all archives are broken for example this

php wp_get_archives( array( 'type' => 'monthly' ) );

works fine, the resulting url structure is for example, site.com/blog/date/2011/06/

however this is not what i am trying to get to work what does not work is this

<ul class="archive-list">
<?php
$months = $wpdb->get_results("SELECT DISTINCT MONTH( post_date ) AS month , YEAR( post_date ) AS year, COUNT( id ) as post_count FROM $wpdb->posts WHERE post_status = 'publish' and post_date <= now( ) GROUP BY month , year ORDER BY post_date DESC");
foreach($months as $month) : ?>
<li><a href="<?php bloginfo('url') ?>/<?php echo $month->year; ?>/<?php echo date("m", mktime(0, 0, 0, $month->month, 1, $month->year)) ?>"><?php echo date("F", mktime(0, 0, 0, $month->month, 1, $month->year)) ?> <?php echo $month->year ?> - <span class="archive-list-small"><?php echo $month->post_count; if ($month->post_count> 1 ) { echo " posts"; } else { echo " post"; }?></span></a></li>
<?php endforeach; ?>
</ul>

the resulting url structure is site.com/blog/2011/06/ , no date, even if i add date that does not change anything, i still get 404, yes i have updated my permalinks and put it to default if that makes a difference and back and back to default and over the menu to mars as well

to make things worse i get 404 on the second page of the regular

wp_get_archives( array( 'type' => 'monthly' ) );

can someone please test this out, one more thing the quarried items are custom posts types

share|improve this question

closed as too localized by toscho Dec 17 '12 at 21:50

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, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
i kinda think i know whats the problem, the regular query does not recognize custom posts, hence you get 404 –  vachi Jul 5 '11 at 7:20
    
i have come up with to hacks to get this to work, there must be a better way tho adding filter to request $query['post_type'] = 'any'; this works –  vachi Jul 5 '11 at 14:07