Display adsense to search engines visitors only

November 19, 2008

It’s a fact: People who click on your ads are people comming from search engines, not regular readers. In order to avoid being “Smart Priced” by Google Adsense, you should definitely display ads to search engines visitors only. Here’s how to do it. First, we have to create a function. paste the code below in your theme functions.php file. Create that file if it doesn’t exists. function fromasearchengine(){ $ref = $_SERVER['HTTP_REFERER']; $SE = array(’/search?’, ‘images.google.’, ‘web.info.com’,... [Read the full story]

Display wordpress Recent Comments Without Widgets

November 18, 2008

We know that you can easily display the recent comments with the help of a sidebar widget (If your WordPress blog supports widgets) but there is a simple solution that you can use to display recent comments without widgets, the following code will allow you to execute the recent comments in your blog anywhere in your template without widgets. Two primary features: It allows you to display recent comments without widgets. It lets you control how many recent comments to display. Firstly, open a new text file and place the... [Read the full story]

Display a welcome back message to your wordpress visitors

November 18, 2008

What about displaying a customized welcome message to your readers? Do you know that you can use the cookie sended by the comment form to get the name of the reader? Let’s use it to create a very cool welcome message. First, we checked if the visitor have a cookie called comment_author_xxx. If he have, we can get his name and display it on the welcome message. If the cookie doesn’t exists, we simply welcome the visitor as a guest. Simply paste the following code wherever you want on your template. <?php if(isset($_COOKIE['comment_author_'.COOKIEHASH]))... [Read the full story]

Displays page-links for paginated posts of wordpress

November 18, 2008

Did you know that WordPress allows you to cut and slice a long post into different pages? First, When you want to break a long article into pages, you need to includes the <!–nextpage–> Quicktag one or more times to the point where you wish to make a break in your long entry. Then, displays page-links for paginated posts in your template using link_pages() or wp_link_pages(). Most of the themes do not have necessary template tag in place, if your pagination links don’t show up at the bottom of your... [Read the full story]

Tips of WordPress Categories

November 18, 2008

Outside the common use of category tags in WordPress templates, there are very useful functions that can be very powerful and can help you achieve many different things with categories. Tip 1: Get Category name by its ID You could use the following snippet to get category name by its ID. <?php $catname = get_cat_name(1); print $catname; // Would print the category name for category ID 1 ?> Tip 2: Get Category ID by its name You could use something like this. <?php $catid = get_cat_ID('Videos'); echo $catid; //... [Read the full story]

Page 5 of 10« First...«34567»...Last »