Possible to have 2 styles of single.php? (3 posts)

  1. adejones
    Posted 2 years ago #

    Hi everyone
    I have a page with a feed of posts from one category, when clicking the permalink of one post it goes to the full post using single.php (obviously).

    I am then going to have another page with a different feed of posts from a different category and I want these full posts (once clicked in to) to have a different style/layout, but this would also be using single.php

    How is it possible to have two different types of single post for the two different categories because obviously there is only one single.php?


  2. Kacomp
    Posted 2 years ago #

    Hi there,

    You can do this two ways.
    1. Create a new template. Just copy single.php call it something else then make your styling changes withing this file. You can then select this new template from your post/page.
    2. Read about post formats http://www.wphub.com/tutorials/wordpress-post-formats/

    I hope this helps you to find the solution you are looking for.
    Good luck.

  3. paulwpxp
    Font hero
    Posted 2 years ago #

    You can difinitely do that making use of classes produced by body_class(). There is also post_class(), but most of the times body_class() is enough to get the job done.



Topic Closed

This topic has been closed to new replies.

About this Topic