Please help as I am loosing my mind with this issue.

I built my first really simple wordpress theme. http://www.designstest.co.uk/ For NEWS (blog) page I created a new template page-blog.php (based in index.php that is used by all other pages). The only difference - it has sidebar. It works fine if I apply same template to static page, but it does not display sidebar on NEWS(blog) page. If you see CMR page - it has same template applied as NEWS.

I have tried instead of get sidebar just place some simple text and it acts the same - displays text in static pages but not blog.

I really don't understand what is going on.

  • Post the code that displays the sidebar, please.
    – s_ha_dum
    Sep 20, 2013 at 14:18

1 Answer 1

<!-- Obsolete

You have to create the file named single.php for your single post template. If you use custom post types, name the file like single-my_custom_post_type.php, where my_custom_post_type part is your registered custom post type.

Otherwise index.php is used by default.



You have to change the file name from page_blog.php to page-blog.php. Notice dash and underscore in the file name.

See Single Post display in WordPress Codex.

  • Thank you for that, but could you please explain what it has to do with the issue? Firstly - if there is no single.php it uses index.php and secondly - It's not the single post page I have issue with. Am I missing something?
    – Silv
    Sep 20, 2013 at 12:13
  • I've missed the point. Temporarily place <?php echo wp_basename( get_page_template() ); ?> somewhere in footer.php to see the file name of the template used for any page.
    – Max Yudin
    Sep 20, 2013 at 12:40
  • Done it but I don't see it displaying anything on NEWS page, but it does show page-blog.php on CSR page which is correct, NEWS (blog) supposed to use the same template. As it also shows nothing on other pages I assume it means the NEWS(blog) page uses index.php despite the fact I've set it to use page-blog.php. Any idea why it's happening?
    – Silv
    Sep 20, 2013 at 15:32
  • See edited answer.
    – Max Yudin
    Sep 20, 2013 at 15:47
  • Well spotted. Thank you for pointing it out, but problem stays still the same :(
    – Silv
    Sep 23, 2013 at 8:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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