Today, here’s a snippet that gives you the ability to extract the source of the post thumbnail image. It is super useful if you need the post thumbnail url to use in your code.
Shortcodes are always a good solution when you need to achieve a specific task. In this recipe, let’s see how we can insert an image in a post, simply by using a shortcode and the filename.
When using images in your posts, you not always want them to be shown on your blog homepage. In theses cases, here is a little piece of code that prevent any images from the post to be displayed on the homepage.
Most WordPress users are using custom fields to display thumbs on their blog homepage. It is a good idea, but do you know that with a simple php function, you can grab the first image from the post, and display it. Just read on.
Some time ago, I have shown you how to create and use WordPress shortcode. One of our readers, Madcore, created a very helpful shortcode to easily display the last image attached to post. Here’s the code.
A lot of WordPress users seems to be very interested by being able to display a random header image. So, here’s a simple recipe, using the php rand() function, to display a random header on each post or page.