Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm having a weird issue while setting up a site. It almost seems as though the /blog/ url is reserved or already in use, only it isn't as far as I can tell.

I setup a new page called 'Blog' and set the permalink to '/blog/'. Then under 'Settings' => 'Reading' I set the Posts page to be 'Blog'. Then I went one step further and setup a new template called 'tpl-blog.php' and assigned it to the 'Blog' page.

After all that I entered some content in and it and tested and it didn't look right, none of my text was in there and a lowercase 'blog' was showing up for the title. I tested a bit more and found it was using the page.php file instead of my custom tpl-blog.php.

Thanks for any help!
Levi

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Change the filename from tpl-blog.php to page-blog.php, see if that fixes it.

share|improve this answer
    
oh hmm, that fixed it. Was the fact that I set the page to be the 'Posts page' that gave the index.php template a higher precedence than the one I set in the admin? I had tried removing it as the 'Posts page' to see if that changed it and I still had the same problem. So basically I am not just wondering why the template being set in the admin wasn't given the highest precedent. Also, does this work because I am able to override template on a page-uri.php scheme? Good to know! –  Levi Jul 13 '12 at 21:11
1  
Yes, it's the filename that changes the template being used. tpl-blog.php isn't a valid template filename. You could override it with blog.php (as a page template, see twentyeleven for examples), as a template being set in the admin will override page-blog.php. More info is available on the codex - codex.wordpress.org/Template_Hierarchy –  SickHippie Jul 13 '12 at 21:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.