How to use Google analytics on a parked domain

I have found a way to use Google analytics to track traffic on a parked domain by using a PHP conditional statement to check which domain a visitor is accessing your site with and to render the correct Google analytics javascript code based on the domain. First, make sure to set up a Google analytics Read more…

How to add an incrementing number counter inside the WordPress “while” loop

This morning I spent some time figuring out how to add an incrementing number counter inside a WordPress “while” loop and here is how I finally accomplished it: I defined the first number (in this case, the variable $postnum) before the “while” loop started, like so: Then I added my div with the incrementing number Read more…

Resolved: Updating the server PHP version to 5.4 broke my Genesis Simple Sidebars plugin

I had to resolve an issue recently where a client’s hosting company had updated the PHP version of the server to 5.4 and this “broke” the plugin Genesis Simple Sidebars that was being used on their site, therefore causing the whole site to be down. The PHP error message being displayed in a browser when you tried to Read more…

WordPress Tricks: Customizing the output of “wp_nav_menu()”

There are times when I need to output a menu in WordPress with very custom settings – for example, with no containing UL, with a specific class on the wrapping UL, with the links wrapped in specific tags (spans, for example), etc. Here is the call to a WordPress menu that I use and customize Read more…

Open and scroll to an anchor link on a different page with an offset to adjust for a fixed header

Here is the script I have used to open and scroll to an anchor link on a different page on a site that has a fixed header and therefore needs to have an offset so the anchor link is not hidden behind the header. What this script is doing is calculating the height of your Read more…

How to make the top-level links in a jQuery accordion menu clickable

I often use a jQuery accordion menu for the mobile menu on responsive websites and have run into issues before where the top level links by default seem only to expand or collapse submenus and not actually take you to the page you are trying to go to. What I have found is that I Read more…

Colorbox: Removing the blue outline around images

After spending a bit of time sleuthing around this morning for a solution to removing the blue outline or border that you see around either an image that triggers a Colorbox event or around the close button in an active Colorbox, I finally found a simple piece of CSS that did the trick. This is Read more…

WordPress Tricks: How to add the name of parent category to the body class of a child category archive page

Here is the snippet of code I use to add a specific body class to the child category archive pages on a WordPress site. Paste this into the header.php file of your site’s theme: Next, make sure the body tag in the header.php file looks like this: What this code will do is add the Read more…

A quick way to fix the broken pagination on your WordPress category or archive pages when using custom queries

Here is the useful code snippet that I use to fix the issue where using a custom query on a WordPress category or archive or even index page breaks the pagination. Simply copy and paste this code into your theme’s functions file: And then edit as necessary! To target a specific category, you would use Read more…

WordPress Tricks: Use a WordPress query to exclude a category from your home page without breaking pagination

Here is the code I use in a WordPress site’s index.php file to exclude a specific category from the home page withOUT breaking the pagination: Of course, to include a specific category, you would use this: