As I was redesigning my sidebar using the GeneratePress block elements I decided that I wanted it to include a list of posts. I created that list of posts using WP Show Posts (what else?) and placed in my sidebar using a shortcode block. Unfortunately, the way it ended up looking wasn’t as I had pictured. As it turns out, WP Show Posts adds quite a large margin to each article’s title when using only a single column.
As I’ve been using WordPress for quite some time now I knew there had to be a way of solving this problem. And not long after the problem had presented itself, it was already corrected with just a few lines of CSS.
Reducing the space between WP Show Posts titles
I first thought that the column gutter option in the WP Show Posts settings would solve this issue. As it turns out it doesn’t. But after analysing the titles I knew which CSS options needed to be adjusted. To solve the issue of having your WP Show Posts placed too far apart simply add the following CSS using the WordPress Customiser:
.wp-show-posts:not(.wp-show-posts-columns) .wp-show-posts-single:not(:last-child) {
margin-bottom: 10px;
}
There is no need to adjust the block or the WP Show Posts list. Interesting the CSS is all you have to do.