WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Category Archive
Category Archive / Permalink Errors (2 posts)

  1. fongandrew
    Member
    Posted 3 years ago #

    Same bug as here, but in 3.1: http://wordpress.org/support/topic/permalink-rewriting-in-30.

    Tried changing code -- didn't work. Tried changing permalink structure -- anything not default doesn't work.

  2. Hugh Mandeville
    Member
    Plugin Author

    Posted 3 years ago #

    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'];
        }
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic