Hi I am trying to create a custom post type display page but for some reason the page is not working and I get sent to the 404.php.Here is my code:
add_action('init' , 'business_manager_register');
function business_manager_register(){
//add custom post type
$args = array(
'label' => 'Business Managers',
'singular_label' => 'Business',
'public' => true,
'shouw_ui' => true,
'capability_type' => 'post',
'hierarchical' => true,
'has_archive' => true,
'supports' => array('title','editor','thumbnail'),
'rewrite' => array('slug' => 'businesses' , 'with_front' => false)
);
register_post_type('businesses' , $args);
}
Now in order to display it I have created the file archive-businesses.php.Accoding to the slug I added the link should be something like this:
link/businesses
But when I try link to it I get the 404 error same thing happenes for the single-businesses.php.What am I doing wrong here?
I’ve got almostly the same problem, in my case though the archive worked but then has somehow got broken. Well, flushing permalinks helped. I used the 1st way from here: http://wp-bytes.com/function/2013/02/flushing-permalinks/
And while doing that I saw that my permalinks structure was set to “custom”. I’changed it to “post title” or how is it called in english.
goto settings->permalinks and use post name so that you can view your post