Advertisement
Guest User

Example of where I use wp pagination

a guest
Jan 11th, 2017
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.75 KB | None | 0 0
  1. <div class="col-md-9 col-md-pull-3 col-sm-8 col-sm-pull-4">
  2.  
  3. <?php
  4. if ( is_search()  ) {
  5.     echo "<h3>Search Results for: ", esc_html( get_search_query( false ) ), "</h3>";
  6. } elseif ( !is_home() ) {
  7.     the_archive_title( '<h3 class="page-title">', '</h3>' );
  8.     the_archive_description( '<div class="taxonomy-description">', '</div>' );
  9. }
  10. ?>
  11.  
  12. <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
  13.  
  14.     <div class="blog-post hr-bot">
  15.         <h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
  16.         <p><i class="fa fa-clock-o blue"></i> <?php echo get_the_date(); ?></p>
  17.        
  18.         <?php if ( has_post_thumbnail() ) { ?>     
  19.             <div class="row">
  20.                 <div class='col-md-3'>
  21.                     <?php the_post_thumbnail('featured-image-thumbnail'); ?>
  22.                 </div>
  23.                 <div class='col-md-9'>
  24.                     <?php the_excerpt() ?>
  25.                     <a href="<?php the_permalink(); ?>"><button type="button" class="btn btn-success"><i class="fa fa-file-text-o"></i>&nbsp;  Read Full Post</button></a>
  26.                 </div>
  27.             </div>
  28.         <?php } else {  ?>
  29.             <p><?php the_excerpt() ?></p>
  30.             <a href="<?php the_permalink(); ?>"><button type="button" class="btn btn-success"><i class="fa fa-file-text-o"></i>&nbsp;  Read Full Post</button></a>
  31.         <?php } ?>
  32.  
  33.     </div>
  34.  
  35. <?php endwhile; ?>
  36.  
  37.     <div style="margin-bottom:20px;">
  38.         <?php previous_posts_link(__( '<button class="btn btn-primary pull-left"><i class="fa fa-long-arrow-left"></i>&nbsp; Newer Posts</button>' )) ?>
  39.         <?php next_posts_link(__( '<button class="btn btn-primary pull-right">Older Posts &nbsp;<i class="fa fa-long-arrow-right"></i></button>' )) ?>
  40.         <div class="clearfix"></div>
  41.     </div>
  42.  
  43. <?php else : ?>
  44.  
  45.     <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
  46.         <h3>No Posts Found</h1>
  47.     </div>
  48.  
  49. <?php endif; ?>
  50.  
  51. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement