Top Level pages in wordpress giving 404, but child pages working fine

Basically everything works fine except for the top level pages ( e.g. category, archives, single post, custom post type, etc…).

I have 3 custom post types and 4 custom taxonomies (each custom taxonomy is attached to a post type respectively and there is one more taxonomy that is attached to all of the post types). Here is the set up for both of them:

Read More
register_taxonomy(
    'newsroom-topics',
    array ( 0 => 'news-post',),
    array (
        'hierarchical' => true, 
        'label' => 'Newsroom Topics',
        'show_ui' => true,
        'query_var' => true,
        'rewrite' => array('slug' => '/'),
        'singular_label' => 'Newsroom Topic'
    ) 
 );

register_post_type(
    'news-post',
    array(  
        'label' => 'Newsroom Posts',
        'description' => '',
        'public' => true,
        'show_ui' => true,
        'show_in_menu' => true,
        'capability_type' => 'post',
        'hierarchical' => false,
        'rewrite' => array('slug' => 'newsroom'),
        'query_var' => true,
        'has_archive' => true,
        'exclude_from_search' => false,
        'menu_position' => 5,
        'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','page-attributes','post-formats',),
        'taxonomies' => array('content-type','newsroom-topics',),
              'labels' => array (
              'name' => 'Newsroom Posts',
              'singular_name' => 'Newsroom Post',
              'menu_name' => 'Newsroom Posts',
              'add_new' => 'Add Newsroom Post',
              'add_new_item' => 'Add New Newsroom Post',
              'edit' => 'Edit',
              'edit_item' => 'Edit Newsroom Post',
              'new_item' => 'New Newsroom Post',
              'view' => 'View Newsroom Post',
              'view_item' => 'View Newsroom Post',
              'search_items' => 'Search Newsroom Posts',
              'not_found' => 'No Newsroom Posts Found',
              'not_found_in_trash' => 'No Newsroom Posts Found in Trash',
              'parent' => 'Parent Newsroom Post',
),) );

Any thoughts as to why this is happening?

UPDATE:

So after having just post this after a while of looking for why this was happening, i found out the problem. In the reading settings, my front page was set to be displayed as a static page, and when i changed it back to the default, everything worked fine.

Related posts

1 comment

  1. If you register new custom post types and get weird 404s, you just need to change your permalink settings. This happens to me pretty much every time. You can change the, right back to where they were before. It’s just the act of changing them that does the trick.

Comments are closed.