Monthly Archives: June 2009

WordPress Threaded Comments

I have been needing to change my comments to Threaded Comments for some time. I finally took the time to do this, and thought I would share these simple steps to accomplish Threaded Comments using the latest standard WordPress system without any plugins.

The one thing you need before you start is a copy of WordPress 2.7+ so you can copy some code. Just a little side tip here. Even though most of my sites and clients have one button install of WordPress, I keep a copy of each version that is released on a thumb drive with my other web stuff so I always have it handy. I also sync that thumb drive up to a hard drive in my office for backup!

Here are the steps to take to convert your comments to threaded comments as they appear here on my site.

  • Copy \wp-content\themes\default\comments.php from WordPress 2.7+
  • Copy \wp-content\themes\default\comments-popup.php from WordPress 2.7+
  • Copy code from \wp-content\themes\default\header.php, and place in your header file.  <?php if ( is_singular() ) wp_enqueue_script( ‘comment-reply’ ); ?>
  • Copy the Updated styling code from this great article by Chris Harrison
I modified 2 lines of code in the stlyesheet once I copied it over from Chris Harrisons’ Example. I did not like the word “says” showing up, so I turned it off, and I changed the meta link to the comment to match the rest of the site.

Turn off  “says” :

  • From : ol.commentlist li div.vcard span.says {}
  • To: ol.commentlist li div.vcard span.says {display:none;}
Change Meta link color:
  • From: ol.commentlist li div.comment-meta a { color:#ccc; }
  • To: ol.commentlist li div.comment-meta a { color:#003366; }

That’s it, about a 5 minute process to convert to WP Threaded Comments on a WordPress blog. Pretty painless too. Big thanks to Chris Harrison for his excellent post on styling Threaded comments!

Cybers Ebay WordPress Plugin

The eBay WordPress Plugin is finally available.

The eBay plugin is very simple but effective. Once installed you input your EbayNetwork Campaign number into the settings, and how many ads you want to appear on each post.

Place the code <?php cybersebay(); ?> within the WordPress loop and you are set.

The first time you use the plugin you will add a Custom Field to your post with the Key name, ebay. And use the value to hold the keyword for this post to import eBay ads. From here on out, whenever you write a post, you can select the custom field key, ebay from the pulldown list and add the keyword you wish to show listings for.

Below is an example from another site. The article is titled “Fun Stocking Stuffers” and the keyword for eBay is “Christmas Stocking Stuffers”

During my testing of the plugin I received a $27 click, and that is certainly the highest valued click I have ever received !

And it is ONLY $17.00 !!

Add to Cart


I am also offering a 50% Affiliate Commission on this product, just click here for the details!


Trigger Ads Based on Post Word Count

Somewhere along the way I found this little function for counting the words in a WordPress post.

function blog_post_wordcount() {

global $page, $pages;
if ( !function_exists(‘str_word_count’) ) {
return str_word_count(strip_tags($pages[$page-1]));
} else {
return count(explode(” “,strip_tags($pages[$page-1])));
}
}

I did not use it until recently when it occured to me how this could help me with my ad displays. I tend to micro blog alot, meaning my posts are very short. I have always liked to place ads in posts and wrap the content around them, however, when you have a very short post this can cause quite an issue with formatting.

I took this function and placed it in my Themes function.php file, I then wrote a little if statement to tell my blog to place ads in posts only when a post contains over 100 words.

<?php
$words=blog_post_wordcount();
if ( $words >= 100 ) {
?>
<div class=”wrapleft”>
*** ADS GO HERE
</div>
<?php } ?>

Of course you could adjust what size ads and how many words to trigger those ads with a couple minor changes.