Injecting page specific header code (WordPress)

I found two steps to this:

1. Add a function into general-functions.php

function get_page_id($page_name){
global $wpdb;
$page_name = $wpdb->get_var(“SELECT ID FROM $wpdb->posts WHERE post_name = ‘”.$page_name.”‘”);
return $page_name;

2. Add this code to your header.php

echo get_post_meta(get_page_id($pagename),’header-tag’,1);

3. On the page you want to add custom header tags to, add a custom field called header-tag with your code to inject.

Kindle Fire vs Nook vs iPad

While not a full review of the Kindle Fire versus the Nook and iPad, I did do quite a bit of research into all three before deciding on the Kindle Fire this Holiday Season. It arrived the other day and we are really happy with it.

The reviews I saw comparing the Nook and the Kindle Fire pointed out the differences in hardware and interface. The Nook won in both of those respects, but where it lost was in the media content. The Kindle has access to the entire Amazon media library including all the hit movies, tv shows and music. There is no option on the Nook for downloading movies or music other than through Pandora and Netflix, which are both limited.

Another review of the Kindle Fire vs the Nook said that their web browsing experience on the Kindle was slightly choppy, but workable compared to the Nook. I haven’t experienced any choppiness on the Kindle Fire yet. Everything is extremely smooth and fast.

I was pleasantly surprised to find all of the music and movies I’ve ever purchased through Amazon readily available on the Kindle with a tap of the button. Without any configuring or loading, I was able to play my purchased music (and download it for off-line play) immediately.

The Kindle has 6gb of storage space available on it. The Nook has 16gb of available storage plus it has an SD expansion slot. The KindleFire doesn’t have an expansion slot. That being said, the Kindle Fire is designed to work off of the cloud mostly, and it does a great job at that.

The only other downside to the Kindle Fire is that it doesn’t have Bluetooth support. The Nook doesn’t either. The iPad does (of course).

We purchased a bluetooth adapter for the Kindle Fire that allows us to use our Bluetooth headsets to listen to it without waking the babes.

As far as features and screen size go, the iPad beat both the Kindle Fire and the Nook hands down. However, for some (including us) the smaller screen was actually a plus. Of course the price on the iPad is also much higher.

Happy Shopping!!

PHP Left

There is no function in PHP equivalent to VB or ASP’s left. There is a more robust function called substr. Here’s a function from the forums that replicates the functionality.

function left($string, $count){
return substr($string, 0, $count);