Tag: Php

HTML5 Support in WordPress 3.6

For the longest time, I had hooked into the default search and comment form to add HTML5 features for my themes. With the release of WordPress 3.6, a new core…

Using the Ternary Operator in PHP

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.…

Convert Hex Color to RGB using PHP

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…

Count Page Hits in WordPress

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…

Access Another Database in WordPress

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…