Advertisement
martawijaya

archive

Jul 22nd, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.01 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The template for displaying archive pages
  4.  *
  5.  * @link https://codex.wordpress.org/Template_Hierarchy
  6.  *
  7.  * @package balinews_Default_Theme
  8.  */
  9.  
  10. get_header(); ?>
  11.  
  12. <div class="left-column">
  13.    
  14. </div>
  15.  
  16.     <div id="primary" class="content-area">
  17.         <main id="main" class="site-main" role="main">
  18.             <div class="archive-page">
  19.                 <div class="container">
  20.                     <div class="row">
  21.  
  22.                             <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-xs-12">
  23.                                
  24.                             <?php the_archive_title( '<h1 class="page-title">', '</h1>' ); ?>
  25.  
  26.                                 <!-- Show posts -->
  27.                                 <?php
  28.  
  29.                                     $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  30.                                     $args = array(
  31.                                             'paged'=> $paged,
  32.                                             'posts_per_page'=> 10,
  33.                                             'post_status' => 'publish'
  34.                                         );
  35.  
  36.                                         query_posts($args); ?>
  37.  
  38.                                     <?php if ( have_posts() ) : while (have_posts()) : the_post();
  39.  
  40.                                     get_template_part( 'template-parts/content', get_post_format() );
  41.  
  42.                                     endwhile; ?>
  43.  
  44.  
  45.                                    
  46.                                     <!-- pagination -->
  47.                                     <div class="navigation-page">
  48.                                          <div class="prev-page">
  49.                                             <?php previous_posts_link(); ?>
  50.                                          </div>
  51.                                         <div class="next-page">
  52.                                             <?php next_posts_link(); ?>
  53.                                          </div>
  54.                                     </div>
  55.                                    
  56.                                     <?php else : ?>
  57.                                        <p><?php _e('tidak ada berita tersedia'); ?></p>
  58.                                     <?php endif; ?>
  59.  
  60.                                   <!-- Show posts -->
  61.  
  62.                             </div>
  63.  
  64.                     </div>
  65.  
  66.                 </div>
  67.             </div>
  68.         </main><!-- #main -->
  69.     </div><!-- #primary -->
  70.  
  71. <?php
  72.  
  73. get_footer();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement