WordPress.org

Forums

[Theme: . Q: Can we set different page layout/template for different cate?] (3 posts)

  1. Prerak Trivedi
    Member
    Posted 3 years ago #

    Hello Devs.

    I have a question that can we set up page layouts/templates/themes according to tags/categories. Example will give you clear idea about this need.

    e.g. Assume we have a blog on Technology. Theme background having the pictures of gadgets like mobiles,laptops etc.. And navigation bar having sections like Smartphone,Laptops,Software etc. Now when a visitor visits our blog (homepage), he/she will see a background image containing lots of gadgets. Now when he/she click on Smartphone, this action will redirect the visitor to the post list having Smartphone tag/category, But when he/she arrives on that page background image should be change to only Smartphones.

    I have tried to be brief as much as I can. But if you have any doubt regarding my question, I can explain deeply.

    Thanks in advance,
    PNT

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Yes - this is possible if your theme uses the body_class() function.
    http://codex.wordpress.org/Function_Reference/body_class

  3. Prerak Trivedi
    Member
    Posted 3 years ago #

    Thanks esmi. Will check this out.

Topic Closed

This topic has been closed to new replies.

About this Topic