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 634 Bricks code tutorials with BricksLabs Pro
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
Checking for Post Type in BricksA way to output elements conditionally based on the current post type in the loop in Bricks.Read more →Categories: Bricks, FreeTags: Dynamic Data
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 Conditionally outputting an element in a Query Loop based on date-type custom fieldThis Pro tutorial shows how to output an element in a Bricks' query loop only if the value of a date-type of custom field for…Read more →Categories: Bricks, Plugins, ProTags: Conditions, Meta Box
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
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 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 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 Elements only for Posts that have a Specific Taxonomy TermUsing the core WordPress has_term() function for checking if the current post has a specific term of a given taxonomy.Read more →Categories: Bricks, FreeTags: Dynamic Data