how to use two permalinks for one custom post type based on categories

If anyone’s interested, the solution was quite close, I only had to specify the rewrite rule with &post_type=film : add_rewrite_rule( ‘projections_dvd/([^/]+)/?$’, ‘index.php?name=$matches[1]&post_type=film&is_projections_dvd=1’, ‘top’ ); I also changed the query vars to make it simpler : function wpd_query_var( $query_vars ) { $query_vars[] = ‘is_international’; $query_vars[] = ‘is_france’; $query_vars[] = ‘is_projections_dvd’; $query_vars[] = ‘categorie’; return $query_vars; } … Read more

Implement post status update as frontend news announcement

Hope this can help: function wpse_display_post_counts_by_categories() { $categories = get_categories(); $container = []; foreach ($categories as $category) { $args = [ ‘post_type’ => ‘post’, // Change to your post type. ‘post_status’ => ‘publish’, ‘category’ => $category->term_id, ‘orderby’ => ‘post_date’, ‘order’ => ‘DESC’, ‘posts_per_page’ => -1 ]; $posts = get_posts($args); if ( count($posts) ) { // … Read more