Advertisement
alchymyth

index

Jun 13th, 2015
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.42 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The main template file.
  4.  *
  5.  * This is the most generic template file in a WordPress theme
  6.  * and one of the two required files for a theme (the other being style.css).
  7.  * It is used to display a page when nothing more specific matches a query.
  8.  * For example, it puts together the home page when no home.php file exists.
  9.  *
  10.  * Learn more: http://codex.wordpress.org/Template_Hierarchy
  11.  *
  12.  * @since 1.0.0
  13.  */
  14. get_header(); ?>
  15.  
  16.     <div class="container">
  17.         <div class="row">
  18.             <div id="primary" <?php bavotasan_primary_attr(); ?>>
  19.  
  20.                 <?php //new section to show content of 'posts page'
  21.                 $posts_page_id = get_option( 'page_for_posts' );
  22.                 if ( $posts_page_id ) :
  23.                     $posts_page = new WP_Query( array( 'post_type' => 'page', 'post__in' => array( $posts_page_id ) ) );
  24.                     while ( $posts_page->have_posts() ) : $posts_page->the_post();
  25.                         the_content();
  26.                     endwhile;
  27.                     wp_reset_postdata();
  28.                 endif;
  29.                 //end of new section?>
  30.                
  31.                 <?php
  32.                 if ( have_posts() ) :
  33.                     while ( have_posts() ) : the_post();
  34.                         get_template_part( 'content', get_post_format() );
  35.                     endwhile;
  36.  
  37.                     bavotasan_pagination();
  38.                 else :
  39.                     get_template_part( 'content', 'none' );
  40.                 endif;
  41.                 ?>
  42.             </div>
  43.             <?php get_sidebar(); ?>
  44.         </div>
  45.     </div>
  46. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement