Advertisement
hmbashar

Custom Post query with Page navi

Mar 7th, 2015
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.98 KB | None | 0 0
  1. <?php
  2.   $temp = $wp_query;
  3.   $wp_query = null;
  4.   $wp_query = new WP_Query();
  5.   $wp_query->query('showposts=-1&post_type=doctor-items'.'&paged='.$paged);
  6.  
  7.   while ($wp_query->have_posts()) : $wp_query->the_post();
  8. ?>
  9.  
  10. <?php
  11.     $specilist= get_post_meta($post->ID, 'specilist', true);
  12.     $facebook= get_post_meta($post->ID, 'facebook', true);
  13.     $vimeo= get_post_meta($post->ID, 'vimeo', true);
  14.     $twitter= get_post_meta($post->ID, 'twitter', true);
  15.     $pinterest= get_post_meta($post->ID, 'pinterest', true);
  16.     $google= get_post_meta($post->ID, 'google', true);
  17.     $doctor_photo = wp_get_attachment_image_src('doctor-small' );
  18. ?>                             
  19.     <!-- content -->
  20. <div class="single_doctor">
  21.     <div class="doctor_photo">
  22.         <a href="<?php the_permalink(); ?>"><img src="<?php echo $doctor_photo[0]; ?>" alt="" /></a>
  23.     </div>
  24.    
  25.     <div class="doctor_right_info">
  26.         <a href="<?php the_permalink(); ?>">
  27.         <h2><?php echo $specilist; ?></h2>
  28.         <h2><?php the_title(); ?></h2>
  29.         </a>
  30.         <p><?php the_excerpt(); ?></p>
  31.     </div>
  32.    
  33.     <div class="doctor_social_profiles">
  34.         <p>social profiles</p>
  35.         <ul>
  36.             <?php if($vimeo) : ?>
  37.             <li><a href="<?php echo $vimeo; ?>"><i class="fa fa-vimeo-square"></i></a></li>
  38.             <?php endif; ?>
  39.            
  40.             <?php if($twitter) : ?>
  41.             <li><a href="<?php echo $twitter; ?>"><i class="fa fa-twitter"></i></a></li>
  42.             <?php endif; ?>
  43.            
  44.             <?php if($facebook) : ?>                               
  45.             <li><a href="<?php echo $facebook; ?>"><i class="fa fa-facebook"></i></a></li>
  46.             <?php endif; ?>
  47.            
  48.             <?php if($google) : ?>
  49.             <li><a href="<?php echo $google; ?>"><i class="fa fa-google-plus"></i></a></li>
  50.             <?php endif; ?>
  51.            
  52.             <?php if($pinterest) : ?>
  53.             <li><a href="<?php echo $pinterest; ?>"><i class="fa fa-pinterest"></i></a></li>
  54.             <?php endif; ?>
  55.         </ul>
  56.     </div>
  57. </div>
  58. <!-- Content -->
  59. <?php endwhile; ?>
  60.  
  61. <?php if (function_exists('wp_pagenavi')) { wp_pagenavi(); } else { include('navigation.php'); } ?>
  62.  
  63. <?php
  64.   $wp_query = null;
  65.   $wp_query = $temp;  // Reset
  66. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement