-
▼
2012
(336)
-
▼
October
(28)
- How to Load a WordPress Backup
- How to Redirect in Wordpress
- How to Put a Theme to a WordPress Blog
- How to Insert a Read More in WordPress Posts
- How to Turn Excerpt Off in WordPress 2.9.2
- How to Embed Images in Comments in WordPress
- How to Restore a WordPress Blog From EZ Backup
- How to Remove Featured Image
- How to Create a Free WordPress Blog Badge
- How to Check the RSS Outputs for WordPress
- How to Make Your Own Free WordPress Template
- How to Export Content From WordPress to Tumblr
- How to Change the Theme of a Wordpress Blog
- How to Export WordPress to Facebook
- How to Change WordPress Permalinks for Split Posts
- How to Embed YouTube in Thesis WordPress
- How to Make a New WordPress Blog
- How to Set Thumbnails in WordPress
- How to Convert Wordpress to a Doc
- How to Teach Yourself WordPress Visually
- How to FTP a Static Page in WordPress
- How to Install a Chat Room in WordPress
- How to Load an Artisteer Template to Wordpress
- How to Import Drupal Into WordPress
- How to Set Up the Mochi Plugin for WordPress
- How to Change a Sidebar Background Color With a Wo...
- How to Install Wordpress on Yahoo Hosting
- How to Insert Banners in Between WordPress Posts
-
▼
October
(28)
adsense
How to Set Thumbnails in WordPress
Set a Featured Image
1. Log into WordPress and click 'Posts' in the left menu. Hover over the post that you would like to have a thumbnail, and click the 'Edit' link that appears. Look for a 'Set Featured Image' link in the lower-right corner. If it does not exist, your theme is not yet compatible with thumbnails and needs editing.
2. Click the 'Set Featured Image' link on the post editing screen's lower-right corner. Follow the prompts to upload an image, but do not click the 'Insert' button. Instead, click 'Set as Featured Image' next to the button.
3. Click the 'X' at the top-right corner of the media uploader to make it disappear. Check that your image appears in the 'Featured Image' box. Click the blue 'Update' button to save the post with the thumbnail.
Add Theme Support for Thumbnails
4. Open the functions.php file of your current WordPress theme in the plain text or code editor of your choosing. This file is found here:/yoursite/wp-content/themes/name-of-theme/Add this code anywhere between the
tags of the file, preferably at the very bottom or very top:if (function_exists('add_theme_support')) {add_theme_support('post-thumbnails');}
5. Start a new line and add in the following code:set_post_thumbnails_size(50, 50, true);Between the parentheses are three parameters for this function: width, height and cropping mode. Set the width to whatever you want, and set the height to 9999 if you want variable height. WordPress takes thumbnails and sizes them to the width first and the height second, and with variable height it leaves the height alone. Include the 'true' parameter to tell WordPress to hard-crop the thumbnail to exact dimensions. WordPress crops from the center of images.
6. Add various thumbnail sizes by including the following function on the next line:add_image_size('size-name', 300, 200);Here, the 'size-name' is whatever you want to call that image size when you use it in theme templates, so give it a name that makes sense and is easy to remember. The next two parameters are height and width, just like in the set_post_thumbnails_size() function.
Add Thumbnails to Template Files
7. Open up your template files in your theme's folder. Wherever you want thumbnails to appear, add this code:
Use
instead to use a different thumbnail size set in the functions.php file.
8. Wrap the thumbnail function in conditional tags to keep WordPress from trying to load thumbnails when posts do not have them. Your code should look like this:
9. Use an Else statement to show a fallback image for posts without thumbnails. Fallbacks are useful for site designs that would look awkward without some type of image in the thumbnail spot. Here is an example:
/your-fallback.png' />
8:40 AM | Filed Under | 0 Comments
Comments
Popular Posts
-
1. Log in to your Weebly account. 2. Click 'Theme Editor.' 3. Click on the 'Design' tab. 4. Select 'Edit CSS/HTM...
-
1. Sign up for a publisher account at Bidvertiser. Submit basic contact information and confirm your email address to get started. 2. Lo...
-
1. Log in to your WordPress dashboard. 2. Open the 'Appearance' section on the left side of the WordPress dashboard and then cli...
-
Facebook Widget 1. Create a Facebook fan page for your blog, if you don't already have one. You will have to manually share content wi...
-
1. Open your WordPress Dashboard in your preferred browser. It is accessed at the '/wp-admin' location of your site. For example, ...
-
1. Download and install the WordPress for BlackBerry app via BlackBerry App World. Download the version that corresponds with your BlackBe...
-
1. Go to your WordPress blog's administrative control panel. 2. Click the 'Settings' button on the left-side navigation menu...
-
1. Click the 'Add Contact' button on the 'Add New Post' page. This opens the 'Add a Contact Form' page. 2. Click...
-
1. Register an account with Amazon Web Services Cloud. If you have an existing Amazon account, enter your email address in the appropriate...
-
1. Log into your WordPress.com account using your user name and password. 2. Hover your cursor over the 'My Blogs' tab at the to...
Post a Comment