Home › Forums › Support › Custom layout depending on category This topic has 3 replies, 2 voices, and was last updated 2 years, 11 months ago by Ying. Viewing 4 posts - 1 through 4 (of 4 total) Author Posts March 31, 2023 at 6:02 am #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? March 31, 2023 at 10:21 am #2590997 YingStaff 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 March 31, 2023 at 12:43 pm #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. March 31, 2023 at 3:45 pm #2591344 YingStaff Customer Support In that case, try this filter: https://docs.generatepress.com/article/generate_sidebar_layout/ Author Posts Viewing 4 posts - 1 through 4 (of 4 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In