Articles of get children

How to display child term of current term's parent taxonomy?

I would like to display a list of child terms according to my current taxonomy. Taxonomy name =’course’ Photoshop(=child term) ps-thematic#1(= child child term) ps-thematic#2 … After Effects ae-thematic#1 ae-thematic#2 … Another course zz-thematic#1 So, in my taxonomy-course-photoshop.php, I’d like to display ps-thematic#1, ps-thematic#2, etc. I found plenty of questions and answers on this subject. […]

Drop-Down Menu of Current Child Pages

I would like to display the child pages of the current page in a select menu, I.E. => <select><option>This is a child page</option><option>This is another child page</option></select> Of course, the option markup would be the dynamic function; markup that says basically that we want to display the child pages of the current page wrapped in […]

Get gallery images from page ID

I have a page within WordPress called ‘Gallery’, the page ID is 128, and I need to display only the gallery images from that page on a different page with a different ID. The images were uploaded using the standard WordPress gallery functionality. I’ve been trying to use get_children and a foreach loop to achieve […]

List all posts with the parent or grandparent of a page with a specified ID

I am using the following code in a page template <?php $args=array( ‘post_parent’ => 27641, ‘post_type’ => ‘page’, ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { while ($my_query->have_posts()) : $my_query->the_post(); ?> to get a list of direct child pages for a product listing page. What do I do if I want […]

filter get_children to return all mime types EXCEPT 'x'

Like it says on the tin – Im trying to create a list of post attachments that includes everything except say audio, which I’ll feed into a player instead. The filter needs to be generic: ‘audio’ not ‘audio/mpeg’. (For some reason if ( $mime !== ‘audio/mpeg’ ) will filter out valid mp3 files –– weird.) So […]

get_page_children() return only titles

I’m using the following code to get a list of all the pages that are children of my project page and display them in a Recent Projects section of my template’s footer element. I’ve noticed that the get_page_children() method returns everything about that page – post_author, post_date, post_content, post_title, etc. Is there a way to […]

Need help with category listing!

I’m trying to solve this for a while, but I couldn’t get a satisfactory way to get what I want. Maybe it’s very simple and I’m just too inexperienced. I need a way to display all the article titles of the child categories of a given category, like this: Category “x” Subcategory 1xa Post 1xa […]

Make Images appear in the same order as in media browser using get children?

I would really like my images to display in the same way I’ve ordered them in the media browser. What am I doing wrong? $images =& get_children( array(‘post_parent’ => $post->ID, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘orderby’ => ‘menu_order’, ‘order’ => ‘asc’ ));

WordPress count child posts of each parent custom post type and use in json array for google maps jquery plugin

So i have been looking for a couple of days now and cant find a solution to this anywhere. It is a fairly bespoke request from a client… I am using a jQuery google maps plugin to add markers for each post (area) that the admin creates using a custom meta box with lat and […]

Display post taxonomies tree

I was able to get all the items of a custom taxonomy for a post, like this: $args=array(‘orderby’=>’parent’,”fields” => “all”); $term_list = wp_get_post_terms($post->ID, ‘tvr_amenity’, $args); My problem is that i would like to show the tree (respecting the parents) So i would like to get them ordered by name and parent but i cant find […]