Add Product categories to WordPress menu without losing hierarchy
Add Product categories to WordPress menu without losing hierarchy
Add Product categories to WordPress menu without losing hierarchy
After combining a bunch of pieces of other answers I got it working! So here’s the solution for those of you who are struggling with this too: This post and this one helped me out some, so thanks to those guys. Note, all this code, plus your initial custom post type and taxonomy registration code … Read more
What you write reminded me to some plugin / widget I know of. It’s related to Silo Web Design and the plugin is the Silo Widgets Plugin For WordPress. In SemPro you can make use of inline widgets to display something like that within posts.
I have solved the answer to this problem by doing this: echo get_permalink( $page->ID ); This gave me the right links to the pages.
The way WordPress works for hierarchical post types is that post parent should always be the same post type of children. For that reason, in admin screens, the post type in edit.php is pretty hardcoded. However, what WordPress do is to run a WP_Query where ‘post_type’ argument is the current one. So, what you can … Read more
I’m guessing the part you want to change is the actual content output area (not the nav). If so, you could do this: <?php $args = array( ‘post_type’ => ‘manual’, ‘posts_per_page’=>’-1′, ‘orderby’=>’menu_order’, ‘order’=>’asc’ ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); $class=”parent”; $header=”h1″; if ($loop->post->post_parent !== 0) { $class=”child”; $header=”h2″; … Read more
wp_get_object_terms will give you the term assigned to the post, you could then use get_ancestors to get an array of the parent’s IDs, then get_term_by ID to get the names and slugs.
When you declare the custom post type, there is a parameter “rewrite” where you declare the slug for the post type. Change the slug to “media/videos”, and then visit your Settings > Permalinks page to update your rewrite rules. register_post_type( ‘videos’, array(‘labels’ => array(), ‘rewrite’ => array( ‘slug’ => ‘media/videos’, ‘with_front’ => false ) ) … Read more
I believe that CPT-onomies may do what you’re looking for. The plugin allows you to use a post type as a taxonomy, so you would set up Team Members as a post type and include their post information, but then be able to use each post as a custom taxonomy as well. As for the … Read more
Sounds like you want wp_dropdown_categories() to me: $tax_args = array( ‘taxonomy’ => ‘location’, ‘orderby’ => ‘name’, ‘show_count’ => 1, ‘hierarchical’ => 1, ); wp_dropdown_categories($tax_args);