Make more profits from wordpress and adsense

by @ 5:39 pm on January 22, 2008.  Filed under On Blogging, WordPress

By default, when you install a wordpress blog and start blogging, your home page displays all of your recent posts. However, with Adsense, you can only display 3 ads per page. Most Wordpress users put an ad at the end of each article. If you do this on your home page, you can only display three articles so the theory is why display all of them on one page?

This hack is part one of two.

The initial fix is easy. Open your Wordpress Theme Editor (wp-admin -> Presentation -> Theme Editor ) and click on the right side menu item titled “Main Theme Template”

The line you need to fix looks like this:

<?php if (have_posts()) { while (have_posts()) { the_post(); ?>

If we change this line to the following:

<?php $x=0; if (have_posts()) { while ($x++<3 && have_posts()) { the_post(); ?>

Then your main page will only display the latest three entries. Your users can still browse your other articles by clicking categories and archive links.

Part two of this hack will provide you with a nifty little Post Pager that will list links to all of your other recent posts at the end of the main page.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists

Post a Comment

Please click here to login to post a comment.

web·pit n. a place of discovery; a repository of information; where coders come for enlightenment; a programmers diary.

internal links:

categories:

search:

archives:

January 2008
M T W T F S S
« Dec   Mar »
 123456
78910111213
14151617181920
21222324252627
28293031  

other:

All content Copyright (c) 2008, Mark Williamson