Custom Post Type Permalink For Parent/Child, 404 Page Not Found Error

In answer to my own question: It turns out the WordPress permalink structure works perfectly well for custom types, e.g. example.com/recipes/lunch/sandwich/. This works exactly as expected if you set ‘hierarchical’ => true. What I was originally trying to do was unnecessarily difficult to execute, and requires properly setting up a custom permalink structure to avoid … Read more

Taxonomy + post_type

Don’t know how did you set the post type and the taxonomy, but by default I think you’re supposed to see all quotes from an author through myblogname.com/the-author-name. If you want to place static words such auteur or citation in the link, then this is related to how you set the options for creating the … Read more

Create permalink structure for one taxonomy archive per custom post type

This is very easy to do by adding custom rewrite rules. This should get you started: add_action( ‘init’, ‘wpse_100386_rewrites’ ); function wpse_100386_rewrites() { add_rewrite_rule( ‘case-studies/room/([^/]+)/?’, ‘index.php?the_room=$matches[1]&post_type=the_case_study’, ‘top’ ); add_rewrite_rule( ‘videos/room/([^/]+)/?’, ‘index.php?the_room=$matches[1]&post_type=the_video’, ‘top’ ); } As always when changing rewrite rules, be sure to flush your rewrite rules by going to Settings -> Permalinks and click … Read more

has_term or in_category for Custom Post Types

has_term() need third parameter to specify which post type have this term. So, your code would be if ( has_term(‘sold’, ‘category’, ‘property’)) { ?> <div class=”sold_prop_note”> <h3>This Property is sold. Take a look at our current exclusives! <a href=”https://wordpress.stackexchange.com/properties”>View Exclusives</a></h3> </div> <?php } Beside that approach, you can use following global $post; if ( ( … Read more