Parent & Child Taxonomy slugs in custom post permalink

To handle the extra URL segment you need to add another rewrite rule similar to the one generated by add_permastruct, but with an extra capture group and slash for the additional level of terms: add_rewrite_rule( ‘book/([^/]+)/([^/]+)/([^/]+)-blah-blah-blah?(:/([0-9]+))?/?$’, ‘index.php?post_type=book&name=$matches[3]’, ‘top’ ); Also, as I mentioned in my comment, the query var and slug author are already in … Read more

Twenty Fifteen: Adjacent posts by menu_order [duplicate]

EDIT According to the OP, this question/answers solved the issue ORIGINAL ANSWER the_post_navigation(), right down to its very core, uses get_adjacent_post() to return and display the next and previous post to the currently viewed post. By default, these adjacent posts are returned by post date. We can alter that by filtering the relevant ORDERBY clause … Read more

Use post as category

If I understand you correctly, no, you can’t treat a post like a category and associate other posts with it. It sounds like you created this second custom post type because you wanted to associate content with each ‘category post’. If I understand your needs correctly, I think you’ll be better served by registering that … Read more

Permalink Structure CPT With Custom Taxonomy Fails

Setting has_archive to true causes WordPress to generate a rewrite rule for the archive using the rewrite slug, which is not what you want in your case. Instead, explicitly specify the archive slug as a string and the correct rules will be generated: $args = array( ‘has_archive’ => ‘courses’, ‘rewrite’ => array(‘slug’ => ‘courses/%course-type%’,’with_front’ => … Read more

URI returns a post when it should return a 404

WordPress tries to guess what post the user want to see by post name. That is what is making both example.com/new-bikes/ktm/duke/ktm-690-duke-2012/ and example.com/new-bikes/ktm/yamaha/ktm-690-duke-2012/ return the same and “correct” content. What is important is that, if you see at the source code of example.com/new-bikes/ktm/yamaha/ktm-690-duke-2012/, you can see the canonical URL correctly set to example.com/new-bikes/ktm/duke/ktm-690-duke-2012/. User gets … Read more