Tag: Code

Upgrade Google Analytic Tracker Code

If you use Google Analytics on your web site, you should update your tracker code that is placed in your code. The new tracker is faster, and offers added tracking functionality (See Google’s announcement)

New Code: (put your tracker ID in where you see the X’s)



var pageTracker=_gat._getTracker('UA-XXXXXX-X');
pageTracker._initData();
pageTracker._trackPageview();

While you are updating your code, you might also want to consider moving this and any other javascript to the bottom of your web site for improved performance.

Exclude Single Post in WordPress

If you would like to exclude one post from your blog, archive, search results or wherever you need to on your blog, you can do so by putting in a small piece of code within the particular WordPress loop:

The following example will show all posts except for the post with the ID of 179:

<?php if ( $post->ID == '179' ) continue;?>

This is something that I get a lot of requests for and is very useful in a number of situations.