About Author

My name is Nilesh Shiragave, I am a Web Developer and am currently employed as Development Manager for Partner’s Quest as well as undertaking freelance Website Development projects.
My main areas of profession are PHP, mySQL, XHTML, CSS, jQuery and AJAX.

25 Response Comments

This is an excellent tutorial otherwise but am looking for a different variant of it. I am looking for a template which we can use to enter input of a new blog based on a template selected from the ‘Single Post Template’ drop down. The selected template will include input to custom fields as well. I would appreciate if anybody around can help me out.
TIA

I really like the posting … was easy to follow and very helpful while I was reading it … except, it’s not working for me.
This is driving me nuts because it seems so simple but I’m having trouble.
Because I’m using a child template, I had to change my code to:
post;
if (in_category(‘doggonecrazy’)) {
include(‘http://crazydoglife.com/wp-content/themes/Nala-theme/single-cat-doggonecrazy.php’);
} elseif (in_category(‘humanrants’)) {
include(‘http://crazydoglife.com/wp-content/themes/Nala-theme/single-cat-humanrants.php’);
} elseif(in_category(‘quote’)) {
include(‘http://crazydoglife.com/wp-content/themes/Nala-theme/single-cat-quote.php’);
}
else{
include(‘http://crazydoglife.com/wp-content/themes/Nala-theme/single-cat-rainbow.php’);
}
?>

This is actually getting the right template file to open because I’m getting

Fatal error: Call to undefined function get_header() in /home/stacey/public_html/wp-content/themes/Nala-theme/single-cat-humanrants.php on line 10

Why is it telling me that get_header() is undefined? I’ve been messing with it for hours and maybe it is obvious but I guess I’m missing the forest for the trees but I can’t seem to figure it out.

If I replace single.php with it’s orginal code, including the call to get_header() it will go back to the way it was before.

Oh My God!!!!
Realy realy thank you for your share, i have been more than 72 hours without sleep for stupid this code, i founded many articles like this but all off sucks explanation and always following error, YOU ARE GOOD SIMPLE EXPLANATION for newbies like me,