front-page.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php get_header();?>
  2. <div class="container pt-5">
  3. <div class="row gx-5">
  4. <section id="primary" class="col-sm-12 col-lg-6">
  5. <div id="main" class="site-main" role="main">
  6. <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
  7. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  8. <?php the_content(); ?>
  9. </article>
  10. <?php endwhile; ?>
  11. </div>
  12. </section>
  13. <section id="secondary" class="col-sm-12 col-lg-6 pt-2">
  14. <div class="row">
  15. <?php $post = get_page_by_title('B Front Page ( 2nd Column )'); $output = apply_filters( 'the_content', $post->post_content ); echo $output; ?>
  16. </div>
  17. </section>
  18. </div>
  19. <div class="row gx-5 mt-4">
  20. <hr/>
  21. <header class="entry-header">
  22. <h2><a href="<?php echo get_site_url();?>/news">News</a></h2>
  23. </header>
  24. <?php $mostrecentposts = new WP_Query();
  25. $mostrecentposts = get_posts('numberposts=2');
  26. foreach ($mostrecentposts as $post) : setup_postdata($post); ?>
  27. <div class="col-sm-12 col-lg-6">
  28. <header class="entry-header">
  29. <h3 class="front-page m-0"><?php the_title( '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a>' );?></h3>
  30. </header>
  31. <div class="front-page-entry-content">
  32. <div class="post-thumbnail">
  33. <?php echo the_post_thumbnail(array(180,180), ['class' => 'p-2 float-end']); ?>
  34. </div>
  35. <?php the_excerpt();?>
  36. </div>
  37. </div>
  38. <?php endforeach;wp_reset_query();?>
  39. </div>
  40. </div>
  41. <?php get_footer();?>