Posts Tagged ‘Thumbnail’

Using shortcode to display recent posts in static page. If your theme support the “post-thumbnail” option then you can displayinh the thumbnail to your recent post. Otherwise you can use custom field(‘thumb’) option to display the thumbnail to your post. You can use the_excerpt or the_content function according to you choice. I am sharing the shortcode: (more…)

In WordPress 2.9, the get_the_post_thumbnail is a new function that was added to allow you to select and display a post’s thumbnail image. If you have a version of 2.9+ installed, in your wp-includes folder, you will find a file called, post-thumbnail-template.php. Inside, the get_the_post_thumbnail() function is what will allow you to display your post’s thumbnail or thumbnails for a list of posts such as on your homepage or category (archive) pages. The get_the_post_thumbnail WordPress function will return your thumbnail in an html img tag so all you have to do is call the function where you want your thumbnail to be displayed, then style it using css. (more…)

Go to “custom fields” section and add a new field as thumbnail and put the image path in the value field. See the example

Now put the following code in the custom theme’s template file

if(get_post_meta($post->ID, 'thumbnail', $single = true)) :
echo '<img src="'.get_post_meta($post->ID, 'thumbnail', $single = true).'" title="'.$post->post_title.'" width="98" height="82" />';