get_pages — parent vs child_of?
I believe the difference is depth. For parent, that’s one level deep, whereas child_of is multiple levels (grandchildren).
I believe the difference is depth. For parent, that’s one level deep, whereas child_of is multiple levels (grandchildren).
This will allow you to use the post name without the slug. Essentially anytime the link is requested it can be altered to exclude the base post type. And any time a query runs with just a name, the available post types used in the search are altered to include your post type. function wpse_remove_cpt_slug( … Read more
I haven’t fully tested this, but it may be helpful: Categories in Hierarchical Order plugin at https://wordpress.org/plugins/categories-in-hierarchical-order/
<?php the_category( ‘ > ‘, ‘multiple’, $post->ID); echo ‘ > ‘; the_title(); ?> This works correctly when the post is in just one category. But if it’s in multiple categories, or if the category parents are also selected — in your case, if the post is also in super-cat and parent-cat — then it displays … Read more
Hierarchical Custom Posts – Highlighting Current Post in Sub-Menu
To wrap your titles in h2 just change echo $ban_titles; to echo ‘<h2>’. $ban_titles . ‘</h2>’;. If you want to limit number of titles displayed to 2 change for($i=0; $i<count($pages); $i++) to for($i=0; $i<2; $i++). Hope it helps, PHP is not so scary after all 🙂 [edit] How about that? //This is the loop that … Read more
IF it were me, I would make “Year” and “Month” separate taxonomies rather than using a hierarchical taxonomy. If you do it that way, here’s a good answer to use as a reference. This will solve the “unique slug” issues you’ll run into using hierarchical taxonomies.
Custom Post Type with two hierarchical Custom Taxonomies: strategy to generate best permalink structure
Custom Posts Hierarchy? (State/City/Restaurant)
How to Combine Two Custom Post Types into Single Permalink Structure