SHARE
TWEET

Untitled

keriat Apr 29th, 2012 123 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* шапка шаблона с выводом каталога  (см. header.php)*/
  2. get_header();
  3. global $query_string;
  4. global $wp_query;
  5. parse_str($query_string, $queryParams);
  6. $queryParams['paged'] = max(1, get_query_var('page'));
  7. query_posts($queryParams);
  8. /*
  9. -----
  10. Это вставляем в index.php:
  11. */
  12. <?php
  13. wp_reset_postdata();
  14. $params = array(
  15.         'base'          => site_url().'?page=%#%',
  16.         'current'       => max(1, get_query_var('page')),
  17.         'total'         => $wp_query->max_num_pages,
  18.         'prev_text'     => 'Прыдущая страница',
  19.         'next_text'     => 'Следующая страница',
  20. );
  21. if ($wp_query->max_num_pages):?>
  22. <div class="pagination">
  23.         <?php
  24.         echo paginate_links($params);
  25.         ?>
  26. </div>
  27. <?php endif?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top