Add to Technorati Favorites


Wordpress - Adsense after post hack

An easy hack this one. A simple way to ad Google ads (or any other content) into a predefined number of posts from the start of the loop. The exact code changes will vary depending on your exact template, but these instructions should work for most.

Edit your index.php and find the loop (highlighted below).

Then simply add in the code between <<add this code start>> and <<add this code end>>and your selected Google ad code in the equivalent of the place marked below.

<?php while (have_posts()) : the_post(); ?> <<this is the start of the loop>>
<div class=”post” id=”post-<?php the_ID(); ?>”>

<h1><a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”>

<?php the_title(); ?></a></h1>

<p class=”meta”><?php the_time(’F jS, Y’) ?> by <?php the_author() ?></p>

<div class=”entry”>
<?php the_content(’Read the rest of this entry »’); ?>
</div>

<<add this code start>>
<?php $lb_firstfew=$lb_firstfew+1;?>
<?php if ($lb_firstfew==1) { ?>

<div>

<<your Google code goes here>>
</div>

<?php } ?>
<<add this code end>>

<p class=”info”>Posted in <?php the_category(’, ‘) ?> <strong>|</strong>

<?php edit_post_link(’Edit’,”,’<strong>|</strong>’); ?>

<?php comments_popup_link(’No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?></p>

</div>

<?php comments_template(); ?>

<?php endwhile; ?> <<this is the end of the loop>>

This example simply adds in the Google code after the first post.

You can obviously amend the condition <?php if ($lb_firstfew==1) { ?> to place ads in your selected number of posts.

Don’t forget the Adsense TOS - AdSense publishers may place up to three ad units on one web page.

Posted in Wordpress | No Comments »

Reset passwords in Wordpress Database

Forgotten a user password, but still got access to the Wordpress database?

...[More]...

Posted in Wordpress | No Comments »

Banners and Buttons for WelshDirectory.com

Competition now closed - thanks! 

...[More]...

Posted in Bochgoch Developments | No Comments »

If You Liked That ~ plugin

Version 1.3 of the plugin is now available. This new version is compatible with WP 2.3 and takes on board many of the comments that I have received ~ keep the feedback coming.
You can download it from here.
I’m always looking for suggestions on I can improve things, any suggestions for amendments to If You Liked […]

...[More]...

Posted in Wordpress | 73 Comments »

Wordpress 2.3 compatibility

I’ve not yet dipped my toes into 2.3 yet, but I’ve already been informed that there are some compatibility issues with some of my plugins.
I’ll start checking them out and upgrade / create new versions as I need to …
Update 1st October 2007: The problems with my plugins are caused by changes to the Wordpress […]

...[More]...

Posted in Wordpress | No Comments »

Include Me In That Website ~ Plugin

Version 1.0 of the plugin is now available.
This is a website link generator plugin that provides a thumbnail, description and link to a website of your choice that you can embed into any Wordpress Post or Page.
You can download it and get more details from here.
I’m always looking for suggestions on how I can improve […]

...[More]...

Posted in Wordpress | 6 Comments »

Include Me In That HTML ~ Plugin

Version 1.0 of the plugin is now available.
This is a embedded file plugin that will include any file into the body of any Wordpress Post or Page.

Look at me!

This is an example of content pulled in from an external file using the Include Me In That HTML ~ Plugin

You can download it and get more […]

...[More]...

Posted in Wordpress | 12 Comments »

Those Were The Days ~ Plugin

Version 0.2 of the plugin is now available - this version is compatible with version 2.3 of wordpress.
This is a featured posts plugin that uses the Wordpress cron (scheduled task) functionality to allow your featured posts to change over time without your intervention. Set it up and watch it go! Those Were The Days was […]

...[More]...

Posted in Wordpress | 19 Comments »

business.com increases in value 2300 times in 10 years

There are some truly fanatastic figures being paid for .com’s at the moment. Take just one example:
Business.com’s partial sale history:

$150,000 in 1997
$7.5 million in late 1999
$345,000,000 this month (July 2007)

That is a 2300 times increase in ten years — i.e. it has sold for 2400 times its 1997 value after 10 years … shame I […]

...[More]...

Posted in News | 2 Comments »

What’s New, What’s Fresh, What’s Happening? ~ plugin

The new What’s New, What’s Fresh, What’s Happening? plugin is now available.
It provides a window onto what’s happening on your blog that can be embedded into any page on any site or deployed on your site as a widget. Full styling and configuration options are available.
You can download it from here.
I’m always looking for suggestions […]

...[More]...

Posted in Wordpress | 8 Comments »

« Previous PageNext Page »