Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php global $post; //not neccessary if used in the loop
- $parent = $post->post_parent;
- if( $parent ) :
- $siblings = get_pages( 'child_of=' . $parent . '&parent=' . $parent . '&exclude=' . $post->ID);
- if( $siblings ) foreach( $siblings as $sibling ) :
- //start of whatever you need to output//
- echo $sibling->post_title;
- echo get_the_post_thumbnail($sibling->ID,'medium');
- //end of whatever you need to output//
- endforeach;
- endif; //ends if( $parent ) //
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement