index.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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() ) : the_post();
  28. /*
  29. * Include the Post-Format-specific template for the content.
  30. * If you want to override this in a child theme, then include a file
  31. * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  32. */
  33. get_template_part( 'components/post/content', get_post_format() );
  34. endwhile;
  35. the_posts_navigation(); ?>
  36. </main>
  37. <?php else : ?>
  38. <main id="main" class="site-main" role="main">
  39. <?php get_template_part( 'components/post/content', 'none' ); ?>
  40. </main>
  41. <?php endif; ?>
  42. </div>
  43. <?php
  44. // get_sidebar();
  45. get_footer();