Advertisement
Digitalraindrops

loop-images WordPress 2010

Mar 26th, 2012
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.77 KB | None | 0 0
  1. <?php if(is_page('featured-images')){?>
  2.  
  3.     <?php
  4.     $args=array(
  5.       'category__in' => 3,
  6.       'post_status' => 'publish',
  7.       'paged' => $paged,
  8.       'posts_per_page' => -1,
  9.       'caller_get_posts'=> 1,
  10.     );
  11.  
  12.     $my_query = null;
  13.     $my_query = new WP_Query($args);
  14.  
  15.     <?php /* Display navigation to next/previous pages when applicable */ ?>
  16.     <?php if ( $my_query->max_num_pages > 1 ) : ?>
  17.         <div id="nav-above" class="navigation">
  18.             <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
  19.             <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>
  20.         </div><!-- #nav-above -->
  21.     <?php endif; ?>
  22.  
  23.     if( $my_query->have_posts() ) {
  24.  
  25.         while ($my_query->have_posts()) : $my_query->the_post(); ?>
  26.  
  27.         <div style="width:260px; float:left;">
  28.         <a style="color:#fff; text-decoration:none;" href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
  29.         <div style="margin-left:40px;"><?php the_post_thumbnail( $size, $attr ); ?></div>
  30.         <p style="text-align:center; font-size:18px;"><?php the_title(); ?></p></a>
  31.         </div>
  32.  
  33.         <?php endwhile; } ?>
  34.  
  35.     <?php /* Display navigation to next/previous pages when applicable */ ?>
  36.     <?php if (  $my_query->max_num_pages > 1 ) : ?>
  37.                     <div id="nav-below" class="navigation">
  38.                         <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyten' ) ); ?></div>
  39.                         <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>
  40.                     </div><!-- #nav-below -->
  41.     <?php endif; ?>
  42.  
  43.     <?php wp_reset_query();  // Restore global post data stomped by the_post(). ?>
  44.  
  45. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement