Posts tagged with: php

Replacing “No comments” with “Leave a comment” in WordPress

Many WordPress themes display the number of  comments. The number of comments is a way to show which posts are popular and which are not. The number of comments show a social proof. For a new blogger, or a blog which doesn’t receive many comments, this can be a challenge.

Unfortunately many of the themes are too blunt when there are no comments. For new bloggers and blogs, it’s not uncommon to see “No comments” or “0 comments” on a blog post. Wouldnt’ it be better if it would say “Leave a comment” or “Start the discussion” instead? This post will show you how to do it…

Click to read

Other Tags: Hacks, How-To, WordPress
Topic: WordPress

How to show number of comments in WordPress

If you’re looking to get more blog comments, you should display the number of comments in your blog to act as a social proof. You should also encourage and ask people to leave comments. Both of these can be done via simple hacks to your WordPress theme.

In this post, I’ll show how to show number of comments in WordPress, and the next post shows specifically how to add call to action into comment links by modifying the “No comments” into something like “Start a discussion” instead.

Click to read

Other Tags: Hacks, How-To, Questions & Answers, WordPress
Topic: WordPress

How to show feedburner subscriber & Twitter follower counts

Code is PoetryWant to display your Feedburner RSS subscriber numbers on your blog? And maybe to show off your Twitter follower count as well? Look no further, you can find how to do that in this post.

I’ll show you the easy way (using buttons from a service). And I’ll show you a better way. It requires tweaking some PHP-code and your theme/template files, but if you’re used to edit your files already, this will be easy.

With the better, more advanced way, we’ll be getting the subscriber and follower counts as plain text, and then have all the control how to display the numbers any way we like and use CSS to make it all look nice.

Click to read

Other Tags: Feedburner, Hacks, How-To, Source Code, Twitter, WordPress
Topic: Blogging

How To Add Feedburner RSS Feed to the Sociable Plugin

I admit it, I’m a junkie for quality plugins and I’m testing all kinds of plugins to see if I could make something out of it. And in the end I keep the best and go with that.

I’ve been especially fond of the plugins found at the Yoast.com by Joost de Valk. The plugins are super quality and do exactly what they are meant to do and they do it efficiently. With that said, for Social Bookmarking, I use the Sociable -plugin (also from Yoast), which does a great job at adding those little social network and other useful icons (like “make a pdf”, “email” or “print”) at the end of the post and is very versatile and configurable.

In the recent update of the plugin, “RSS” was added to the available sites list, but that used the default feed of the WordPress. As I use feedburner to manage my feeds, I wanted the RSS link to take the reader to feedburner feed, so I edited the sociable.php and added the site – if you want to do the same, I’ll show how you can do the same (it’s quite easy, if you just dare to go and edit the sociable.php)

Click to read

Other Tags: Customize, Guide, Plugins, WordPress
Topic: WordPress Plugins

How To Add Category and Tag Based Advertising and Content to Your Blog

Want to display certain ads only on certain categories or tags? This quick guide will show you how to do that, for example show banner ads based on category.

If you have blog with different categories, you might consider customizing the advertising shown on posts in spesific category or categories or posts with certain tags. And it doesn’t have to be advertising, you can show different links on different categories and tags.

For example you can:

  • Show links to different themes and plugins on your “WordPress” tagged posts, and
  • Amazon.com Associates cookbook links on your “Cooking” category.
  • Or just display your best posts in the “Fishing” category.
  • etc.

The possibilites are endless, so you can do whatever you can show anything you want and need to show, based on the tags or categories of the posts.

I wanted to do this, because many of the readers who come in and check some of my World of Warcraft material, or EVE Online posts, are not necessary interested in the WordPress content. And if I write about advertising on a blog and how to utilize a plugin to do it, that gamer just wanting to know how to powerlevel mining on the new alt character, most likely does not want info on latest WordPress Premium Themes or such. So I wanted to customize the advertising, extra content and links I show on different posts.

First, I utilized the “Yet Another Related Posts Plugin” to show the related links, so that was easy and does superb job at providing the related post links.

But getting spesific advertising in those posts wasn’t hard either..

If you have the same kind of situation, and want to display advertising or special links based on the categories or tags of your posts, I’ll show you a quick way to achieve that. You do have to dig into your WordPress theme php-files, or find a plugin to insert the code, but it’s really simple…

Click to read

Other Tags: Advertising, Customize, How-To, Make Money Online, WordPress
Topic: Blog Advertising

How To Combine Google Custom Search and AdSense with the Default WordPress Search

Google Custom search is a powerful tool to give your readers a chance to search for content from your blog, web or whatever sites you define for the search. Wordpress comes with default search which presents blog posts and/or pages with the search terms you used.

Remember to check Google’s Terms & Conditions when adding the Google Custom Search. You are not allowed to hide the fact that you’re using Google Custom Search. Reworked instructions are here How To Add Google Custom Search to Your Blog.

I wanted to combine these two. I like the default as the Wordpress search gives clear blog post links and integrates automatically into the Wordpress Theme and templates. On the other hand, Google Custom Search is more accurate in a sense and is “automatically” monatized through Google Adsense.

This article shows you how to get the best of both words, custom search results from Google, along with Adsense ads and the Wordpress search results that display the most relevant posts from your blog.

Note that the most simple way to add Google Custom Search Engine (GCSE) to your blog, is to use a plugin and corresponding widget, but I rarely say no to a chance to mess with javascript and php, so here we go!

Click to read

Other Tags: AdSense, Customize, Make Money Online, Search, Theme, WordPress
Topic: WordPress Tips

Blogger WordPress Import Anyone Can Do

This free Blogger WordPress Import -guide is for anyone who has a blog in blogspot and want to migrate the blog to self-hosted Wordpress.org based blog (which is, the best way to host, write and maintain a blog).

Similar methods can be used to import and redirect traffic from any blog or website of yours, but I only have first-hand experience with the blogspot, import from there and redirect the traffic from blogspot to the new domain / blog.

With the redirect method presented on this article, you can use any kind of permalink structure in Wordpress

In this article, I will show you how I

  • transferred my two blogspot blogs to one wordpress blog and kept all the traffic and links from the old blog
  • used Wordpress custom fields to find the migrated posts, with any kind of permalink structure

Click to read

Other Tags: How-To, javascript, mysql, WordPress
Topic: Blogging