Support » Fixing WordPress » Templates for posts?

  • Can you create templates for posts in WordPress similarly to creating different templates for pages?

    I would like to be able to display single posts in certain ways (with a certain template) having elements before and after the post and the ability to change the post type at a later date.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Yes. If you’re seeing that your Pages look just like your Posts, then chances are you don’t have a Page template (page.php).

    Most decent templates will have a template for Posts (single.php), and a template for Pages (page.php). They may give them various names, but those are the actual files, which you can see in Appearance… Edit.

    So you can edit page.php, or if you don’t have one, you’ll have to make one. Or simply try a different theme. 🙂

    WordPress themes are very alterable, but somewhat complex. More info here.

    Good luck, D

    I flamenco, I explained this really badly. Apologies.

    I have a single.php and page.php in this theme. What I meant was whether I could get post A and B to look different in the same way as you can get page A and page B to look different with page templates.

    But I think I can do this with categories. I can use conditional tags in single.php to say “if it is this category do this” “if it is that category do that” etc., an assign categories to posts that I want to look a certain way when viewed with single.php.

    Gotcha. Being a CSS guy, I like to alter the look, colors, and other stuff with that – then I don’t have to touch PHP, and I can do stuff for categories, or even individual posts. 🙂 Themes are usually set up laden with classes and ID’s, so this works very well.

    I like your Categories “IF” idea. That would also be great; you can mess with HTML all you want, which my approach doesn’t allow (apart from vanishing parts of it). I’m sure there are other ways, too.

    It’ll be PHP and HTML – I don’t much understand it but there are some pointers in the codex and I get there with trial and error. Cheers.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Templates for posts?’ is closed to new replies.