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 632 Bricks code tutorials with BricksLabs Pro
Condition for Checking Current Post Category in BricksHow we conditionally display an element based on the current post's categories.Read more →Categories: Bricks, FreeTags: Conditions
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
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
Checking if the current post has been published within the last x daysConditionally output an element if the current post has been published in the last x number of days.Read more →Categories: Bricks, Free, WordPressTags: Conditions
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
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 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 Checking ‘PublishPress Future’ plugin’s Future Action enabled postsPublishPress Future is a handy plugin for scheduling actions like unpublishing or deleting posts (of any post type) at a specified date and time in…Read more →Categories: Bricks, Plugins, ProTags: PublishPress
Pro Bricks Dynamic Condition – Check if today falls within 5 days before any holiday dateCreating a custom condition that returns true or false depending on whether today falls within 5 days before any holiday dates selected on a Meta…Read more →Categories: Bricks, ProTags: Meta Box