صفحه بندی سفارشی انواع پست

صفحه بندی سفارشی انواع پست – Paginate Custom Post Types <?php $temp = $wp_query; $wp_query = null; $wp_query = new WP_Query(); $wp_query->query(‘showposts=6&post_type=news’.’&paged=’.$paged); while ($wp_query->have_posts()) : $wp_query->the_post(); ?> <!– LOOP: Usual Post Template Stuff Here–> <?php endwhile; ?> <nav> <?php previous_posts_link(‘&laquo; Newer’) ?> <?php next_posts_link(‘Older &raquo;’) ?> </nav> <?php $wp_query = null; $wp_query = $temp; // […]

صفحه بندی سفارشی انواع پست – Paginate Custom Post Types

<?php 
  $temp = $wp_query; 
  $wp_query = null; 
  $wp_query = new WP_Query(); 
  $wp_query->query('showposts=6&post_type=news'.'&paged='.$paged); 

  while ($wp_query->have_posts()) : $wp_query->the_post(); 
?>

  <!-- LOOP: Usual Post Template Stuff Here-->

<?php endwhile; ?>

<nav>
    <?php previous_posts_link('&laquo; Newer') ?>
    <?php next_posts_link('Older &raquo;') ?>
</nav>

<?php 
  $wp_query = null; 
  $wp_query = $temp;  // Reset
?>