19th Mar '23/2 commentsCondition to Check if the Current Category Has At Least One ChildSridhar Katakam Looking to render an element in the category archive Bricks template only if the category of the current category archive page is a parent? This Pro tutorial shows how. Add the following in child theme's functions.php (w/o the opening PHP tag) or a code snippets plugin: This is a BricksLabs Pro tutorial. For full access login below or create your BricksLabs Pro account Username Password Remember Me Forgot Password Tagged: BricksDynamic DataProWordPressSridhar 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
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
Conditionally Hide a Section on a Specific Taxonomy’s Term Archives in BricksA user asked: I have a CTA in the footer of my site, which I have custom fields on various templates, etc to populate. I…Read more →Categories: Bricks, FreeTags: Conditions
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 Conditional Rendering Based On Meta Box Group’s Sub FieldThis Pro tutorial shows how we can output an element on a single post pages only if a specified sub-field (custom field created using Meta…Read more →Categories: Bricks, Plugins, ProTags: bricks/element/render, Conditions
Dynamic Data :value filter in BricksBricks 1.5.7 introduced a new :value dynamic data filter. This tutorial provides a practical example of how this filter can be used. Meta Box Checkbox…Read more →Categories: Bricks, FreeTags: Dynamic Data
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 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
Pro Bricks Dynamic Data Tag for Text-type Custom Field Value with Word LimitHow to register a new dynamic tag for setting excerpt word limits and outputting an ellipsis (...) at the end.Read more →Categories: Bricks, Plugins, ProTags: ACF, Dynamic Data, Meta Box