I am currently developing my own travel website/blog. I would like to add "hotels" and "tips and tricks" to this website. I have made two custom post types that use the default post categories as a taxonomy (as shown below). I haven't bothered making custom taxonomies, as it would triple my work load, since I would just have to copy all the data from the default categories.
register_post_type('hotels',
array( 'taxonomies' => array('category'),
'labels' => array(
'name' => __('Hotels'),
'singular_name' => __('Hotel'),
'add_new' => __('Add new hotel'),
'edit_item' => __('Edit hotel'),
'new_item' => __('New hotel'),
'view_item' => __('View hotel'),
'search_items' => __('Search hotels'),
'not_found' => __('No hotels found'),
'not_found_in_trash' => __('No hotels found in trash')
),
'has_archive' => true,
'hierarchical' => true,
'public' => true,
'supports' => array('title', 'editor', 'post-formats')
));
Now, there are two things that I can't seem to achieve.
- Get the link of a category (for example: Mexico) that only shows a custom post type and not my default posts. (e.g. I would want to see the hotels in Mexico)
- Get an option in the admin-section (menu) that allows me to add said link to the menu.
Any help would be greatly appreciated.