Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.32 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The Template for displaying all single posts.
  4.  *
  5.  * @package WordPress
  6.  * @subpackage Twenty_Eleven
  7.  * @since Twenty Eleven 1.0
  8.  */
  9.  
  10. get_header(); ?>
  11.  
  12.         <div id="primary">
  13.             <div id="content" role="main">
  14.  
  15.                 <?php while ( have_posts() ) : the_post(); $theID = $post->ID; ?>
  16.  
  17.                     <nav id="nav-single">
  18.                         <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3>
  19.                         <span class="nav-previous"><?php previous_post_link( '%link', __( '<span class="meta-nav">&larr;</span> Previous', 'twentyeleven' ) ); ?></span>
  20.                         <span class="nav-next"><?php next_post_link( '%link', __( 'Next <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?></span>
  21.                     </nav><!-- #nav-single -->
  22.  
  23.                     <?php get_template_part( 'content', 'single' ); ?>
  24.  
  25.                     <?php comments_template( '', true ); ?>
  26.  
  27.                 <?php endwhile; // end of the loop. ?>
  28.                
  29.                 <ul>
  30.                 <?php
  31.                 $args = array( 'numberposts' => 5 );
  32.                 $myposts = get_posts( $args );
  33.                 foreach( $myposts as $post ) : 
  34.                     $parentID2 = get_post_meta ($post->ID, 'parentID', true);
  35.                     if ($theID == $parentID2) { ?>
  36.                     <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
  37.                     <?php }
  38.                 endforeach; ?>
  39.                 </ul>
  40.  
  41.             </div><!-- #content -->
  42.         </div><!-- #primary -->
  43.  
  44. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement