Adding excerpt to post page, but with space for featured image
-
My template doesn’t include support for adding excerpts on its own. I’ve added the excerpt to the child theme. The other issue is that the theme automatically adds the post’s featured image above the text, and it appears inline with the excerpt (rather than below it).
This is the code I added to show the excerpt:
<span class="post-byline"><?php if($post->post_excerpt) the_excerpt(); ?></span>
The theme then posts the image like this:
<?php the_post_thumbnail('post-thumb'); ?>
I have tried adding breaks twice after the excerpt line, but this also produces ugly gaps on posts where there is no excerpt. How can I insert the line breaks only when there is an excerpt present?
- The topic ‘Adding excerpt to post page, but with space for featured image’ is closed to new replies.