Advertisement
ktryber

Untitled

Apr 10th, 2013
546
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1.     <?php
  2.         $paged = get_query_var('paged') ? get_query_var('paged') : 1;
  3.         $args = array(
  4.         'post_type' => array( 'post', 'hotels', 'flights', 'touristdestinations' ),
  5.         'posts_per_page' => 5,
  6.         'orderby' => 'date',
  7.         'paged' => $paged,
  8.         'max_num_pages' => 10
  9.         );
  10.     ?> 
  11.  
  12.     <?php $wp_query = new WP_Query($args); ?>
  13.  
  14.     <?php if ( $wp_query->have_posts() ) : ?>
  15.  
  16.     <?php while( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
  17.    
  18.     <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
  19.         <?php the_post_thumbnail(); ?>
  20.  
  21.  
  22.  
  23.         <?php the_excerpt(); ?>
  24.  
  25.         <p>Posted: <?php the_time('F j, Y'); ?> at <?php the_time('g:i a'); ?></p>
  26.  
  27.     <?php endwhile; ?>
  28.        
  29.     <?php next_posts_link(); ?>
  30.     <?php previous_posts_link(); ?>
  31.  
  32.  
  33.     <?php else: ?>
  34.         <p><?php _e('Sorry, there are no posts.'); ?></p>
  35.     <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement