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 610 Bricks code tutorials with BricksLabs Pro
Pro How to Add Custom, Conditional Skip Links in BricksHow we can customise the skip links for different templates, so they better match the content on the page.Read more →Categories: Bricks, ProTags: Accessibility, Conditions, Skip Links
Conditional Rendering for Logged in/out Users by CSS Classes in BricksThis tutorial shows how Bricks builder's bricks/element/render filter can be used to conditionally output elements having a class of logged-in to logged-in users only and…Read more →Categories: Bricks, FreeTags: Conditions
Conditionally Hide a Section on a Specific Taxonomy’s Term Archives in BricksA user asked: I have a CTA in the footer of my site, which I have custom fields on various templates, etc to populate. I…Read more →Categories: Bricks, FreeTags: Conditions
Pro Conditional Rendering in Bricks Based on CSS ClassUpdated on 19 Jun 2024 A user asks: Is there a way to apply the same conditions to several elements like we set styles appending…Read more →Categories: Bricks, ProTags: bricks/element/render
Pro Getting Field Values from a Connected CPT when using Meta Box Relationship in BricksConditionally render elements in a single template of a CPT depending on the value of a regular custom field.Read more →Categories: Bricks, Plugins, ProTags: Conditions, Custom Functions, Meta Box
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
Check if a given category has at least one postThere could be situations where you want to check if a given category (by its slug) has at least 1 post assigned to that category.…Read more →Categories: Bricks, FreeTags: Conditions
Pro User Role Conditional Output in BricksThis Pro tutorial provides the steps to output elements based on their CSS class to users of the specified role in WordPress when using Bricks…Read more →Categories: Bricks, ProTags: Conditions
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