Adding thumbnail images in wordpress post

This article will tell you how to add thumbnails message in your wordpress theme, and the other part of the tutorial will show you how to use them.

To add support for publishing custom thumbnail images in the first place you need to open the functions.php file. Here we must add the following code:

add_theme_support ("after-images thumbnail ');
set_post_thumbnail_size (80, 80, true);

The first line allows you to post thumbnail pages and support for subject. This is the most important line, because without it, the thumbnails would not work. The second line is optional, says the issue of what size will the image, in this case 80pixels (width) by 80pixels (height).

Now that wordpress finished telling that we want our thumbnail to be enabled, but do not say where they want them. So to do this we must open the page or pages where our messages are. This can vary from one topic to another. Most of oftenly will be directly in the index.php file. The next step is to find the "loop":

title = "Codex - WordPress.org - The Loop "> More information on the cycle here

Now I'll show you two options. One option is to simply add the code image inside the loop. And result when wordpress will notice that the author has added her image to be displayed, and when the image is added, does nothing. So here's the code you add wchich between the loop:

Now the second option, to display a default image when the author has added no thumbnail itself, must apply this code:

<? Php if (! Has_post_thumbnail ()) {?>
<Img src =? "<Bloginfo php ('stylesheet_directory');?> / Images / default_thumbnail.png "alt =" the_title ();?> <php "/>
Else <Php} ("post-imágenes miniature {the_post_thumbnail');}?>

This verifies that the message has a thumbnail reference if not to display an image:

"Directory of the theme-" / images / default_thumbnail.png

This is already go! If you want to know how to use the custom thumbnail images on your website wordpress follow this link to my other tutorial:

title = "tutorials More here. "> Using thumbnails in WordPress

About the Author

Please visit http://www.zenk.co.cc/ for more wordpress, photoshop tutorials and resources. Also you can look at this tutorial there.


Wordpress


Wordpress


$8.57


No Synopsis Available

The WordPress Anthology


The WordPress Anthology


$29.83


No Synopsis Available

Using WordPress


Using WordPress


$21.24


No Synopsis Available

Wordpress Bible


Wordpress Bible


$42.49


No Synopsis Available

Wordpress in Depth


Wordpress in Depth


$18.33


No Synopsis Available

Smashing WordPress Themes : Making WordPress Beautiful


Smashing WordPress Themes : Making WordPress Beautiful


$37.98


No Synopsis Available


Turbocharge your FaceBook Marketing with FB AutoCash!

Tagged with:

Filed under: WordPress Marketing Strategies

Like this post? Subscribe to my RSS feed and get loads more!