index.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * The main template file
  4. *
  5. * This is the most generic template file in a WordPress theme and one
  6. * 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. * e.g., it puts together the home page when no home.php file exists.
  9. *
  10. * @link https://codex.wordpress.org/Template_Hierarchy
  11. *
  12. * @package WordPress
  13. * @subpackage Twenty_Fourteen
  14. * @since Twenty Fourteen 1.0
  15. */
  16. get_header(); ?>
  17. <div id="main-content" class="main-content">
  18. <?php
  19. if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
  20. // Include the featured content template.
  21. get_template_part( 'featured-content' );
  22. }
  23. ?>
  24. <div id="primary" class="content-area">
  25. <div id="content" class="site-content" role="main">
  26. <?php
  27. if ( have_posts() ) :
  28. // Start the Loop.
  29. while ( have_posts() ) : the_post();
  30. /*
  31. * Include the post format-specific template for the content. If you want to
  32. * use this in a child theme, then include a file called called content-___.php
  33. * (where ___ is the post format) and that will be used instead.
  34. */
  35. get_template_part( 'content', get_post_format() );
  36. endwhile;
  37. // Previous/next post navigation.
  38. twentyfourteen_paging_nav();
  39. else :
  40. // If no content, include the "No posts found" template.
  41. get_template_part( 'content', 'none' );
  42. endif;
  43. ?>
  44. </div><!-- #content -->
  45. </div><!-- #primary -->
  46. <?php get_sidebar( 'content' ); ?>
  47. </div><!-- #main-content -->
  48. <?php
  49. get_sidebar();
  50. get_footer();