5th Jun '22/0 commentsUser Role Condition in BricksSridhar Katakam This Pro tutorial provides the steps to conditionally output elements depending on the currently logged-in user's role. Step 1 Create a section Template having the content you wish to output for users having a specific role. Sample name of a Template for author user role: Author User Role Content Edit and build it with Bricks. Step 2 Add the following in your child theme's functions.php: This is a BricksLabs Pro tutorial. For full access login below or create your BricksLabs Pro account Username Password Remember Me Forgot Password Tagged: BricksConditionsProSridhar KatakamSridhar Katakam is a Bricks enthusiast. He likes helping others by researching and solving WordPress-related problems and building websites.Get access to all 633 Bricks code tutorials with BricksLabs Pro
Pro City-based and Country-based Conditional Output in BricksThis Pro tutorial provides the steps to render a Bricks element only if the visitor is from the specified country or city. Note: Caching may…Read more →Categories: Bricks, ProTags: Geotargeting
Pro Meta Box Settings Page Custom Field Conditional in BricksThis is the equivalent of ACF Options Page Custom Field Conditional in Bricks tutorial for Meta Box. Refer to the previous Meta Box Settings Fields…Read more →Categories: Bricks, Plugins, ProTags: bricks/element/render, Conditions, Meta Box
Pro Check if the User Purchased Any of the Specified ProductsThis Pro tutorial provides the steps for setting up a dynamic data condition on any element in Bricks so it can be output only if…Read more →Categories: Bricks, Plugins, ProTags: Conditions, Dynamic Data, WooCommerce
Pro Conditional Output in Bricks based on if Content has HeadingsHow to prevent the output of the table of contents if the content has no headings.Read more →Categories: Bricks, ProTags:
Pro Conditional CSS in Bricks based on Post MetaIn the Bricks Facebook group a user asked: Hi, how do you normally control margin, padding and font-size using dynamic data? I'm looking for the…Read more →Categories: Bricks, Plugins, ProTags: Attributes, wp_add_inline_style
Pro Conditional CSS Classes based on Bricks Query CountIn a Bricks project I am currently working on, there are nested query loops - team members inside departments on a Page. Each team member…Read more →Categories: Bricks, ProTags: bricks/element/render_attributes
Pro Seasonal banner display in BricksThis Pro tutorial shows how a banner Section can be conditionally output only during/between the start and end dates set in ACF Options page in…Read more →Categories: Bricks, Plugins, ProTags: bricks/element/render, Conditions
Pro Conditional Output in Bricks based on Visitor SelectionHow we can dynamically show elements based on user selection.Read more →Categories: Bricks, ProTags: AJAX, Cookies, Fetch API, localStorage
Pro Month and Day Condition in BricksThis Pro tutorial shows how we can define a custom function that takes in a month in the three-letter format (like Dec) and a day…Read more →Categories: Bricks, ProTags: Conditions, Dynamic Data