index.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. * 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 AltoFocus
  13. */
  14. get_header(); ?>
  15. <div id="primary" class="content-area">
  16. <?php if ( have_posts() ) : ?>
  17. <?php if ( is_home() && ! is_front_page() ) : ?>
  18. <header class="page-header">
  19. <h1 class="page-title"><?php single_post_title(); ?></h1>
  20. </header>
  21. <?php endif; ?>
  22. <main id="main" class="site-main" role="main">
  23. <?php
  24. // Get the featured post ids
  25. $feautured_id_array = altofocus_get_featured_post_ids();
  26. /* Start the Loop */
  27. while ( have_posts() ) :
  28. the_post();
  29. /*
  30. * Include the Post-Format-specific template for the content.
  31. * If you want to override this in a child theme, then include a file
  32. * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  33. */
  34. get_template_part( 'components/post/content', get_post_format() );
  35. endwhile;
  36. the_posts_navigation();
  37. ?>
  38. </main>
  39. <?php else : ?>
  40. <main id="main" class="site-main" role="main">
  41. <?php get_template_part( 'components/post/content', 'none' ); ?>
  42. </main>
  43. <?php endif; ?>
  44. </div>
  45. <?php
  46. get_sidebar();
  47. get_footer();