0
votes
1answer
34 views

How do I sort post listing by child post count?

I have two custom post types called questions and answers. The questions list includes a custom column which displays a count of the answers for each question. I need to be able to sort the listing ...
0
votes
1answer
48 views

Don't repeat posts from children in parent taxonomy query

I have a query on a page and I want to prevent it from returning posts in the parent term that have one of the child terms of the parent. For example: Parent 1 Child 1 Post 1 Post 2 NOT Parent ...
-1
votes
2answers
103 views

query only direct child and sub-terms of a current term archive

i'm using woocommerce on my theme, and it comes with a proudct_cat term as a defualt catagory on the shop proudct. I need to show on every proudct_cat archive its direct child and the sub-tems, but ...
0
votes
0answers
48 views

differentiate result in parent and child custom taxonomy in wp-query

I am using wp-query for filtering results on the basis of tax_query. e.g. $args = array( 'post_type' => 'product', 'relation' => 'AND', ...
0
votes
1answer
134 views

Better wordpress attachment query then this

I have a site with more then 10.000 posts and images, its classipress site. I need somehow to show all images from posts that are on pending status, and who havent expired(post meta). This is the code ...
0
votes
1answer
104 views

Set order of returned items in the WP_Query() class/function

I have this function which gives me IDs and titles of all child pages of a given parent ID. function getPageChildren($page_id) { $my_wp_query = new WP_Query(); $all_wp_pages = ...
2
votes
1answer
197 views

List the 5 most recent child pages

I created a hierarchical custom post type for a gallery. The parent pages are the galleries and the child pages are the albums. I want to display the most recent albums on my sidebar (so basically the ...
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
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
592 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
227 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 ...