• Resolved phil404

    (@phil404)


    Currently, I am using the “WordPress Category Archive” plugin with WP 2.9.2 in order to create an archive widget – much like the default Archive widget – that generates a list of years (linked) for posts within a specified category.

    WordPress Category Archive
    https://www.ads-software.com/extend/plugins/wp-category-archive/

    Permalink configuration:
    /%category%/%year%/%monthnum%/%postname%/

    This very same setup does not work in WP 3.0 when using anything but the default permalink option.

    Have the rewrite rules changed in WP 3.0?

    Thanks.

    -phil

Viewing 5 replies - 31 through 35 (of 35 total)
  • See the category archive plugin FAQ.

    To get the plugin to work with permalinks in WP3.1, you need to update the redirect_canonical() function in canonical.php. On line 167, wrap the following code:

    $tax_url = parse_url($tax_url);
    if ( ! empty($tax_url['query']) ) { // Custom taxonomies may only be accessable via ?taxonomy=..&term=..
        parse_str($tax_url['query'], $query_vars);
        $redirect['query'] = add_query_arg($query_vars, $redirect['query']);
    } else { // Taxonomy is accessable via a "pretty-URL"
        $redirect['path'] = $tax_url['path'];
    }

    in an if (is_tax()) block:

    if (is_tax()) {
        $tax_url = parse_url($tax_url);
        if ( ! empty($tax_url['query']) ) { // Custom taxonomies may only be accessable via ?taxonomy=..&term=..
            parse_str($tax_url['query'], $query_vars);
            $redirect['query'] = add_query_arg($query_vars, $redirect['query']);
        } else { // Taxonomy is accessable via a "pretty-URL"
            $redirect['path'] = $tax_url['path'];
        }
    }

    Thanks Hugh for your reply. I am using wp 3.1 so I changed the code as per above. in my .htaccess I have:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    My permalinks settings are:
    /%category%/%year%/%monthnum%/%post_id%/%postname%/

    Now when I click on a specific month I still don’t get the results I should, instead I kind of stay on the same page.
    Any other suggestions?

    Not sure, maybe clear your cache. I tried the same permalink structure you have

    /%category%/%year%/%monthnum%/%post_id%/%postname%/

    and it works for me. The month links should look something like

    /category-label/2011/03/

    Thank you Hugh, now it works !!!

    I don’t know why it doesn’t work for me. ??
    I wonder if it’s because I have category base set up as Categories in Permalinks settings?
    i changed:

    $tax_url = parse_url($tax_url);
    if ( ! empty($tax_url['query']) ) { // Custom taxonomies may only be accessable via ?taxonomy=..&term=..
        parse_str($tax_url['query'], $query_vars);
        $redirect['query'] = add_query_arg($query_vars, $redirect['query']);
    } else { // Taxonomy is accessable via a "pretty-URL"
        $redirect['path'] = $tax_url['path'];
    }

    TO

    if (is_tax()) {
        $tax_url = parse_url($tax_url);
        if ( ! empty($tax_url['query']) ) { // Custom taxonomies may only be accessable via ?taxonomy=..&term=..
            parse_str($tax_url['query'], $query_vars);
            $redirect['query'] = add_query_arg($query_vars, $redirect['query']);
        } else { // Taxonomy is accessable via a "pretty-URL"
            $redirect['path'] = $tax_url['path'];
        }
    }

    BUT the problem is still there. does anybody have any other suggestions please?

Viewing 5 replies - 31 through 35 (of 35 total)
  • The topic ‘Permalink rewriting in 3.0’ is closed to new replies.