Digitalraindrops

Custom Loop WordPress Forum

Sep 20th, 2010
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.61 KB | None | 0 0
  1. <?php while ( have_posts() ) : the_post(); ?>
  2.  
  3.     <?php $counter+=1 ; // Start the Counter ?>
  4.    
  5.     <?php if($counter > 1): // Not the first post so title nad meta ?>
  6.         <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  7.             <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  8.  
  9.             <div class="entry-meta">
  10.                 <?php twentyten_posted_on(); ?>
  11.             </div><!-- .entry-meta -->
  12.  
  13.             <?php // Content went here before ?>
  14.            
  15.             <div class="entry-utility">
  16.                 <?php if ( count( get_the_category() ) ) : ?>
  17.                     <span class="cat-links">
  18.                         <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?>
  19.                     </span>
  20.                     <span class="meta-sep">|</span>
  21.                 <?php endif; ?>
  22.                 <?php
  23.                     $tags_list = get_the_tag_list( '', ', ' );
  24.                     if ( $tags_list ):
  25.                 ?>
  26.                     <span class="tag-links">
  27.                         <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
  28.                     </span>
  29.                     <span class="meta-sep">|</span>
  30.                 <?php endif; ?>
  31.                 <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
  32.                 <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
  33.             </div><!-- .entry-utility -->
  34.         </div><!-- #post-## -->
  35.         <?php /* End the summary posts */ ?>
  36.  
  37.     <?php else : // This is our first post ?>
  38.         <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  39.             <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
  40.  
  41.             <div class="entry-meta">
  42.                 <?php twentyten_posted_on(); ?>
  43.             </div><!-- .entry-meta -->
  44.  
  45.             <?php /* This is our content change to Excerpt if you want */?>
  46.             <div class="entry-content">
  47.                    
  48.                             <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
  49.                
  50.                 <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
  51.             </div><!-- .entry-content -->
  52.    
  53.             <div class="entry-utility">
  54.                 <?php if ( count( get_the_category() ) ) : ?>
  55.                     <span class="cat-links">
  56.                         <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?>
  57.                     </span>
  58.                     <span class="meta-sep">|</span>
  59.                 <?php endif; ?>
  60.                 <?php
  61.                     $tags_list = get_the_tag_list( '', ', ' );
  62.                     if ( $tags_list ):
  63.                 ?>
  64.                     <span class="tag-links">
  65.                         <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
  66.                     </span>
  67.                     <span class="meta-sep">|</span>
  68.                 <?php endif; ?>
  69.                 <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
  70.                 <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
  71.             </div><!-- .entry-utility -->
  72.         </div><!-- #post-## -->
  73.  
  74.         <?php // No Comments in this loop comments_template( '', true ); ?>
  75.  
  76.     <?php endif; // This was the if statement that broke the loop into two parts. ?>
  77. <?php endwhile; // End the loop ?>
Add Comment
Please, Sign In to add comment