I see you haven’t done it yet, so this might be useful. I’m not sure if it’s the best way to do it, but it works for me.
I copied the a-z-listing.example.php file from the templates folder to my child theme’s folder, changed the name to a-z-listing.php, then added the following lines to the while have_items() loop.
while ( $a_z_query->have_items() ) :
$a_z_query->the_item(); ?>
<li>
<a href="<?php $a_z_query->the_permalink(); ?>"><?php $a_z_query->the_title(); ?></a>
// ============ START of new lines added =============
<?php
$a_z_query->query->the_post();
echo "<br>" . wp_trim_words( get_the_content(), 15, ' ...' ); // 15 words, change to what you like
wp_reset_postdata(); // Not sure if this is necessary here
?>
// ============ END of new lines added ================
</li>
<?php endwhile; ?>
You can style it by wrapping it in a div and adding a css class.
-
This reply was modified 7 years, 5 months ago by dougfinn.
-
This reply was modified 7 years, 5 months ago by dougfinn.