Rewriting hierarchical post type

No, this is not possible. Only pages and posts are able to work without a permalink base. When working with custom post types, you always have a permalink base. That’s just how WordPress works. And the third line of your example can’t work when country is already a child of region, because the parent-child relation … Read more

how to create child posts with parent post in wordpress?

first you can know the relationship between child post and parent post try to figure it out or just try this code $query = new WP_Query( array( ‘post_parent’ => get_theID(), ‘posts_per_page’ => 3, //shows only 3 children. If you want to show all of them, comment this line )); while($query->have_posts()) { $query->the_post(); /*Output the child … Read more

Hierarchical gallery

WordPress Posts (First level) Yes, the posts feature can be used as a gallery. WordPress provides nice short code to show all the attached images in post. While adding galleries make sure they point to attachment page not to the real file. When user clicks on any of image from the gallery they’ll get to … Read more

List child terms and posts in the current term

ok, i don’t know how this looks but i’ve got exactly what i wanted. <?php $term = get_queried_object(); $tax = ‘ntp_package_type’; $parents = $term->parent; $term_id = $term->term_id; if($parents == 0 && !is_single()){ wp_list_categories( array ( ‘taxonomy’ => ‘ntp_package_type’, ‘pad_counts’=> 0, ‘title_li’ => ”, ‘child_of’ => $term_id, ) ); } elseif ($parents > 0 && is_tax($tax, … Read more

tech