short

Trim Characters using PHP

August 13, 2012

I had previously written about how you can easily trim your text using a build in WordPress function called wp_trim_words() but sometimes you actually want to trim your text to…

ternary

Using the Ternary Operator in PHP

June 28, 2012

It took me a while to actually figure out the name of this type of operator since trying to search “PHP” and “question mark” didn’t really result in anything useful.…

vote

A Better Voting System for WordPress

October 24, 2011

I published a tutorial quite a while back called Simple Voting for WordPress with PHP and jQuery. It was not without its problems, and recently I needed to improve on…

colorboxes_sml

Convert Hex Color to RGB using PHP

August 24, 2011

Converting certain values back and forth is often necessary when developing functions to help your website work the way you want it to. I needed a function that would convert…

numbers_sml

Count Page Hits in WordPress

July 21, 2011

This is just a little snippet of code I wrote to count the number of hits on a specific page. I only wanted it to work on single post pages…

database

Access Another Database in WordPress

April 4, 2011

When accessing the database in WordPress, you need to use the global variable $wpdb. This will take the constants you set in wp-config.php to connect to your database and retrieve…

post-curl

Post to a URL Using cURL and PHP

March 25, 2011

A client needed me to write a script that would collect information from their database and post it to a specific URL, just like it was being submitted by a…

PHP Errors

Turning On PHP Errors

October 18, 2010

For security reasons, most web servers have PHP errors turned off. This makes sense on live sites since you really wouldn’t want people to see all your root paths if…

WordPress Search

Excluding Pages from WordPress Search

July 8, 2010

When people visit my site and do a search, I assume they’re looking for results within my posts and not in any of my static pages. Too bad WordPress automatically…