Advertisement
iselaespana

Untitled

Feb 2nd, 2012
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.79 KB | None | 0 0
  1.  
  2. <?php
  3. /**
  4. * The loop to show posts in columns
  5. *
  6. * loop-grid.php
  7.  
  8. * @package WordPress
  9. * @subpackage Twenty Ten
  10. * @since 3.0.0
  11. */
  12. ?>
  13.  
  14. <?php /* Display navigation to next/previous pages when applicable */ ?>
  15. <?php if ( $wp_query->max_num_pages > 1 ) : ?>
  16. <div id="nav-below" class="navigation">
  17. <?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?>
  18. <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div>
  19. <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div>
  20. <?php } ?>
  21. </div><!-- #nav-below -->
  22. <?php endif; ?>
  23. <?php /* If there are no posts to display, such as an empty archive page */ ?>
  24. <?php if ( ! have_posts() ) : ?>
  25. <div id="post-0" class="post error404 not-found">
  26. <h1 class="entry-title"><?php _e( 'Not Found', 'twentyten' ); ?></h1>
  27. <div class="entry-content">
  28. <p><?php _e( 'Apologies, but no results were found for the requested Archive. Perhaps searching will help find a related post.', 'twentyten' ); ?></p>
  29. <?php get_search_form(); ?>
  30. </div><!-- .entry-content -->
  31. </div><!-- #post-0 -->
  32. <?php endif; ?>
  33. <?php if ( function_exists( 'meteor_slideshow' ) ) { meteor_slideshow(); } ?>
  34.  
  35. <?php /* Start the Loop */ ?>
  36.  
  37.  
  38. <?php
  39. $num_cols = 3; // set the number of columns here
  40. $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; // for pagination
  41. $args = array(
  42. 'posts_per_page' => 6, // optional to overwrite the dashboard setting
  43. 'cat' => 0, // add any other query parameter to this array
  44. 'paged' => $paged,
  45. );
  46.  
  47. for ( $i=1 ; $i <= $num_cols; $i++ ) :
  48. echo '<div id="col-' . $i . '" class="col" >';
  49. $counter = $num_cols + 1 - $i; ?>
  50.  
  51. <?php while (have_posts()) : the_post();
  52. if( $counter%$num_cols == 0 ) :
  53. // begin of core posts output ?>
  54.  
  55.  
  56. <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  57. <div class="post-thumb">
  58.  
  59. <?php echo get_the_post_thumbnail( $post_id, $size, $attr ); ?> <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>
  60. </div>
  61.  
  62. <div class="entry-meta">
  63. <?php
  64. printf( __( '<span class="meta-prep meta-prep-author">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a> <span class="meta-sep"> by </span> <span class="author vcard"><a class="url fn n" href="%4$s" title="%5$s">%6$s</a></span>', 'twentyten' ),
  65. get_permalink(),
  66. esc_attr( get_the_time() ),
  67. get_the_date(),
  68. get_author_posts_url( get_the_author_meta( 'ID' ) ),
  69. sprintf( esc_attr__( 'View all posts by %s', 'twentyten' ), get_the_author() ),
  70. get_the_author()
  71. );
  72. ?><span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
  73. </div><!-- .entry-meta -->
  74.  
  75. <div class="entry-summary">
  76. <?php the_excerpt(); ?>
  77. </div><!-- .entry-summary -->
  78.  
  79. <div class="entry-utility">
  80. <span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e( 'Posted in ', 'twentyten' ); ?></span><?php the_category( ', ' ); ?></span>
  81. <span class="meta-sep"> | </span>
  82. <?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>' ); ?>
  83. <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></span>
  84. <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
  85. </div><!-- #entry-utility -->
  86. </div><!-- #post-<?php the_ID(); ?> -->
  87. <?php // global $withcomments; $withcomments = 1;
  88. //comments_template( '', true ); ?>
  89.  
  90. <?php //end of posts output
  91.  
  92. endif; $counter++;
  93. endwhile;
  94. rewind_posts();
  95. echo '</div>'; //closes the column div
  96. endfor; ?>
  97.  
  98. <?php /* Display navigation to next/previous pages when applicable */ ?>
  99. <?php if ( $wp_query->max_num_pages > 1 ) : ?>
  100. <div id="nav-below" class="navigation">
  101. <?php if(function_exists('page_navi')) { page_navi(); } else { ?>
  102. <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
  103. <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>
  104. <?php } ?>
  105. </div><!-- #nav-below -->
  106. <?php endif;
  107. wp_reset_query(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement