index.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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://developer.wordpress.org/themes/basics/template-hierarchy/
  11. *
  12. * @package Pen
  13. */
  14. get_header(); ?>
  15. <div id="primary" class="content-area">
  16. <main id="main" class="<?php echo esc_attr( pen_content_classes() ); ?>" role="main">
  17. <div class="pen_article_wrapper">
  18. <?php
  19. if ( have_posts() ) {
  20. if ( is_home() && ! is_front_page() ) {
  21. ?>
  22. <header>
  23. <h1 class="page-title screen-reader-text">
  24. <?php
  25. single_post_title();
  26. ?>
  27. </h1>
  28. </header>
  29. <?php
  30. }
  31. $content_list_type = pen_list_type();
  32. if ( 'masonry' === $content_list_type ) {
  33. ?>
  34. <div id="pen_masonry">
  35. <?php
  36. }
  37. /* Start the Loop */
  38. while ( have_posts() ) {
  39. the_post();
  40. /**
  41. * Include the Post-Type-specific template for the content.
  42. * If you want to override this in a child theme, then include a file
  43. * called content-___.php (where ___ is the Post Type name) and that will be used instead.
  44. */
  45. get_template_part( 'partials/content', get_post_type() );
  46. }
  47. if ( 'masonry' === $content_list_type ) {
  48. ?>
  49. </div>
  50. <?php
  51. }
  52. get_template_part( 'partials/content', 'pagination' );
  53. } else {
  54. get_template_part( 'partials/content', 'none' );
  55. }
  56. ?>
  57. </div>
  58. </main>
  59. <?php
  60. if ( ! is_singular() ) {
  61. pen_html_jump_menu( 'list' );
  62. }
  63. ?>
  64. </div><!-- #primary -->
  65. <?php
  66. get_footer();