Advertisement
Guest User

Category Pagination

a guest
Oct 23rd, 2013
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <?php get_sidebar(); ?>
  4.  
  5. <div id="main" class="ninecol last clearfix" role="main"
  6.  
  7. <?php if (get_post_meta( 1123, 'header_image', true )) { ?>
  8.  
  9. style="background: url(<?php the_field('header_image', 1123); ?>) left 0 no-repeat;"
  10.  
  11. <?php } ?>
  12.  
  13. >
  14. <article id="post-<?php the_ID(); ?>" <?php post_class('clearfix'); ?> role="article" itemscope itemtype="http://schema.org/BlogPosting">
  15.  
  16. <header class="article-header">
  17.  
  18. <h1 class="page-title" itemprop="headline"><?php if (is_category('Newsflash')) { ?>Newsflash
  19.  
  20. <?php } else if (is_category('Significant Incidents')) {?>
  21.  
  22. Significant Incidents
  23.  
  24. <?php } else if (is_category('HVFD Headlines')) {?>
  25.  
  26. HVFD Headlines
  27.  
  28. <?php } else { ?>
  29.  
  30. <?php $category = get_the_category(); echo $category[0]->cat_name; ?>
  31.  
  32. <?php } ?>
  33.  
  34. </h1>
  35.  
  36. </header> <!-- end page header -->
  37.  
  38.  
  39. <?php
  40.  
  41. if (have_posts()): ?>
  42.  
  43. <?php
  44.  
  45. if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
  46.  
  47. elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }
  48.  
  49. else { $paged = 1; }
  50.  
  51. query_posts( $query_string . '&posts_per_page=10&paged=' . $paged );
  52.  
  53. while (have_posts()) : the_post(); ?>
  54.  
  55.  
  56.  
  57.  
  58.  
  59. <h2 class="article-title"><a href="<?php the_permalink (); ?>"><?php the_title(); ?></a></h2>
  60.  
  61.  
  62. <section class="entry-content clearfix" itemprop="articleBody">
  63.  
  64.  
  65.  
  66. <?php the_excerpt(); ?>
  67.  
  68.  
  69.  
  70. </section> <!-- end article section -->
  71.  
  72.  
  73. <?php comments_template(); ?>
  74.  
  75.  
  76. <?php endwhile; else : ?>
  77.  
  78.  
  79. <!-- Add the pagination functions here. -->
  80.  
  81.  
  82.  
  83. <?php if (function_exists('bones_page_navi')) { ?>
  84.  
  85.  
  86.  
  87. <?php bones_page_navi(); ?>
  88.  
  89.  
  90.  
  91. <?php } else { ?>
  92.  
  93.  
  94.  
  95. <nav class="wp-prev-next">
  96.  
  97.  
  98.  
  99. <ul class="clearfix">
  100.  
  101.  
  102.  
  103. <li class="prev-link"><?php next_posts_link(__('&laquo; Older Entries', "bonestheme")) ?></li>
  104.  
  105.  
  106.  
  107. <li class="next-link"><?php previous_posts_link(__('Newer Entries &raquo;', "bonestheme")) ?></li>
  108.  
  109.  
  110. </ul>
  111.  
  112. </nav>
  113.  
  114. <?php } ?>
  115.  
  116. <?php endif; ?>
  117.  
  118. </article> <!-- end article -->
  119.  
  120. </div> <!-- end #main -->
  121.  
  122. </div> <!-- end #inner-content -->
  123.  
  124. </div> <!-- end #content -->
  125.  
  126. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement