How to include a web page thumbnail in a WordPress post

In my article about My take on a Vending Machine Simulation, I wanted to include a link to my Gist, together with a nice thumbnail. Having installed Nzymes on my blog, that wasn’t too difficult.

I thought about using an injection like this:

´{[ =<URL of the file>= | 1.thumb(1) ]}´

so that I could easily reuse it just by changing the URL.

Here are the contents of the execution enzyme.


list( $url, $size, $target ) = array_pad( $arguments, 3, null );
if (! $size) $size = 'x';
if (! $target) $target = '_blank';

$src = "$size&url=" . urlencode($url);
$img = "<img src='$src' />";
$result = "<a href='$url' target='$target'>$img</a>";
return $result;

The idea is to rely on the PagePeeker free service and return a properly built A IMG element.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.