The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
1k views

How can I make wp_list_categories output li with category-slug as class, for its children?

Simply put, I'd like to change the wp_list_categories output from this: <li class="cat-item cat-item-1"><a href="http://mysite.com/category/articles">Articles</a></li> ...
1
vote
1answer
810 views

Show children of top level category only

Imagine i have a URL structure like this: www.domain.com/category/subcategory/ This is my code: <?php $args=array( 'child_of' => $cat-id, 'hide_empty' => 0, 'orderby' => ...
0
votes
1answer
887 views

How to get the top most term (top ancestor) of a custom taxonomy child term?

I need to get the topmost term (top level ancestor) of a taxonomy term. Suppose the following term hierarchy: North America United States New York New York ...
2
votes
1answer
163 views

Only allow new subpages to be created

I'm looking for a way to only allow users to create new subpages once there are nine pages that are parents/root pages. Once there are nine parent pages when trying to create a new parent the users ...
1
vote
6answers
3k views

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 ...
0
votes
2answers
635 views

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 = ...
0
votes
1answer
296 views

Can you exclude child pages of a specific parent within a navigation?

For example, I'm using wp_list_pages to display the navigation, the child pages (and their children) appearing on hover as is typical. However, I want one of these parents to not display the children. ...
2
votes
1answer
1k views

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. ...
0
votes
1answer
944 views

Want Page Descendants when using query_posts post_parent or child_of

I'm trying to use query_posts to list all descendants of a page ID. Using post_parent only lists the first-level children. This Trac ticket seems to address it: ...
0
votes
1answer
524 views

how to display page title only for child category pages

I apologize if this is a dumb question, but I am just learning PHP and Wordpress. It's probably very simple. I have a site where the top-level nav is all parent categories, with the child categories ...
0
votes
1answer
174 views

Only looping through pages that have children or subpages

I have a custom post type called "films", and most films have a subpage (child page) called "press". I am trying to loop through the films, and check to see if a subpage exists. If a subpage exists, ...
0
votes
2answers
699 views

Multiple Loops That Pull Pages (Child/Grandchild) While Styling the First Entry

This is either something really simple that I've orchestrated into a complex problem or it really is a complex problem. I've decided to use pages to display information. If I go to a page called ...
0
votes
1answer
205 views

Give Children Unique ID's

Is there a way I can give each wordpress children (subcategory UL lists) unique ID's? I'm creating a dropdown list for subcategories and I want to position them but :nth-child isn't supported by ...
-1
votes
2answers
543 views

Differentiate Between Parent & Child Categories

So I'm working with a non-wordpress theme called "Misty" and it uses this code to pull categories: <li class="sidebox"> <h3><?php _e('Categories','ml'); ?></h3> <ul ...
0
votes
1answer
89 views

Check for parent category

Code below is designed for testing to see if current post is in a category that is an ancestor (child/grandchild/greatgrandchild etc) of cat number 526 $cats = wp_get_post_categories(); if ...
1
vote
2answers
1k views

Exclude the parent custom post-type posts only

Not sure if this is possible without some form of hard-coding but I have a custom post-type called 'city'. Within the 'city' post-type I have some parent post (e.g. England, America and China) and ...
0
votes
1answer
3k views

Display Child Categories of Current Post ID

I'm starting to love this place more and more, super helpful! Anyway, todays dilemma is as such: I want to display as a list the child terms only, of a specific parent term, of a custom taxonomy, ...
1
vote
3answers
6k views

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 ...
0
votes
1answer
486 views

How to get post id of first child of the same post type?

Is there a function that will let me get the post id of the first child (of the same post type, not attachment)? I could always just run a loop via wp_query but that seems like overkill. :/ The goal ...
0
votes
1answer
1k views

Exclude Child Posts from WP_Query

How can I exclude child posts using wp_query? Given the following architecture: parent 1 child 1 child 2 parent 2 child 3 child 4 I'd like to only return parent 1 and parent 2, and exclude ...
0
votes
1answer
360 views

add slug of child(ren) to li using wp_list_pages

For a page template I am trying to include the 3 children of each page. That works fine. However as I want to include a different image for each of the children, I would like to add the slug of each ...
0
votes
1answer
1k views

Get only immediate children (and not grandchildren) of a hierarchical custom taxonomy term

Say, for example, I have the following custom taxonomy: Term 1 Term 1.1 Term 1.2 Term 1.2.1 Term 1.2.2 Term 1.3 Term 2 Term 2.1 How can I get the children terms of Term 1, ...
1
vote
2answers
546 views

How can I automatically add child pages to pages in a WP menu?

In the WP menu creation GUI there's the Automatically add top level pages option. I would like to do the opposite, for any page that is in the menu, automatically add it's child pages. Is there a way ...
0
votes
1answer
643 views

How to make a query returning pages from multiple parents

I'd like to make a query that returns the children pages of various parent pages. Unfortunately the post_parent attribute of WP_Query accepts only one value. What do you suggest ?
0
votes
1answer
228 views

How can I build a query that returns all attachments of a page and it's children pages?

I'm using this query to return attachments of a page. $args = array( 'post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment' ); Is there a way to ...
0
votes
2answers
451 views

Depth problem using wp_list_pages for subnavigation

I've been looking for a solution to my problem for some time now, and I can't seem to find one. I have created a submenu using the following code from the Codex: <?php if($post->post_parent) ...
3
votes
1answer
403 views

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

I'm trying to create a menu and submenu with a child theme of twentyten, similar to this at the LA Times: http://www.latimes.com/ where when the site is first opened, it displays a set of childs, and ...
2
votes
1answer
594 views

Get threaded comments number

I'm using Greg's Threaded Comment Numbering plugin to number the comments. Actually I'm displaying a number beside of each parent comment (no threaded comments numbers). I have 2 problems that I have ...
0
votes
1answer
933 views

Displaying Custom Taxonomy Children in Dropdown

I have a question I hope you can help me with. I have a custom taxonomy called locations and on the first level I have the areas (Asia, Europe, etc) and under each area I have countries (England, ...
5
votes
3answers
717 views

Can I display submenus in groups, using wp_list_pages?

Say I have top-level(parentless) pages called Fruit, Animals, Cars. When, say, Fruit is selected I would like to show links to the individual fruit pages below. I would like to be able to dislpay ...