I am trying to create a custom post type for "Blogs". When I change rewrite to true I get 404 to the custom post type.
This is my custom post type code:
<?
add_action('init', 'kula_custom_post_blog_posts_init');
function kula_custom_post_blog_posts_init()
{
$labels = array(
'name' => 'Blogs',
'singular_name' => 'Blog'
);
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => true,
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title','editor','author','thumbnail','excerpt','comments')
);
register_post_type('blog-post',$args);
}
?>
That's practically copied right out of Codex. So I don't think that's the problem. I also checked my .htaccess file and it has all the right code:
# 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>
# END WordPress
What else might be causing the problem?
Thanks