The standard Lorem Ipsum passage, used since the 1500s

“Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.”

Section 1.10.32 of “de Finibus Bonorum et Malorum”, written by Cicero in 45 BC

“Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?”

EN NL

Gutenberg Latest Post Block: make featured images clickable [updates]

I like the new Gutenberg editor but dislike the fact that they are difficult to edit. If you like your displayed latest post to look and behave like the posts displayed by your templates then there are a few options:

The first option is that you edit the Gutenberg Latest Post block via a function in your functions.php.
The problem is that Gutenberg Block are constructed via javascript and not via php functions. A WordPress filter to edit the images has no impact on the images in a Gutenberg Block (a shame though). The only filter you can use is add_filter(‘the_content’). This gives you the option to alter the HTML content before it is displayed. You need some regex to find the image and add a link around it.

The second option is that you add some CSS for the Gutenberg Latest Post block. With thanks to the guys from GeneratePress where I found this snippet of CSS that also solves the issue!

.wp-block-latest-posts li {
    position: relative;
}
.wp-block-latest-posts li a:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

Update 4 oktober 2020

If you are a Gutenberg plugin user additional to WordPress 5.5+ than you will see an additional option in the Lates Post block settings: “Add link to featured image”. This setting will probably propagate to a later version of WordPress.

Wordpress Latest Post Block Featured Image Settings
WordPress Latest Post Block Featured Image Settings

Leave a Reply