0845 205 0292

Request A Free Website Analysis

Close

WordPress Snippets on the Homepage

February 9th, 2010 by

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.

This entry was posted on Tuesday, February 9th, 2010 at 10:35 am . RSS GlobeYou can follow any responses to this entry through the RSS feed.

Link to us

If you want to link to this blog, copy and paste the following HTML code to your website.

Navigation

Blog Categories

Free SEO Analysis & Proposal

From The Blogread news

  • FEB 08
    There is nothing more important for websites and online brands looking to increase their online visibility than regularly posting fantastic content.  The most obvious, natural way to do this is through maintaining a blog...
  • FEB 07
    Hi guys, we've got the second instalment in the quick tip series for SEO here. When starting an SEO campaign, create a list of possible keywords to target, that you think are relevant to the site. Pick the 5 most relevant keywo...

Latest Newsread news

  • FEB 07
    It has been recently announced of a relatively new feature for Yahoo search. Yahoo has recently launched a mobile app search tool in the UK, which is much later than the USA launch in June 2011. The feature itself, much like a...
  • FEB 03
    The London Olympic and Paralympic Games is set to break a whole host of records as consumers demand for wireless access increases. Some 20,000 separate frequency arrangements are being allocated according to Ofcom. The 20,0...

Clients Say...

"We've long been considering an SEO campaign and have researched the benefits that it could potentially bring to our web presence," commented 3663 Catering Equipment's Managing Director Paul Knight. "The team at Click Consult put together a very attractive package and we're pleased to be able to enter into a sound business partnership with them. We're looking forward to seeing the results they can provide for the 3663 Catering Equipment website moving forward."

3663

Managing Director - 3663 Catering

"We have been working with Click Consult for over a year now. We are delighted with the increase in unique visitors to our site and they have far exceeded our conversion KPI metrics for customer database registrations. We rank in the top 3 for all keywords that we asked Click Consult to optimize for us. This agency know how to produce results."

hills pets

Managing Director - Liverpool One

"Whilst we have a long term keyword strategy, Click Consult have a good appreciation of our business and have a flexible approach to implementing short term keyword strategies to coincide with the peaks of the retail calendar. I receive a monthly performance report from Click Consult detailing the relevant data I require but in addition, I can review the work being undertaken at any time by logging in to their bespoke reporting system."

hills pets

CRM Manager - Liverpool One

"Hills has been looking for an agency that is able to quickly deliver in the search marketing area and catapult EMEA websites ahead of the competition. Taking SEO Consult for this project turned out to be a smart choice. Not only have they managed to significantly increase search engine traffic to our websites, but they also come with innovative ideas that can be turned to reality. I can simply say they deliver. And it's always a pleasure talking to them."

hills pets

Managing Director - Hills Pets