Could someone help me write a custom shortcode to simply display the latest post anywhere in Wordpress? I've seen a lot of ways how to do this in pure PHP in a custom page template, but if I try to convert it, I always get problems (double display) or completely nothing. It should be just one post (not page) of any kind at all, as long as it's the most recent one.
I just need it like this:
<h2>Title</h2> <p>Excerpt...</p> <a href="permalink" class="button">Read more</a>
I've also looked for some plugins, but that's also problematic. They break all shortcode functionality or they just display a list...
Can anyone help me out and score some points? I would surely appreciate it.