so I have this custom post type and taxonomy which i set the rewrite to books because I want the URL to the specific book to be http://domain.com/books/booktitle
So this is what I have so far:
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'exclude_from_search' => false,
'show_ui' => true,
'show_in_nav_menus' => true,
'query_var' => true,
'show_in_admin_bar' => false,
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_icon' => get_template_directory_uri() . '/images/books16x16.png',
'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt' ),
'rewrite' => array( 'slug' => __( 'books', 'xxr' ) ),
'taxonomies' => array( 'book-cats' )
);
register_post_type( 'books', $args );
register_taxonomy( 'book-cats',
array( 'books' ),
array( 'hierarchical' => false,
'labels' => $labels,
'query_var' => true )
);
Ok so the CPT works and everything is ok in the backend. However in the front end, I am not able to go to the specific book that I created. For example, I created a book title Nomo, so I type http://domain.com/books/nomo but it goes to page not found.
An even more strange finding is I have a custom query that pulls all the CPT on my homepage and it does show everything just fine. But if you however over the book link, it gives a URL of http://domain.com/uncategorized/nomo ??? I am puzzled...Why would it say uncategorized when a category is set for this?
My permalinks are set to /%category%/%postname%/ if that means anything and yes I have refreshed the permalinks already and still same issue.
NOTE: It used to work...not sure what happened...
Any help appreciated.