gulliver on "Show childfren of custom post."

ساخت وبلاگ

I have a hierarchical custom post type, and on each single view of a post of this type I want to display the title of the children of this post, outside of the loop.

The code I'm currently using is below, and it works - but I've no idea whether it's a sensible way to do it or if there's other options.

<?php
$pageChildren = get_pages('child_of='.$post->ID."&echo=0&post_type=show");
if ( $pageChildren ) {
foreach ( $pageChildren as $pageChild ) {
echo '<p><a href="' . get_permalink($pageChild->ID) . '">'. $pageChild->post_title.'</a></p>';
}
} ?>

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 201 تاريخ : چهارشنبه 19 خرداد 1395 ساعت: 22:42