SHARE
TWEET

Untitled

a guest Oct 8th, 2012 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php $homepages = get_pages( array(
  2.     'post_type' => 'page',
  3.     'post_status' => 'publish',
  4.     'meta_key' => '_wp_page_template',
  5.     'meta_value' => 'homepage.php'
  6.   ));
  7.   shuffle($homepages);
  8.   foreach( $homepages as $page ) {    
  9.   $content = $page->post_content;
  10.   if ( ! $content ) // Check for empty page
  11.     continue;
  12.   $content = apply_filters( 'the_content', $content );
  13.   echo $content;
  14. }  
  15. ?>
RAW Paste Data
Top