Whatever you have in content-feature.php
is going to be repeated for each article/post/feature. If you want all of them to be within the same <ul>
you’ll need to put everything else outside into the front-page.php
main template. So:
front-page.php
if ( $loop -> have_posts() ) : ?>
<ul>
<?php /* Start the Loop */
while ( $loop -> have_posts() ) : $loop -> the_post();
get_template_part( 'template-parts/content', 'feature' ); ?>
<?php endwhile;
</ul>
//the_posts_navigation();
content-feature.php
<li>
<div>
<h2><?php the_title(); ?></h2>
<?php the_content(); ?>
</div>
</li>
The only thing with this is if you want to preserve the <article>
tag, you may need to swap it out for the <div>
inside your loop. It’s just a matter of structuring your html so that the repeating parts are inside the loop and the non-repeating parts are outside.