Advertisement
FlyFX

Untitled

Jun 13th, 2012
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.68 KB | None | 0 0
  1. <?php
  2. /**
  3. * The loop to show posts in columns/grids
  4. *
  5. * loop-grid.php
  6.  
  7. * @package WordPress
  8. * @subpackage Twenty Ten
  9. * @since 3.0.0
  10. */
  11. ?>
  12.  
  13. <?php /* Display navigation to next/previous pages when applicable */ ?>
  14. <?php if ( $wp_query->max_num_pages > 1 ) : ?>
  15. <div id="nav-above" class="navigation">
  16. <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
  17. <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>
  18. </div><!-- #nav-above -->
  19. <?php endif; ?>
  20.  
  21. <?php /* If there are no posts to display, such as an empty archive page */ ?>
  22. <?php if ( ! have_posts() ) : ?>
  23. <div id="post-0" class="post error404 not-found">
  24. <h1 class="entry-title"><?php _e( 'Not Found', 'twentyten' ); ?></h1>
  25. <div class="entry-content">
  26. <p><?php _e( 'Apologies, but no results were found for the requested Archive. Perhaps searching will help find a related post.', 'twentyten' ); ?></p>
  27. <?php get_search_form(); ?>
  28. </div><!-- .entry-content -->
  29. </div><!-- #post-0 -->
  30. <?php endif; ?>
  31.  
  32. <?php /* Start the Loop */ ?>
  33.  
  34.  
  35. <?php $num_cols = 3; // set the number of columns here
  36.  
  37. for ( $i=1 ; $i <= $num_cols; $i++ ) :
  38. echo '<div id="col-' . $i . '" class="col" >';
  39. $counter = $num_cols + 1 - $i; ?>
  40.  
  41. <?php while (have_posts()) : the_post();
  42. if( $counter%$num_cols == 0 ) :
  43. //
  44. // begin of posts output
  45. // ?>
  46.  
  47. <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  48.  
  49. <div class="entry-thumb">
  50. <?php the_post_thumbnail('thumbnail'); ?><br /><br />
  51. </div>
  52.  
  53. <div class="entry-meta">
  54. <?php twentyten_posted_on(); ?>
  55. </div>
  56. <div id="entry-title-cat" class="title_black"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
  57. <?php the_title(); ?></a></div>
  58.  
  59.  
  60.  
  61. <div class="entry-summary">
  62. <div class="entry-meta"></div><!-- .entry-meta --> <?php the_excerpt(); ?>
  63. </div><!-- .entry-summary -->
  64.  
  65. <div class="entry-utility">
  66. <span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e( 'Posted in ', 'twentyten' ); ?></span><?php the_category( ', ' ); ?></span>
  67. <span class="meta-sep"> | </span>
  68. <?php the_tags( '<span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links">' . __( 'Tagged ', 'twentyten' ) . '</span>', ', ', '<span class="meta-sep"> | </span>' ); ?>
  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-<?php the_ID(); ?> -->
  73.  
  74.  
  75. <?php //
  76. // end of posts output
  77. //
  78.  
  79. endif; $counter++;
  80. endwhile;
  81. rewind_posts();
  82. echo '</div>'; //closes the column div
  83. endfor; ?>
  84.  
  85. <?php /* Display navigation to next/previous pages when applicable */ ?>
  86. <?php if ( $wp_query->max_num_pages > 1 ) : ?>
  87. <div id="nav-below" class="navigation">
  88. <?php if(function_exists('page_navi')) { page_navi(); } else { ?>
  89. <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
  90. <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>
  91. <?php } ?>
  92. </div><!-- #nav-below -->
  93. <?php endif;
  94. wp_reset_query(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement