Site logo

[Support request] Custom layout depending on category

Home Forums Support [Support request] Custom layout depending on category

Home Forums Support Custom layout depending on category

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2590523
    Robert

    My default layout is content + right sidebar.

    What I am trying to do is to check whether a post is in the category ‘X’. If yes, use the layout content (no sidebars) instead.

    How can I do that?

    #2590997
    Ying
    Staff
    Customer Support

    Hi there,

    You can use a layout element to achieve this, no code is required.
    https://docs.generatepress.com/article/layout-element-overview/#sidebar

    #2591199
    Robert

    yes but is there a way to make it work with code? it would work better for me because I sometimes forget to set the layout element so I want to make it category specific instead.

    #2591344
    Ying
    Staff
    Customer Support
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.