I register a new Custom Post Type with:
register_post_type('abcd_film',
array(
'labels' => array(
'name' => __( 'Films' ),
'singular_name' => __( 'Film' )
),
'description' => 'Manage the Films',
'supports' => array( 'title', 'editor', 'custom-fields', ),
'public' => true,
'has_archive' => true,
'rewrite' => array('slug' => 'films'),
)
);
My WordPress is located at ( dummy link ) :
www.example.com/folder/wordpress/
My permalink setting is ( the "Post Name" option ):
www.example.com/folder/wordpress/%postname%/
However, I create a new custom post under the custom post type "Films" with post name "Apple", the link shows 404 File Not Found. The .htaccess file is writable by WordPress & the current content written by WordPress is:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /folder/wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /folder/wordpress/index.php [L]
</IfModule>
# END WordPress
I double checked with phpinfo(), the mod_rewrite() module is in "Loaded Module" section. Also, I tried to refresh the Permalink settings in WordPress Admin > General > Permalink > Save Changes.
404 Not Found still persists. What else can I do?
Tried the followings:
add
publicly_queryablewith valuetrueto options array ( it's not required, aspublicis already set totrueand default value ofpublicly_queryableis equal to the value ofpublic)add
with_frontwith valuetruetorewritesub-array ( *it's not required too, as the default value ofwith_frontistrue)add
flush_rewrite_rules(false);afterregister_post_type()
All the above tries have no effect. Cache is already disabled & flushed.
Reference Questions:
flush_rewrite_rules( false );just after?? also, what happens if you change permalink structure ? and do you have'publicly_queryable' => true,- Obmerk Kronen'publicly_queryable' => true&flush_rewrite_rules( false );& cleared cache, still 404 Not Found... - Raptor'rewrite' => array("slug" => "films","with_front" => true),combined with the others . I had the same problem about two weeks ago, but I can not remember just where the culprit was . and please post result of permalink structure change to default .. - Obmerk Kronen