Advertisement
aliceralph

2columns

Mar 21st, 2011
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.68 KB | None | 0 0
  1. <?php /* Start the Loop.*/ ?>
  2.  
  3.  
  4.  
  5. <?php
  6. $recentposts=get_posts('showposts=1');
  7. if ($recentposts) {
  8. foreach($recentposts as $post) {
  9. setup_postdata($post);
  10. ?>
  11. <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  12. <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>
  13. <div class="entry-meta">
  14. <?php twentyten_posted_on(); ?>
  15. <?php the_post_thumbnail();?>
  16.  
  17.  
  18.  
  19. </div><!-- .entry-meta -->
  20.  
  21. <?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
  22. <div class="entry-summary">
  23. <?php the_excerpt(); ?>
  24. </div><!-- .entry-summary -->
  25. <?php else : ?>
  26.  
  27.  
  28.  
  29. <div class="entry-content">
  30.  
  31. <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
  32. <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
  33. </div><!-- .entry-content -->
  34. <?php endif; ?>
  35.  
  36. <div class="entry-utility">
  37. <?php if ( count( get_the_category() ) ) : ?>
  38. <span class="cat-links">
  39. <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?>
  40. </span>
  41. <span class="meta-sep">|</span>
  42. <?php endif; ?>
  43. <?php
  44. $tags_list = get_the_tag_list( '', ', ' );
  45. if ( $tags_list ):
  46. ?>
  47. <span class="tag-links">
  48. <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
  49. </span>
  50. <span class="meta-sep">|</span>
  51. <?php endif; ?>
  52. <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
  53. <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
  54. </div><!-- .entry-utility -->
  55. </div><!-- #post-## -->
  56.  
  57. <?php comments_template( '', true ); ?>
  58. <?php
  59. }
  60. }
  61. ?>
  62.  
  63.  
  64.  
  65. <?php while ( have_posts() ) : the_post();?>
  66.  
  67.  
  68.  
  69.  
  70.  
  71. <?php /* start our two column support */ ?>
  72. <?php $counter+=1; ?>
  73. <?php if($counter % 2) : ?>
  74. <div class="column-left">
  75. <?php else: ?>
  76. <div class="column-right">
  77. <?php endif; ?>
  78.  
  79. <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  80. <div class="alignleft" style="margin: 0 0 10px 0">
  81.  
  82. <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php if (class_exists('MultiPostThumbnails')
  83. && MultiPostThumbnails::has_post_thumbnail('post', 'secondary-image')) :
  84. MultiPostThumbnails::the_post_thumbnail('post', 'secondary-image'); endif; ?></a>
  85.  
  86. </div>
  87. <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>
  88.  
  89. <div class="entry-meta">
  90. <?php twentyten_posted_on(); ?>
  91. </div><!-- .entry-meta -->
  92.  
  93. <?php if ( is_archive() || is_search() ) : // Only display excerpts for archives and search. ?>
  94. <div class="entry-summary">
  95.  
  96. <?php /* Add a conditional image and excertp output */ ?>
  97. <?php if(has_post_thumbnail()): // Start the condition ?>
  98.  
  99. <?php the_excerpt(); ?>
  100. <?php else : // Offer an alternative ?>
  101. <?php the_excerpt(); ?>
  102. <?php endif; // end the condition ?>
  103.  
  104. </div><!-- .entry-summary -->
  105. <?php else : ?>
  106. <div class="entry-content">
  107. <?php /* Add a conditional image and excerpt output */ ?>
  108. <?php if(has_post_thumbnail()): // Start the condition ?>
  109. <div class="alignleft" style="margin: 0 0 10px 0">
  110. <?php the_post_thumbnail('small-thumbnail'); ?>
  111. </div>
  112. <?php the_excerpt(); ?>
  113.  
  114. <?php else : // Offer an alternative ?>
  115.  
  116. <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?>
  117. <?php endif; // end the condition ?>
  118.  
  119. <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
  120. </div><!-- .entry-content -->
  121. <?php endif; ?>
  122.  
  123. <div class="entry-utility">
  124.  
  125. <?php if ( count( get_the_category() ) ) : ?>
  126. <span class="cat-links">
  127. <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?>
  128. </span>
  129. <span class="meta-sep">|</span>
  130. <?php endif; ?>
  131. <?php
  132. $tags_list = get_the_tag_list( '', ', ' );
  133. if ( $tags_list ):
  134. ?>
  135. <span class="tag-links">
  136. <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
  137. </span>
  138. <span class="meta-sep">|</span>
  139. <?php endif; ?>
  140. <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
  141. <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
  142. </div><!-- .entry-utility -->
  143. </div><!-- #post-## -->
  144.  
  145. <?php comments_template( '', true ); ?>
  146.  
  147. <?php /* end our two column support */ ?>
  148. </div>
  149.  
  150. <?php endwhile; // End the loop. Whew. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement