Advertisement
deliciousthemes

Blog Template page

May 30th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  1. <?php
  2. /*
  3.  
  4. Template Name: Blog Template
  5.  
  6.  */
  7.  
  8. ?>
  9.  
  10. <?php
  11.     get_header();
  12.  
  13.     if (have_posts()) :
  14.         while (have_posts()) :
  15.             the_post();  
  16.            
  17.             the_content();
  18.         endwhile;  
  19.     endif;
  20.     ?>     
  21.    
  22.     <div class="container">
  23.  
  24.     <?php
  25.         $custom_args = array(
  26.             'post_type'=> 'post',
  27.             'paged'=>$paged
  28.         ); 
  29.         $custom_blog_query = new WP_Query($custom_args);
  30.     ?>
  31.  
  32.         <div id="primary" class="content-area">
  33.             <main id="main" class="site-main" role="main">
  34.                
  35.             <?php
  36.                 if ($custom_blog_query->have_posts()) :  
  37.                     while ($custom_blog_query->have_posts()) :
  38.                         $custom_blog_query->the_post();
  39.  
  40.                         get_template_part( 'template-parts/content', get_post_format() );
  41.  
  42.                     endwhile;
  43.                 endif;  
  44.                
  45.                 wp_reset_postdata();
  46.             ?>
  47.  
  48.             <?php the_posts_navigation(); ?>
  49.  
  50.             </main>
  51.        
  52.         </div>
  53.  
  54.     <?php get_sidebar(); ?>
  55.  
  56.     </div>
  57.  
  58.     <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement