有人可以给我一个循环,它会在父帖子的word.php
上输出Wordpress中子帖子的图片附件我的孩子发布了slug:投资更新
我现在拥有的标题是:
<?php
//children
$child_posts = get_posts(array(
'numberposts' => -1,
'orderby' => 'name',
'post_type' => 'investment-updates',
'meta_query' => array(
array(
'key' => '_wpcf_belongs_investment_id',
'value' => $post->ID,
'compare' => '=',
),
),
));
?>
<?php foreach ($child_posts as $child_post){
echo '<li>' . get_the_title($child_post->ID) . '</li>';
} ?>