keyaspects

stories

Mar 15th, 2012
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.99 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Story Books
  4. */
  5. ?>
  6.  
  7.  
  8. <?php get_header(); ?>
  9.  
  10.  
  11. <section id="stories">
  12.     <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  13.        
  14.         <header>
  15.             <h1><?php the_title(); ?></h1>
  16.         </header>
  17.            
  18.         <article id="content_left">
  19.                
  20.                 <?php the_content(); ?>
  21.  
  22.         </article>
  23.        
  24.     <?php endwhile; endif; ?>
  25.        
  26.     <div id="content_right">
  27.         <?php
  28.         $mypages = get_pages( array( 'child_of' => $post->ID, 'sort_column' => 'post_date', 'sort_order' => 'desc' ) );
  29.            
  30.         foreach( $mypages as $page ) {     
  31.             $content = $page->post_content;
  32.             if ( ! $content ) // Check for empty page
  33.                 continue;
  34.                
  35.             $content = apply_filters( 'the_content', $content );
  36.             ?>
  37.             <h2><a href="<?php echo get_page_link( $page->ID ); ?>"><?php echo $page->post_title; ?></a></h2>
  38.             <article class="story">
  39.                 <?php echo $content; ?>
  40.                 <?php echo get_post_meta($post->ID, 'price', true); ?>     
  41.             </article>
  42.         <?php } ?>
  43.     </div>
  44.    
  45. </section>
  46. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment