Hi,
I have 2 levels childs. First i have different custom post types (like Years of awards), and after that I have another custom post type witch are for every single Award.
I want to print first the Year, and after that all the child of this Year.
I try simething like the code below, but it's not working. Also I try to take all the info for the child post child posts but again nothing.
<?php
$arg_solo = array(
'orderby' => 'post_title',
'order' => 'ASC');
$child_posts = types_child_posts('solo_exhibitions', $arg_solo);
foreach ($child_posts as $child_post) {
$solo_parent = $child_post->ID;
?>
<h6><?php echo $child_post->post_title; ?></h6>
<!---------------------------------------'Till here all is working fine, and Here I want to take all the child of this solo_exhibitions------------------------------------->
<?php
$arg_solo_by_year = array(
'child_of' => $solo_parent,
'orderby' => 'post_title',
'order' => 'ASC');
$child_posts_solo = types_child_posts('solo_by_years', $arg_solo_by_year);
foreach ($child_posts_solo as $child_post) {
?>
<p><?php echo $child_post->fields[solo_exhibition_by_year]; ?></p>
<?php
}
}?>
Can you help me ?