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 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
[Function] Current Term Has ChildrenUpdated on 20 Jul 2024 A user asks: I'm working on an archive template for WooCommerce products. I'm trying to hide a section if there…Read more →Categories: Bricks, FreeTags: Conditions, get_term_children
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
Pro Meta Box Relationship in BricksUpdated on 19 Mar 2024 In BricksLabs' Facebook group a user asks: I have a Product (Metabox CPT) that is connected to a Creator (Metabox…Read more →Categories: Bricks, Plugins, ProTags: Conditions, Dynamic Data, Meta Box, Relationship
Pro Checking if the current Page/Post has Children i.e. is a Parent in BricksShows how we can check whether the current Page or Post (of any hierarchical post type) is a parentRead more →Categories: Bricks, ProTags: Conditions
Checking if Repeater/Cloneable Meta Fields Are Empty in BricksCreating a condition to ensure that a section only gets output if at least one row of data is filled in.Read more →Categories: Bricks, Free, PluginsTags: Conditions
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
Pro MemberPress in BricksThis tutorial aims to be a useful resource for using MemberPress in Bricks sites.Read more →Categories: Bricks, Plugins, ProTags: Conditions, Filters, MemberPress
Pro Conditionally Rendering an Element Outside the Loop based on Taxonomy Term in BricksA user asks: Hiding element based on taxonomy I have an element in a footer that I want to hide if a page has a…Read more →Categories: Bricks, ProTags: Dynamic Data