• I have been trying to figure out the strangest error for two days and I’m out of ideas. Here’s hoping somebody else has seen and solved this:

    I have custom post type for news on my site at http://scalingupnutrition.org/news. As you can see there are posts there from every month starting in September 2012. If you click the monthly archive link (bottom right column) for September or October, it works beautifully. But clicking those same archive links for November/December/January returns a 404. There’s content that should be showing there (and anyway if it was an empty archive it wouldn’t return that 404 page).

    I’ve tried the following to no avail:

    • Reverting to default permalinks and then restoring my custom permalink structure (/%category%/%postname%).
    • Wiping my .htaccess and replacing it with the WordPress default.
    • Edits to the archive loop, but none of them changed anything except the pages that are already working.

    I’m wondering if maybe somehow the wp_query parameter of monthnum is somehow not registering for months after October. Because here’s the relevant snippet from the archives loop:

    `else {
    if(!empty($wp->query_vars[‘monthnum’])){
    $args = array(
    ‘post_type’ => ‘news’,
    ‘post_status’ => ‘publish’,
    ‘year’ => $wp->query_vars[‘year’],
    ‘monthnum’ => $wp->query_vars[‘monthnum’],
    ‘posts_per_page’ => nss_get_setting(‘numbernewspage’),
    ‘paged’ => empty($paged)?1:$paged

    );
    }else{
    $args = array(
    ‘post_type’ => ‘news’,
    ‘post_status’ => ‘publish’,
    ‘posts_per_page’ => nss_get_setting(‘numbernewspage’),
    ‘paged’ => empty($paged)?1:$paged

    );
    }`

    [Please do not bump]

Viewing 3 replies - 1 through 3 (of 3 total)
  • What happens if you create a new article for one of the months that doesn’t work. (change the timestamp)

    Thread Starter aprilnm

    (@aprilnm)

    It still returns the same error. I thought maybe it was the content too but putting content from October into January and removing the current January content, for example, doesn’t change things.

    Strange, as stumped as I am with my error!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘404 errors only on *some* monthly pages of custom post type archive’ is closed to new replies.