5th Jun '22/0 comments/FavoriteUser 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 525 Bricks code tutorials with BricksLabs Pro
Pro At Least 1 Search Result Condition in BricksRegistering a custom condition to render elements depending on whether there is at least one search result.Read more →Categories: Bricks, ProTags: Conditions, Search Results
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
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 ACF Options Page Custom Field Conditional in BricksThis Pro tutorial shows how we can set an element in Bricks to be output only if the value of a specific custom field on…Read more →Categories: Bricks, Plugins, ProTags: ACF Pro, Conditions, Options page
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 Check If The Latest Post Was Published in The Last X MinutesIn this Pro tutorial we shall define a custom function that takes in the number of minutes as an argument and returns true if there…Read more →Categories: Bricks, ProTags: Conditions
Conditions in Bricks BuilderThe current version of Bricks does not have a built-in Conditions feature but that does not mean we can't set them up manually with custom…Read more →Categories: Bricks, FreeTags: Conditions
Create A Customizable AJAX Add To Cart Button In Bricks BuilderIn Bricks, you can simply create an Add To Cart button from a dynamic data / function {woo_add_to_cart}. This button supports AJAX as well if…Read more →Categories: Bricks, Free, PluginsTags: AJAX, Conditions, WooCommerce
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