Using WordPress, if you create Custom Post Type and while adding records you also post them under standard Posts Categories or Sub categories, they won’t appear under the listing of those categories standard posts.
To resolve this and include Custom Post Type records in the categories listing, add the following code in your theme functions.php file:
add_filter('pre_get_posts', 'query_post_type');
function query_post_type($query) {
if(is_category() || is_tag()) {
$post_type = get_query_var('post_type');
if($post_type)
$post_type = $post_type;
else
$post_type = array('post','celebrity'); // replace 'celebrity' to your custom post type
$query->set('post_type',$post_type);
return $query;
}
}
Hope that helps.
Cheers!