Archive for the ‘Wordpress For SEO’ Category

WordPress Snippets on the Homepage

Congratulations, you have decided to install a WordPress blog onto your site. Now you can let people know about yourself and your company, information about your products and services, and any promotions or competitions you may be running. You don’t need to post seven times a day, but one post a week is a little on the light side as search engines LOVE regularly updated content, which is what makes blogs so beneficial in your seo campaign.

But you do not want your blog to be the star of your site, you want the attention to be on the homepage. The purpose of this post is to show you how to get the most recent posts from your WordPress blog and put snippets (usually the first 30 words) onto the homepage.

The first thing we need to do is include the WordPress functions so that we can use them to pull the blogs we want. Place this code near the top of the page and definitely before the next section of code.

<?php
define("WP_USE_THEMES", false);
include("blog/wp-blog-header.php");
query_posts("showposts=3");
?>

What this block of code says is “we will format the blogs ourselves (do not include the WordPress themes), fetch all the functions that I’ll need to use WordPress here, and I want to have the 3 most recent posts”.

Now comes to fun part. We are going to do a mini-version of WordPress’s The Loop.

“The Loop is used by WordPress to display each of your posts. Using The Loop, WordPress processes each of the posts to be displayed on the current page and formats them according to how they match specified criteria within The Loop tags. Any HTML or PHP code placed in the Loop will be repeated on each post.” – WordPress Codex

 <div class="blog">
  <ul class="blogposts">
   <?php while (have_posts()): the_post(); ?>
    <li >
     <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
     <p><?php the_content_rss('', false, '', 30); ?></p>
     <a href="<?php the_permalink(); ?>">Read more...</a>
    </li>
   <?php endwhile; ?>
  </ul>
 </div>

In our loop, we are creating an unordered list containing the title of the post as a link, the first 30 words and a ‘read more’ link.

Obviously you style the snippets to fit into your website’s design. You can see how we have incorporated our most recent blog and news posts on our homepage.

Just like search engines, people will get bored of stale content. So by keeping fresh content on your homepage, people (as well as search engines) will be interested in visiting your site more often, and possible convert from potential customer, to paying customer.

WordPress and IIS, does it work?

In this blog post, I will be looking at how easy it is to get WordPress up and running on an Internet Information Services (IIS) web server. This is an advanced tutorial and so I will be making several assumptions concerning the server environment and your knowledge of its use:

  • The server should be Windows-based, running IIS 6/7
  • It has PHP 5 and MySQL 5 set up and running (most hosting companies that provide Windows servers will offer PHP/MySQL functionality, you may have to check first that it is installed)
  • Your hosting company provides access to set up a MySQL database/user for WordPress to use
  • A decent working knowledge of web servers (such as Apache), PHP, MySQL and FTP

First things first, you need WordPress. At the time of writing, the most current version available is 2.9.1. Once you’ve got it, you need to upload the directory contained within the zip file (wordpress/) to your webserver using a method such as FTP. The choice of where you put the directory for your blog is yours. However SEO is an important consideration and so for example in the instance of this blog, because it deals primarily with SEO related topics, the blog directory is aptly named /SEOBlog/.

Once the WordPress directory has been uploaded, theres one thing we need before we go ahead and install. We need a MySQL database and user suitable for WordPress to use. Depending on your hosting provider, you may have access to phpMyAdmin or an alternative MySQL database tool such as that provided in cPanel or Plesk. Whichever tool you can use, you need to have a existing database available to store the WordPress tables. Alternatively, create a new database for WordPress and name it accordingly.

With the database setup, a user needs creating specifically for WordPress; it should be named accordingly and have full database privileges. After that, you’re almost done, the last thing you need to do is setup for config for WordPress. Open the file at /<your-wordpress-folder/wp-config-sample.php and set the following:

  • DB_NAME: <your-database-name>
  • DB_USER: <wordpress-username>
  • DB_PASSWORD: <wordpress-password>

Save the file as wp-config.php and your good to go. Open up a web browser and point it at http://<your-domain>/<your-wordpress-folder>/wp-install.php. Follow the infamous 5 minute install process and you should be done in flash. Now on the username/password screen, when you hit the Log In button you may get a 403 error(!).

Not a problem, its because your host hasn’t got index.php added as a default directory index document. That should be easy to solve using Plesk: from the Domain Management section, access the Web Directories feature and you should find the option to change the default document under the Preferences section.

Once done, try again logging in again! You should be good to go with WordPress installed on IIS!