Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter dwarrell

    (@dwarrell)

    For those playing along at home: an update and (apparent) fix.

    I also noticed that the 404 was occurring when paging through the archives of my custom taxonomies. Viewing the first page of the archive worked fine, but visiting subsequent pages resulted in a 404.

    The fix involves changes to two functions in the WordPress core files.

    1) Modify handle_404 in classes.php to add an exception for Taxonomies alongside those already in place for Tags, Categories and Authors. Change the following line (classes.php line 464 in WP v2.9.1):
    if ( ( is_tag() || is_category() || is_author() ) && $wp_query->get_queried_object() ) {
    to:
    if ( ( is_tag() || is_category() || is_author() || is_tax() ) && $wp_query->get_queried_object() ) {

    2) Modify get_queried_object in query.php to return empty Taxonomy terms. Change the following line (query.php line 2563 in WP v2.9.1):
    $term = &get_terms($tax, array('slug'=>$slug));
    to:
    $term = &get_terms($tax, array('slug'=>$slug, 'hide_empty'=>0));

    If anyone has any insights into the validity or otherwise of these changes, I’d appreciate hearing them, but they seem to be working fine for me so far.

Viewing 1 replies (of 1 total)