WordPress Optimization Guide

Basic WordPress 101

Optimizing the WordPress Admin Area

Code Optimization

Security

Basic WordPress 101

Adding a Basic Post

We’re fans of clients that like to blog. Blogging increases the size of a website, the total number of keywords available for search engines, and the number of long-tail search matches. It also means serving up new content on the regular, encouraging a higher incidence of return by search engine spiders, and therefore more attention to a site.

A good example of regular blogging is a Austin real-estate client of ours that blogs from her phone while she’s out looking at houses. This is brilliant, and she ranks first for her top term in a competitive market, beating out all sorts of other large sites. It’s not the blogging alone that has her positioned there, but it makes a huge difference, and the posts she creates are well targeted, original content, and actually get views by site visitors.

So without further ado, here’s how to add a basic post to your WordPress website or blog.

First, login to your website, which will be at http://www.[insert website here].com/wp-admin

The /wp-admin is obviously what’s important here. Just add your website before it. Then enter your username and password and proceed to click on the POSTS tab and then ADD NEW.

Then fill out the fields you want to use (see image below) and hit Publish. That’s it!

add-basic-post-wordpress

Installing a Custom Theme Via FTP

In this tutorial we are going to talk about how to install a custom WordPress theme from start to finish, and we’re going to walk through the easiest way to work through the entire process.

My favorite place to get themes is Theme Forest. They’ve got a ton of themes to get your web design started in the right direction. The code for their themes is validated, you can see buyer ratings from whoever else has purchased a theme, and you can see how many times it’s been purchased. If you’re new at this, and you want to make sure something has all the bugs worked out, look for something that has a ton of purchases, somewhere from 500 to 2,000 and up.

I try to pick stuff that has less purchases because I want my sites to look a little different. I usually go and change the code anyway, but starting from something new or edgy can make a difference in the final product.

Once you find a theme that looks good, you’re going to get an account, sign in, and go ahead and purchase the theme with “buy now” with your PayPal account or pre-paid credit. Then we download the theme, and once that downloads, we are going to extract it, and upload via FTP (File Transfer Protocol).

I can show you guys how to, how to upload a theme from within the wp-admin, which is not very tough, but we can go over it real quick while that’s downloading. You go to appearance on the left side, on the tab, and then themes, and then you just go to “install themes,” and you can click upload, and you can find the zip file. There’s going to be one that’s actually within the first extracted file that you’ll use, and I’ll show you what it looks like.

Go ahead and extract by using an archive utility that’s probably already installed on your computer. Inside that folder there will be yet another zip file, and this is the one you want. This is the internal one because the photoshop files, plugins, manual, and all the other files that you may or may not need later are not part of the basic theme installation.

So what you would do if you were going to install it this way, choose the file, click “install theme.” This is does or doesn’t work. Sometimes there are little glitches and stuff breaks, so if that happens, or if you’re like me and just want to avoid that step altogether, you can install the FTP which is good to know how to do anyway.

So we already have that theme, we already know where it is, and we’re going to have to extract this theme anyway. We extracted the main download file, but this is the actual theme file. We can look in there and look, those are all the theme files right there, the individual theme files.

Next you need an FTP client, such as FileZilla, that allows you to move stuff from your local drive to your hosted website.

To log in you need to fill out the information as follows:

For your host, that’s the URL of your website minus the http and the www., so you have .com, .net., .org, whatever, but at the beginning you just start with the beginning of your URL whatever’s after the www.

Your user name and password will be sent to you from HostGator or whoever your host may be, and then once you’ve got that you go ahead and connect, and since we already have WordPress installed, this is the root right here, public HTML, that’s basically the start of your site, there’s no sub-folder, there’s no anything else, so everything that we have, we have WordPress installed on the root, so it’s on the root URL, the domain, and we’ve already got all of our files in here for WordPress.

The theme files are going to be inside of wp-content and then themes, so these are your default themes, 2011, 2010, and 2012. They are all in there. Now, from our local drive we find the theme which we extracted from that zip file.

So all you need to do is you can click the transfer button, or just drag the whole folder and drop it right there, and that will move over all the files. That will be a lot of files, so it’s going to take a minute for all of them to get over to the site. That’s all you’re really going to need to do right now with FileZilla.

You probably want to save that downloaded theme somewhere on your hard drive, and then once that upload finishes you’ll be able to activate your theme.

Now that the new theme is in WordPress, look under the Appearance tab and then themes from within the WordPress admin area, the place you log into with /wp-admin. All you have to do now is click activate, and this is a blank site, so I am not really worried about it messing anything up. Then you navigate to your URL, hit refresh, and lookie there! The new theme is up.

It won’t be quite perfect yet because it’s got their information in there, and hasn’t really been set up, but for the setup and how you actually put all the different elements in, you just go through the theme setup files.

There’s always a read-me that will probably take you to an index page that will have walkthrough on how to do all the setup, and this theme is great because it’s already got some stuff in there for you, so you can just replace the information, and that will make it really easy on you as far as setting up the them.

Check out more on WordPress website optimization.

Add a Gif to a Post or Page

workaholics-cockroach-gif

This is actually incredibly simple in WordPress. All you need to do is click the camera button in the WordPress dashboard and then upload the gif. The code looks like this:

<img title=”workaholics” src=”/wp-content/uploads/workaholics.gif” alt=”” width=”600″ height=”337″ />

This one above is from Workaholics Season 1 Episode 3. It’s on Netflix right now. They just pulled a baby cockroach out of this guy’s ear.

This can be fun or informative, and a little creativity goes a long way.

Add an XML Sitemap

Adding a sitemap is super easy and an essential part of optimizing WordPress. The best plugin is “Google XML Sitemaps” and that’s sitemaps (plural). Google XML sitemap is another plugin that’s not as good. You’ll know the right one because it has Arne Brachold as the plugin author.

Installing the Sitemap

Go to plugins > Add New > and Type in “Google XML Sitemaps

google-xml-sitemaps-plugin

Should be the top result, as shown here.

google-xml-sitemaps-install

Install it, and once the popup come up, click yes of course. Then click “Activate Plugin

Now from the plugin menu, click settings. Or you can venture to the Settings tab on the left hand side of the dashboard and then fins “XML-Sitemaps” there. Either way works.

xml-sitemap-settings

The plugin will give you one of two notifications. Either that the sitemap has not been built, in which case you click “build it” or that it’s being refreshed, in which case click “rebuild it.”

build-sitemap-wordpress

Now your sitemap is located at URL/sitemap.xml. The next step is submitting to google Webmasters.

Install WordPress Automatically with Cpanel and Fantastico

In this video we’re going to talk about how to set up a WordPress site through your cPanel login, which is the easiest and fastest way to get WordPress up and running. We’ve included a video here, or you can read through the text below.

cPanel logins are going to be sent to you in an email whenever you set up your hosting account. We usually use HostGator, but whoever you use is going to be the almost the same if you have a hosting company that offers a cPanel. If they don’t, you should find yourself a new hosting company.

Logging Into cPanel

Navigate to exampledomain.com/cPanel in the address bar, or you can use the link that they send you in the startup email. If your domain name servers haven’t transferred over yet, that link will be all you can use.

Just for your information, “:2083” is the same as “/cpanel” and they mean the same thing in the world of the web.

What you’re going to do is put in your username and your password, and go ahead and login. When you login with HostGator it’s going to give you these extra popups to help you get started. You don’t need those because we’re going to show you how to do it right here.

Go ahead and scroll down the list of items and select something called Fantastico Deluxe. It’s an awesome script software will help you really easily install WordPress. WordPress is pretty easy to install anyway, but with Fantastico it is unbelievably easy.

Installing WordPRess

Click WordPress in the left sidebar, and then click “new installation.” We haven’t installed anything else so far, and this is going to create a database for us as well. In some of these install scripts they’ll have you in a subdirectory by default, but we don’t want it in directory. We want our website to be on the root which means located on the domain itself rather than in a subfolder.

Setting Up Usernames and Admin Info

Now for admin access data. Don’t use “admin” as your username. That’s the most common username that hackers look for because in a lot of installations, admin is there by default. Admin nickname you can leave blank. For “admin email” you’re going to want to put in your email address, whichever one you want, and notifications from your website will be sent there.

You can set up an email address here in cPanel as well, but you’ll want to set it up an email before getting to the installation here for maximum efficiency, or you can easily change the email address through the WordPRess backend later.

Back to the installation. Enter in your site name and your description (you can change those later as well) and then go ahead and click “install WordPress.” All right, so once you’ve clicked install, it’s going to take you to a screen where you click finish installation, and it’ll take you to another screen, and then that’s going to give you a link to your website/wpadmin, and /wpadmin is what you use to login to the back end of your WordPress site.

So that’s going to bring up a screen where you can enter that username and password to get in the back end of WordPress and will show you here the basic installation of your WordPress site is up. Once it’s up and running we’ll have a basic page and a basic post already up along with the basic structure for WordPress. You can go in and change the theme at this point and begin setting up the site. Check out more WordPress SEO tips.

Optimizing the WordPress Admin Area

Change the Default Media Upload Location

Changing your uploads file to a different location is a nice little tool that will allow you to clean up your image URLS.

Typically, an image uploaded to WordPress with its default settings will look like this: https://www.completewebresources.com/wp-content/uploads/img-whatever.jpg

For the sake a cleanliness, SEO, and better sharability, we sometimes move the uploads file to a different location. Here’s how:

Head over to your wp-config.php file which is located in the root directory of your WordPress installation. If you installed on the root, it’s in public_html for most. Different hosting set ups will vary.

At this p[oint you could simply change the name of the uploads folder to something different, such as wp-content/media. To do so, open your wp-config.php and find this line of code:

require_once (ABSPATH. 'wp-settings.php')

Leave that code alone, but just after it. Add this code that will change the WP uploads default file location.

define ( 'UPLOADS' , 'wp-content/media' );

Now all we’ve done is change the name of the uploads directory, but it’s still in the same location.

If we want to move it to a new location, then use this bit of code instead.

define( 'UPLOADS', ''.'media' );

That adds a media directory within your root directory, so your images will now have a much cleaner file structure that looks about like this: https://www.completewebresources.com/media/image-whatever.jpg

Note: You can also still change the year/month/date file structure within the WordPress settings dashboard under Settings > Media.

Now, we’re not done yet. In many instances, the media file you’ve just created will not have public permissions on by default.

First, try to upload an image. If you get the little image not found symbol, or a 403 error, you’ll have to change the permissions.

Changing File Permissions of Your New WordPress Uploads Directory

Open up Filezilla, or whatever FTP client you like, and navigate to the directory you just created.

Note: If you made the above changes and then tried to upload an image in WordPRess, the directory will have been created for you automatically.

Right click on that directory, click File Attributes, and then change the permissions to 744. Give that a try, but in all likelihood you’ll need to set them to 755. You’ll want to recurse into directories and apply to all files and directories.

file-attributes-media-upload-location

I like to do this to shorten up all the mess and to optimize wordpress to spit out shorter file names for Google and Bing. “/wp-content/uploads/image-filename.jpg/” is just too long for me. Now, especially with image sharing social media being such a major ranking factor, you’ll want to be pinning images on Pinterest, blogging them to Tumblr, and sharing on Google+ and Facebook. Maybe you even use Forrst or Dribbble or one of the other media sharing sites out there.

If you are trying to promote your website and het traffic and visits through your images, host those images on your site. Sure, you can upload via FTP but if just want to use the WordPress image uploader, here’s how to do it.

Get into the WordPress dashboard and go to Settings > Media (as shown below)

wordpress-settings-media

Then look for the “Uploading Files” header. Look to where it says “Store uploads in this folder“. That’s what you want. You can name the folder whatever. IMG, media, stuff, x, whatever. You can use your imagination as to what you name the directory. You will have to of course create this directory in FTP first. Use an FTP client such as Filezilla for that.

media-settings-wordpress

Another little something I do is to UNCHECK the box for “Organize files into year and month folders.” This shortens your url for these files, and it has the added benefit that if you need to update an image file somewhere on your site, and it’s a month later, you don’t need to locate the code where that file is embedded in the site. All you need to do is go to Media, delete the old file, and then upload the new one with the same file name. Now wherever that image appears on your site, it’ll be updated.

Automatically Ping Search Engines

In today’s tutorial we are going to talk about setting up WordPress to automatically ping search engines to let them know that you have new content on your site.

There is a service available that you can go to, and you can actually copy and paste the URL of your post to that service, and it will ping for you. It’s called Pingler.com.

The awesome thing about Pingler is that they list all of their ping services, so if you were just going to go to Pingler you’d put in your title, your URL, the category that it’s in, this little captcha code, and then go ahead and hit ping. It takes a few minutes, you leave the window open, and it will ping all these services

Now, since all of these ping services are already listed, what you can do is you can copy them, Command + C, and then go over to your WordPress dashboard: Whatever-URL/wpadmin, log in, then down under settings, the settings tab on the left, you are going to go to “writing,” and if you scroll down on “writing” you’ll see oh, look, update ping services, so this has ping service already integrated in WordPress.

Go ahead and hit enter and go to the next slide, and then paste with Command + V, and what that’ll do, if you save changes, is it will set up your WordPress blog so that anytime anytime you post a new post or a new page, it’ll automatically ping all of these different ping services. So that’s really all there is to it. A great wordpress optimization trick, really simple, just two seconds of copy and paste, but it’s going to save you a lot of time as opposed to having to go out to Pingler every time you want to ping something, and that’s it!

Set WordPress to Auto Ping Posts

This is an awesome little WordPress SEO trick to make your WordPress blog posts automatically send out pings when you post new content.

Go to Pingler.com and loo at their list of Ping Services.

ping-services

You could of course go to Pingler every time you add a new post and enter it there, but let’s let WordPress do that for us.

In the WordPress dashboard go to Settings > Writing and scroll to the bottom where it says Update services. Copy the list of services from pingler.com or copy them listed here below. and paste them into that area.

Save Changes.

That’s all there is to it, Now your website will send a notice to all those pinging service whenever you post fresh content.

Ping Services List

api.my.yahoo.co.jp/RPC2
audiorpc.weblogs.com/RPC2
blog.goo.ne.jp/XMLRPC
blog.with2.net/ping.php
bloglines.com/ping
blogpeople.net/ping
blogpeople.net/servlet/weblogUpdates
blogpingr.de/ping/rpc2
blogsearch.google.ae/ping/RPC2
blogsearch.google.at/ping/RPC2
blogsearch.google.be/ping/RPC2
blogsearch.google.bg/ping/RPC2
blogsearch.google.ca/ping/RPC2
blogsearch.google.ch/ping/RPC2
blogsearch.google.cl/ping/RPC2
blogsearch.google.co.cr/ping/RPC2
blogsearch.google.co.hu/ping/RPC2
blogsearch.google.co.id/ping/RPC2
blogsearch.google.co.il/ping/RPC2
blogsearch.google.co.in/ping/RPC2
blogsearch.google.co.jp/ping/RPC2
blogsearch.google.co.ma/ping/RPC2
blogsearch.google.co.nz/ping/RPC2
blogsearch.google.co.th/ping/RPC2
blogsearch.google.co.uk/ping/RPC2
blogsearch.google.co.ve/ping/RPC2
blogsearch.google.co.za/ping/RPC2
blogsearch.google.com.ar/ping/RPC2
blogsearch.google.com.au/ping/RPC2
blogsearch.google.com.br/ping/RPC2
blogsearch.google.com.co/ping/RPC2
blogsearch.google.com.do/ping/RPC2
blogsearch.google.com.mx/ping/RPC2
blogsearch.google.com.my/ping/RPC2
blogsearch.google.com.pe/ping/RPC2
blogsearch.google.com.sa/ping/RPC2
blogsearch.google.com.sg/ping/RPC2
blogsearch.google.com.tr/ping/RPC2
blogsearch.google.com.tw/ping/RPC2
blogsearch.google.com.ua/ping/RPC2
blogsearch.google.com.uy/ping/RPC2
blogsearch.google.com.vn/ping/RPC2
blogsearch.google.com/ping/RPC2
blogsearch.google.de/ping/RPC2
blogsearch.google.es/ping/RPC2
blogsearch.google.fi/ping/RPC2
blogsearch.google.fr/ping/RPC2
blogsearch.google.gr/ping/RPC2
blogsearch.google.hr/ping/RPC2
blogsearch.google.ie/ping/RPC2
blogsearch.google.it/ping/RPC2
blogsearch.google.jp/ping/RPC2
blogsearch.google.lt/ping/RPC2
blogsearch.google.nl/ping/RPC2
blogsearch.google.pl/ping/RPC2
blogsearch.google.pt/ping/RPC2
blogsearch.google.ro/ping/RPC2
blogsearch.google.ru/ping/RPC2
blogsearch.google.se/ping/RPC2
blogsearch.google.sk/ping/RPC2
blogsearch.google.us/ping/RPC2
i-learn.jp/ping/
ping.blo.gs
ping.blogs.yandex.ru/RPC2
ping.feedburner.com
ping.kutsulog.net/
ping.myblog.jp
ping.pubsub.com/ping
ping.syndic8.com/xmlrpc.php
ping.wordblog.de/
pingoo.jp/ping/
rpc.aitellu.com
rpc.bloggerei.de/ping/
rpc.pingomatic.com
rpc.reader.livedoor.com/ping
rpc.twingly.com
rpc.weblogs.com/RPC2
services.newsgator.com/ngws/xmlrpcping.aspx
www.syndic8.com/xmlrpc.php
www.wasalive.com/ping/
www.zhuaxia.com/rpc/server.php
xping.pubsub.com/ping/
zhuaxia.com/rpc/server.php

In this video we’re going to talk about optimizing WordPress and how to change your WordPress permalink structure which is hugely important for SEO, absolutely essential, and it’s really easy to do through WordPress, so go ahead and go to your website.

Go to wp-admin, log into the back end of your site, and under here under settings, the settings tab you can hover, scroll over, and click on permalinks. Right now any permalinks that you have on your website are going to look like this default. So the page would be: questions mark, p=123 or some baloney like that. The problem with that is that it doesn’t have any keywords in it, and Google just sees some random garble which is not good for SEO.

Keyword Focused URLs

You want keywords in the URL string, especially if you have a site for which you’re trying to rank a number of different pages rather than just the home page which has become really an effective way of ranking sites, and it gives you a lot broader spread to make your website rank. So, it’s real easy to change the structure though.

If you have a website that is going to be content heavy, and it’s going to have a lot of posts, and there is a potential that some of the posts might even have the same name, what you can do is you can put month and year and name, so let’s put the year and the month and the name, or you can just have the year if you wanted to take the other parts out

For almost every site that we do we want to have those keywords because we’re going to use keywords to name our pages as close to the URL as possible. So we’ll change the structure to a postname structure, and I’ll show you here and just automatically switch it. You can enter this code manually if you want, but WordPress is set up now to where that’s all you’ve got to do. So go ahead and “save changes,” and then if you have a page that you’ve created there’s already a sample page.

This is just a blank website with no website design yet, and you view that page, then there is your permalink structure right there. That’s a very pretty URL. So going back here if you were to create a new page, and you just type in “new page.”

Then automatically WordPress is going to give you a URL string, and it has a nice URL structure for the permalink, and if you want, you can change this. If you want to have the page title be something different, than what’s in the permalink, sure, go for it, change it. Then you just publish that page, and you can see again you’ve got your URL, the basic URL, the root, and then this nice, keyword-friendly URL string, and that’s all there is to it.

Making your permalinks “pretty” aka keyword focused with your WordPress site or blog is vitally important to ensuring that you site gets found. The reason you want to do this is so that you will have keyword rich URLs to serve up to Google, Bing, and the other search engines. View this quick tutorial on how to set the permalinks for your WordPress blog.

Best Practice WordPress Settings Changes

There are a few little tips and tricks to go through here that you learn after building a couple hundred WordPress sites. This is a basic instruction on setting up the Settings tab of you WordPress blog.

Login to WordPress and find the Settings tab on the left hand side, in gray, at the bottom.

Hover over and let’s start at the bottom with Permalinks

Permalinks

Setting up permalinks properly is essential, and it’s part of what makes WordPress superior to other platforms out of the box. This setting is easy, but essential. Under Common Setting select “Post Name” and then click Save Settings.

permalink-settings

Privacy

By default this should be set, but make sure it’s set to “Allow search Engines to Index this site.”

Media

You can see a cool little trick about how to change your default media library folder name in Media Settings by clicking the link.

This section I personally like to UNCHECK the box for “Organize files into year and month folders.” This shortens your url for these files, and it has the added benefit that if you need to update an image file somewhere on your site, and it’s a month later, you don’t need to locate the code where that file is embedded in the site. All you need to do is go to Media, delete the old file, and then upload the new one with the same file name. Now wherever that image appears on your site, it’ll be updated.

media-file-folder-organization

Save Changes.

Discussion

The default article settings apply to posts and pages. You can Leave these items checked if you want to allow people to comment on anything you publish, but doe to the spammy nature of the internet, it’s best to leave this off for you static pages. I uncheck all three boxes sometime or leave the first one checked if I;m making a site that will link out regularly to other blogs and leave it at that. You can still change the settings at the individual post or page level.

discussion-settings-wordpress

Now, you’ll also want to check the box for “An administrator must always approve the comment.” That way if someone does post a good comment at some point and you approve it, you aren’t leaving the door wide open to spam from that author in the future.

Save changes.

Reading

This is the area for deciding if you want to show blog posts on the home page or a static page. Up to you.

Save changes.

Writing

Just let this one chill.

General

Best practice is to set the URL to the www. version. You may have just the URL there without the www. Generally the initial installation with Fantastico works like that. If so, add www. to both the “WordPress Address” and “site address”. At this point WordPress will log you out. Simply enter your password and username and log back in.

general-settings-wordpress

That’s about it for setting up the basic WordPress settings with search engine optimization in mind. As far as setting up website hosting and installing a theme, we’ll cover those in other posts. For WordPress optimization services, get in touch with us.

Code Optimization

Optimal WordPress Snippets

The beauty of WordPress lies in its simplicity. Theme customization in WordPress for SEO is quick and simple. There isn’t much of coding involved. This means if you wish to make some immediate changes in your present WordPress themes you need not sit for hours writing down intrigue code. Sometimes, it might take you only a few minutes to wrap up the entire task.

wordpress-optimization

All you need to do is to hire a WordPress developer who can add small code snippets to your existing theme and customize it as per your current requirements. This post discusses 10 small and easy to implement snippets of short code that you can implement in your existing theme to upgrade it to suit your requisites. You can add these code snippets in functions.php file of your WordPress theme.

Limiting the Word Count of Excerpt:
At times it has been seen that people tend to add too many words in excerpt of a post, before the more button. In small scale websites, this issue can be tackled manually. In websites having hundreds and thousands of posts, however, handling the excerpt issue for each post manually can be cumbersome. The following code snippet can be used to automatically limit the word count of the excerpt to a definite number:

add_filter('excerpt_length', 'ilc_excerpt_length');
function ilc_excerpt_length( $length ){
return 10;
}

In the above code we are setting the word limit of the excerpt up to 10 words.

Detecting Safari on iOS:
These days several people are using mobile as a platform to access the internet. In case you wish to check which user is operating through the mobile platform, you can add the following snippet to the code. This snippet helps in safely detecting the Safari browser so that you come to know which user is operating throw an iPad or iPhone.

add_action('wp_print_styles', 'ilc_enqueue_styles');
function ilc_enqueue_styles(){
global $is_iphone;
if( $is_iphone ){
wp_enqueue_style(
'iphone-css', get_stylesheet_directory_uri() . '/iphone.css' );
}
else{
wp_enqueue_style('common-css', get_stylesheet_directory_uri() . '/common.css' );
}
}
This snippet is using the wp_enqueue_style function to add styles to your WordPress web page.

Redirecting Feeds from WordPress to FeedBurner:
Wordpress includes the feeds feature, which is a great news. There is, however, no way of availing user statistic in WordPress. For this you need to use tools such as FeedBurner. If you wish to redirect your WordPress feeds to FeedBurner and likes, you can use the following snippet:

add_action('template_redirect', 'ilc_rss_redirect');
function ilc_rss_redirect() {
if ( is_feed() && !preg_match('/feedburner|feedvalidator/i',
$_SERVER['HTTP_USER_AGENT'])){
header('Location: http://feeds.feedburner.com/XYZ');
header(
'HTTP/1.1 302 Temporary Redirect');
}
}

If you open http://www.xyz.com/feeds, this snippet will redirect you to the FeedBurner page of the user XYZ.

Adding Featured Images in RSS Feeds:
Plain and bland content in RSS Feed might not always interest the visitors, thus adding images to the feed will be a great idea. By default, WordPress is not customized to add featured images in the RSS Feed. The following code can be used to add images to RSS feed.

add_filter('the_content_feed', 'rss_post_thumbnail');
function rss_post_thumbnail($content) {
global $post;
if( has_post_thumbnail($post->ID) )
$content = '<p>' . get_the_post_thumbnail($post->ID, 'thumbnail') . '</p>' .
$content;
return $content;
}

The above mentioned snippets can prove very beneficial especially for WordPress programmers. You can add these codes in the functions.php file and make the requisite changes in your theme.

Security

Avoid WordPress Timthumb Hacks

Timthumb.php is a small php script for cropping, zooming and resizing web images (jpg, png, gif) that is a part of a ton of WordPress themes. It allows themes to automatically re-size images. This is great if you have a blog and want to upload one image but also have it auto-generate smaller versions of the image for say, blog snippets on a category page. Unfortunately, this script allows for the modification of files and is located on your server. Fortunately it is updated regularly to combat the continual onslaught of hackers out there. The newest version can be found here: http://timthumb.googlecode.com/svn/trunk/timthumb.php

I’ve seen a few sites hacked in the past, and the cleanup is always a PITA. Here are a couple “calling cards” hackers have left behind:
lex-hacker
hackerturtle