Space Roooooach

It’s friday night and I am blogging. Better yet, it’s friday night and I am working. So while we are dorking out…I might as well take this time to bitch about a function I discovered in Wordpress.

In the pre 2.5 versions, there is a function called is_home(). This is deprecated (no longer used but left for backwards compatibility). Any decent programmer will automatically assume this is a Boolean function. It will return a 1 if we are indeed on the homepage and 0 (or blank) if we are not. Pretty simple…right?

Well for some reason this function wasn’t working…even on the homepage. So I had to look it up. I read through the Wordpress Codex and I felt like a GIANT douche bag looking up is_home(). I have been coding for over 10 years and I am looking up is_home().

With no help from the documentation I have discovered that is_home() will only work if you are not setting a static page as your homepage. You MUST be using index.php (or home.php) and have it set to show your dynamic posts. But index.php and home.php are template pages specifically for the home page.

So this code checks to see if I am on the homepage on the homepage? Huh? Exactly. This is like me calling you at home and then asking if you are at home.

The only scenario I can see this actually working is on an included sidebar, footer, or header. But even then, what are you adding that can’t just be added to the homepage template?  I guess WP got rid of it for a reason. But now for the real quesiton…what da phuk am I am doing home right now? :’(

WDP Wall

Latest on November 24, 2008

Slim: Damn, if that is Sharae it's a good thing you didn't call her back.....but ...what if that wasn't.....

IceburgTX: http://www.jonathancoulton.com/mp3/Code%20Monkey.mp3. There's your theme song, J.

IceburgTX: God made dirt and dirt bust yo' ass!

unknown: Sharae sound like a sexy vixen.... Did you ever call her?

JM: Yeee-aaaah booo-eee. Go Lakers!

space roach: 3 down, 79 to go

phuker#1: the most dominate team to ever play in the NBA

Deez...: ...Nuts.

phuker#1: Where's them taggers @?

IceburgTX: "I felt like destroying something beautiful."

» Graffiti The Wall



RSS Facebook Status

Archives

Tags

Blogroll

RSS Reddit

RSS Hollywood Tuna

RSS Digg

RSS Stereogum

RSS Egotastic

Spam Blocked