Category page only displaying the posts from a custom type
Ok I found a solution by following the recommandation of s_ha_dum to use pre_gets_posts. All the following code goes to functions.php 1 Create a new rewrite rule function rewrite_clean() { // my CPTs $types = array(‘projects’, ‘works’); foreach($types as $type) { add_rewrite_rule(‘^’.$type.’/([^/]*)/?$’, ‘index.php?post_type=”.$type.”&term=$matches[1]’,’top’); } } add_action(‘init’, ‘rewrite_clean’); transform the following format ?post_type=projects&term=architecture to the following … Read more