Showing current subcategory

I have problem. <?php query_posts(‘category_name=events&posts_per_page=2&offset=1’); ?> <?php while (have_posts()) : the_post(); ?> <div> <?php $children = get_categories(‘child_of=3’); foreach ($children as $child) { $child = get_category($child); echo $child->cat_name; }; ?> </div> <?php endif; ?> <?php endwhile; ?> I would like to show the current subcategory name from any parent category. With this I only manage to … Read more

How do I create a magazine type menu – sub-menu setup using wp_nav_menu and child of twentyten? [closed]

Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for WordPress Development Stack Exchange. Closed 9 years ago. Improve this question I’m trying to create a menu and submenu with a child theme of twentyten, similar to this at the LA Times: … Read more

Child pages on hierarchical Custom Post Types 404s

I’ve been working with Custom Post Types lately and haven’t had any major problems. This time I’m trying something new. I want to create a CPT which basically works like Pages, with page hierarchy. The real thing is in Swedish so I’ll use “Books” as an example on how I would like it to work. … Read more

Delete Child Posts

I’m trying to delete all child posts when the parent is deleted. The parent post deletes just fine, but the child posts are not properly deleting. Here’s the code I have in place now: $args = array( ‘post_parent’ => $parentid, ‘post_type’ => ‘custom-type’ ); $posts = get_posts( $args ); if ($posts) { // Delete all … Read more

Prev/Next child navigation for current page?

How can I get a Previous / Next navigation that only navigates the child pages of the current page? By that i mean url.com/page/child1, url.com/page/child2 and so on.. I’ve been searching around alot but I’m still lost. It seems like you can’t do that according to wordpress (they recommend plugins..) 7 Answers 7 All right, … Read more

Show just one level of child pages, wp_list_pages woe

I’m working on a site that has a fairly large page structure a few levels deep – in some sections there are a lot of pages. The basic setup is something like this… Parent Parent Parent -Child -Child –Grandchild –Grandchild –Grandchild —GreatGrandchild -Child -Child –Grandchild –Grandchild –Grandchild —GreatGrandchild -Child Parent -Child Parent Parent -Child -Child … Read more

How to make child categories recognize parent’s template displays

I’m using the Default Post Type post for various purposes. To sort them I’m using different categories. And I’m designing different category layout using the slug preference, like: category-book.php, category-notice.php etc., and everything was just fine. But just a moment ago found that, any subcategory of the parent category ‘book’ is redirecting to index.php (or … Read more