Whiskey Air Dark New Index Template

4 February 2010

Like I promised in a previous post, here is the code required to show latest 5 posts followed by 15 more, like on my homepage. You need to edit the index.php template and add 2 sub-loops separated by wp_reset_query(). Simple as that. Here is the entire index.php code (you should be able to pull the entire loop from there):


<?php get_header();?>
<div id="content">

<br clear="all" /><br />
<?php if(have_posts()) : ?>
 <?php
 query_posts('posts_per_page=5&offset=0');
 while(have_posts()) : the_post();
 ?>
 <div id="post-<?php the_ID();?>" <?php post_class();?>>
 <h2><a href="<?php the_permalink();?>" rel="bookmark" title="Permanent link to <?php the_title();?>"><?php the_title();?></a></h2>
 <small><?php the_time('j F Y');?> by <?php the_author();?></small>
 <div>
 <div style="float:left; margin-right:8px"><?php echo get_the_image_link(array('Thumbnail','My Thumbnail'),'thumbnail');?></div>
 <?php the_excerpt('Read more &raquo;');?>
 </div>
 <div style="clear:both"></div>
 <p>Category: <?php the_category(', ');?> | <?php comments_popup_link('No comments &#187;', '1 comment &#187;', '% comments &#187;');?><br /><?php the_tags(); ?></p>
 </div>
 <?php endwhile;?>

 <?php wp_reset_query();?>

 <h2>More recent articles</h2>
 <br /><br />
 <?php
 query_posts('posts_per_page=15&offset=6');
 while (have_posts()) : the_post();
 ?>
 <div id="post-<?php the_ID();?>" <?php post_class();?>>
 <p>
 <strong><a href="<?php the_permalink();?>" rel="bookmark" title="Permanent link to <?php the_title();?>"><?php the_title();?></a></strong><br />
 <small><?php the_time('j F Y');?> by <?php the_author();?></small>
 </p>
 </div>
 <?php endwhile;?>

 <div>
 <div><?php next_posts_link(__('&laquo; Older Entries','whiskey'));?></div>
 <div><?php previous_posts_link(__('Newer Entries &raquo;','youdrunk'));?></div>
 </div>

 <?php else : ?>
 <h2>Not found</h2>
 <p>No results found.</p>
 <?php endif;?>
</div>
<?php get_sidebar();?>
<?php get_footer();?>

Download index.php here.

You may have noticed that I’m using an unsanitized function, get_the_image_link, to show a thumbnail next to each excerpt. I noticed it when copying the code. Still waiting for a new version of Whiskey Air?

No More Supplemental Or Google Hell Has Frozen Over

28 December 2007

In 2003, Google introduced a “supplemental index” as a way of showing more documents to users. Most webmasters will probably snicker about that statement, since supplemental docs were famous for refreshing less often and showing up in search results less often.

Now Google is coming to the next major milestone in the elimination of the artificial difference between indices: rather than searching some part of the index in more depth for obscure queries, Google is now searching the whole index for every query.

From a user perspective, this means that you’ll be seeing more relevant documents and a much deeper slice of the web, especially for non-English queries. For webmasters, this means that good-quality pages that were less visible in Google’s index are more likely to come up for queries.

You may have read on SearchEngineLand.com more on Google Hell. If not, do it now.

Webmasters Update From Google

17 December 2007

While checking my Google Webmasters account today I noticed some new options and statistics. The first one is the sitemap inclusion statistics.

sitemap1.png

While seeing the Sitemaps overview, I noticed the actual number of links in Google’s index. This is a nice addition.

sitemap2.png

Another addition to the Tools is the Content Analysis page.

The Content Analysis page shows you potential issues Google found when crawling and indexing your site. We recommend that you review this report regularly to identify changes that potentially increase your rankings in Google search results pages while providing a better experience for your readers.

These issues don’t prevent your site from being crawled or indexed, but paying attention to them can improve the user experience and even help drive traffic to your site. For example, title and meta description text can appear in search results pages, and useful, descriptive text is more likely to be clicked on by users.

content.png

Data that may be included on this page includes:

  • Title problems: Potential problems with the title tag on your pages, such as missing or repeated page titles.
  • Meta description problems: Potential problems with missing, duplicate, or otherwise problematic meta descriptions.
  • Non-indexable content: Pages containing non-indexable content, such as Flash files, video, or images.

Again a nice addition for SEO. Mine was saying “We didn’t detect any content issues with your site.

Guide to Google Webmaster Tools for Bloggers

10 October 2007

Ever wonder how Google sees your site? Ever wish you could click a button and correct all of your site’s search engine woes? As it turns out, you can, at least to a certain extent. Webmaster Tools is a free product from Google that allows you to interact with the world’s most (in)famous search engine spider and indicate how your site should be indexed.

DailyBlogTips presents us a nice guide to Webmaster Tools.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes