I am struggling with front/landing page customization for my custom designed theme. I have designed custom theme and pretty much coded it using the Underscore boilerplate.
As I understands, the codex suggests that I create a front-page.php and customize it there. In setting>reading I selected A static/Front page (my desired page where I change the static welcoming message). Underneath I want to have 3-5 recent posts with thumbnails (enabled in my functions) and excerpts.
My front-page.php:
<main id="main" class="site-main" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php endwhile; // end of the loop. ?>
<h2>Recent Posts</h2>
<ul>
<?php
$args = array( 'numberposts' => '5' );
$recent_posts = wp_get_recent_posts( $args );
foreach( $recent_posts as $recent ){
echo '<li><a href="' . get_permalink($recent["ID"]) . '" title="Look '.esc_attr($recent["post_title"]).'" >' . $recent["post_title"].'</a> </li> ';
}
?>
</ul>
</main><!-- #main -->
This works, however I have no clue how to load thumbnails + excerpts. Most importantly is this correct?