index.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 UIU_CSE
  13. */
  14. get_header();
  15. ?>
  16. <main id="primary" class="site-main">
  17. <?php
  18. if ( have_posts() ) :
  19. if ( is_home() && ! is_front_page() ) :
  20. ?>
  21. <header>
  22. <h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
  23. </header>
  24. <?php
  25. endif;
  26. /* Start the Loop */
  27. while ( have_posts() ) :
  28. the_post();
  29. /*
  30. * Include the Post-Type-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 Type name) and that will be used instead.
  33. */
  34. get_template_part( 'template-parts/content', get_post_type() );
  35. endwhile;
  36. the_posts_navigation();
  37. else :
  38. get_template_part( 'template-parts/content', 'none' );
  39. endif;
  40. ?>
  41. </main><!-- #main -->
  42. <?php
  43. get_sidebar();
  44. get_footer();