WordPress.org

Support

Support » Themes and Templates » [Resolved] How to get different single.php page for posts from different categories?

[Resolved] How to get different single.php page for posts from different categories?

  • Nessdufrat

    @nessdufrat

    So, the problem is quite simple, not sure the answer will be.
    I’m designing a website which will have different sections, more or less separated from each other.
    I’m using templates with custom headers to style the pages differently. I’m using a custom query in the main loop to exclude posts from some categories from the front page. I’m using a custom loop to get these excluded categories to show on another section of my website.
    So far so good… until I click a post. Which, of course, is calling single.php, and I can’t style it differently (I would need a whole different header, etc.). What I’d like to do is to have my custom loop (right now, loop-level3.php) call a single-level3.php file when somebody clicks on a post belonging in this section.
    I’ve read about custom post types, it doesn’t really seem the way to go. I don’t need anything specific about the posts, like special features and such, I just need my loop-level3.php to call a special single-level3.php page.
    Is something like that possible? I browsed through the codex and forums, I found lost of topics where people want to change a few minor things (I’ve done a whole website where each category is styled differently, each post is also styled according to the category, but it didn’t involve a new header file), but I haven’t found anything like what I need.
    Any advice on how to proceed?
    Thanks 🙂

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] How to get different single.php page for posts from different categories?’ is closed to new replies.
Skip to toolbar