Check if is post type archive and in category

You would just need to add your else if checks as needed. Category archives can be detected using is_tax( $taxonomy, $term ) or more specifically is_category( $term_id|$term_name ). // ADD ARCHIVE LAYOUT FOR POSITION VIDEOS POST TYPE function custom_filter_positionvids_layout( $layout_id ) { if ( is_post_type_archive( ‘position_video’ ) ) { return ’58bef4ba370de’; } if ( is_category( … Read more

Archive list for custom post type categories

How did you create the link with your category ’39’? Is it a custom taxonomy? Here’s the test i just did and it works fine: In functions.php i created the custom post type ‘recipe‘: add_action( ‘init’, ‘create_recipe’ ); function create_recipe() { register_post_type( ‘recipe’, array( ‘labels’ => array( ‘name’ => __( ‘Recipes’ ), ‘singular_name’ => __( … Read more

Showing only future posts in archive based on custom field date

The problem here is that, most probably, you store date in CF show_date in ‘YYYY-mm-dd’ format. You have to use the same format in comparisons… Something like this should work just fine: $args = array( ‘post_type’ => ‘esitykset’, ‘meta_key’ => ‘show_date’, ‘orderby’ => ‘meta_value’, ‘order’ => ‘ASC’, ‘meta_compare’ =>’>=’, ‘meta_value’ => date(‘Y-m-d’), ‘posts_per_page’ => 20, … Read more

Make Two Views of Post Type Archive At Two URLs

Updated approach The first thought/suggestion I made actually – like you said – doesn’t work as I understood it. At least I tried it and couldn’t figure it out. That said, what you want is still achievable, but not by using a endpoint or at least not by making use of add_rewrite_endpoint(). However I figured … Read more