Advertisement
Guest User

Untitled

a guest
Jan 15th, 2013
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.92 KB | None | 0 0
  1.         <ul id="listlatestnews">
  2. <?php
  3.     //Fix homepage pagination
  4.     if ( get_query_var('paged') ) { $paged = get_query_var('paged'); } else if ( get_query_var('page') ) {$paged = get_query_var('page'); } else {$paged = 1; }
  5.  
  6.     $temp = $wp_query;  // re-sets query
  7.     $wp_query = null;   // re-sets query
  8.     $args = array( 'post_type' => array('post'), 'orderby'=>'date', 'order'=>'DESC', 'posts_per_page' => 10, 'paged' => $paged);
  9.     $wp_query = new WP_Query();
  10.     $wp_query->query( $args );
  11.     while ($wp_query->have_posts()) : $wp_query->the_post();
  12. ?>
  13.           <li>
  14.             <div class="boximg-blog">
  15.             <?php if (function_exists('has_post_thumbnail') && has_post_thumbnail()) {?>
  16.               <div class="blogimage">
  17.                 <img src="<?php echo get_template_directory_uri();?>/timthumb.php?src=<?php echo thumb_url();?>&amp;h=84&amp;w=84&amp;zc=1" alt="" class="boximg-pad" />
  18.               </div>
  19.             <?php } ?>
  20.             </div>
  21.             <div class="postbox <?php post_class(); ?>">
  22.             <h3><a href="<?php the_permalink();?>"><?php the_title();?></a></h3>
  23.             <p>
  24.            <?php the_excerpt(__('Continue reading »','example')); ?>
  25.             </p>
  26.            </div>
  27.            <div class="clear"></div>
  28.             <div class="metapost">
  29.               <span class="first"><?php echo __('Posted at ','ecobiz');?><?php the_time( get_option('date_format') ); ?></span> |
  30.               <span><?php echo __('By ','ecobiz');?>: <?php the_author_posts_link();?></span>  |                        
  31.               <span><?php echo __('Categories ','ecobiz');?>: <?php the_category(',');?></span>  |
  32.               <span><?php comments_popup_link(__('0 Comment','ecobiz'),__('1 Comment','ecobiz'),__('% Comments','ecobiz'));?></span>
  33.             </div>          
  34.             <div class="clear"></div>
  35.           </li>
  36.         <?php endwhile; ?>
  37.  
  38.           </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement