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 630 Bricks code tutorials with BricksLabs Pro
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 How to Insert Element(s) Between Query Loop Posts in BricksUpdate on 16 Aug 2023: Follow this tutorial instead. This Pro tutorial shows how we can insert a Div (or any custom HTML) after nth…Read more →Categories: Bricks, ProTags: Conditions, Dynamic Data, Query Loop
Conditionally Outputting Based on Query Count in BricksUpdate on 22 Sep 2023: There's a much simpler built-in method now. See this post. In the Bricks Facebook group a user asks: Is there…Read more →Categories: Bricks, FreeTags: Conditions, WP_Query
How to conditionally load your scripts based on an ACF fieldThis tutorial provides the PHP codes that can be pasted in order to enqueue your scripts conditionally based on the value of an ACF field…Read more →Categories: Bricks, Free, PluginsTags: ACF, Conditions
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
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
Pro Conditional single post Bricks template based on internal referrer URLHow to automatically select a single post template depending on the page from which the post is accessed.Read more →Categories: Bricks, ProTags: bricks/active_templates
Pro Conditional Related Posts in BricksHow to output a section only if there is at least 1 related post for the current post being viewed.Read more →Categories: Bricks, ProTags: Conditions, Related Posts
Pro Conditional Rendering of ACF Repeater Rows Based on True / False Sub Field in BricksThis Pro tutorial provides the steps to modify a ACF Repeater query loop to only output the rows for which a True / False type…Read more →Categories: Bricks, Plugins, ProTags: ACF Repeater