Guest User

Untitled

a guest
Jan 27th, 2016
121
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function wpb_list_child_pages() {
  2.  
  3. global $post;
  4.  
  5. if ( 'movie' == get_post_type() && $post->post_parent )
  6.  
  7. $childpages = wp_list_pages( 'post_type=movie&sort_column=menu_order&title_li=&child_of=' . $post->post_parent . '&echo=0' );
  8. else
  9. $childpages = wp_list_pages( 'post_type=movie&sort_column=menu_order&title_li=&child_of=' . $post->ID . '&echo=0' );
  10.  
  11. if ( $childpages ) {
  12.  
  13. $string = '' . $childpages . '';
  14. }
  15.  
  16. echo $string;
  17.  
  18. }
  19.  
  20. add_shortcode('wpb_childpages', 'wpb_list_child_pages');
RAW Paste Data