WP_Query arguments to fetch custom post type posts which are in certain category?
If you want your main query to take in account your custom post type, you can do as shown below : function add_custom_post_type_to_query( $query ) { if ( $query->is_archive() && $query->is_main_query() ) { $query->set( ‘post_type’, array(‘post’, ‘my_custom_post_type’) ); } } add_action( ‘pre_get_posts’, ‘add_custom_post_type_to_query’ ); You can place the above code in your theme’s functions.php or … Read more