[wp-hackers] 404 template loads instead of taxonomy

Enej Bajgoirc enej.bajgoric at gmail.com
Mon Mar 8 19:14:49 UTC 2010


Hi 

I am developing a custom theme that is using, the custom taxonomy 


I have this in my functions.php file of the theme.

add_action( 'init', 'phylomon_taxonomies', 0 );
function phylomon_taxonomies() {
	register_taxonomy( 'classification', 'post', array( 'hierarchical' => false, 'label' => 'Classification', 'query_var' => true, 'rewrite' => array( 'slug' => 'classification' )  ) );

}

However the urls that I generate with 
<?php echo get_the_term_list( $post->ID, 'classification',"",", "); ?> 
don't render the taxonomy.php file that I have inside the theme folder. 
instead the 404.php file is used. 

I am not sure if I am missing something. 
When I do something like <?php var_dump($wp_rewrite); ?> I can see that the rewrite rules have been written 
to the wp_rewrite object. 

["extra_rules_top"]=>
  array(4) {
    ["classification/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$"]=>
    string(53) "index.php?classification=$matches[1]&feed=$matches[2]"
    ["classification/([^/]+)/(feed|rdf|rss|rss2|atom)/?$"]=>
    string(53) "index.php?classification=$matches[1]&feed=$matches[2]"
    ["classification/([^/]+)/page/?([0-9]{1,})/?$"]=>
    string(54) "index.php?classification=$matches[1]&paged=$matches[2]"
    ["classification/([^/]+)/?$"]=>
    string(36) "index.php?classification=$matches[1]"
  }
["extra_permastructs"]=>
  array(1) {
    ["classification"]=>
    string(32) "/classification/%classification%"
  }
and it other places as well. I am using wordpress MU 2.9.1 and developing on MAMPs. 
also the contents of my .htaccess file look like this 
RewriteEngine On
RewriteBase /

#uploaded files
RewriteRule ^(.*/)?files/$ index.php [L]
RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
RewriteRule ^(.*/)?avatar/(.*) wp-content/avatar.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteCond %{REQUEST_URI} ^.*/wp-admin$
RewriteRule ^(.+)$ $1/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

<IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>

Any help with this would be greatly appreciated. 

Thanks Enej





More information about the wp-hackers mailing list