General Conditions

BricksExtras adds optional additional conditions in Bricks builder for rendering (outputting) elements conditionally/dynamically depending on different criteria.

All the conditions are disabled by default and users can enable the ones they would like to use thus following our modular philosophy. Find the ‘Conditions’ tab inside the BricksExtras settings.

Note: This page covers General conditions. We have separate doc pages for Membership conditions and WooCommerce conditions.

Table of Contents

Archive type

Render elements depending on the type of archive page being viewed on the frontend.

View: Designed for use in a template that applies to more than 1 type of archive.

Operators: is, is not

At least one search result

Render elements depending on whether there is at least 1 search result or not.

View: Designed for use in search results template.

Operator: is

Authored by logged-in user

Render elements depending on whether the currently logged-in user is the author of the singular page being viewed on the front end.

View: Singular pages of any post type (like page, post, CPT). Also works in query loops.

Operator: is

Author has CPT entry

Render elements depending on whether the current user has published at least one published entry (post) of the selected custom post type.

Operators: ==, !=

Body classes

Render elements depending on whether the supplied body class is in the list of body element’s classes for the page.

Operators: include, do not include

Category archive

Render elements depending on whether a category archive page being viewed on the front end is that of the selected category.

View: Designed for use in a template that applies to category archives.

Operators: ==, !=

CPT has at least 1 published entry

Render elements depending on whether the selected custom post type has at least one published entry (post).

Current day of month

Render elements depending on whether the current day’s number matches the selected number (1 – 31).

Defaults to the current day’s number.

Operators: is, is not

Current month

Render elements depending on whether the current month matches the selected month (January – December).

Defaults to the current month.

Operators: is, is not

Current year

Render elements depending on whether the current year matches the entered year (number).

Defaults to the current year.

Operators: is, is not.

Current taxonomy term has child

(v1.5.1+) Render elements depending on whether the current taxonomy term being viewed (on the archive page) has child elements.

Defaults to true.

Operators: ‘==’

Date field value

Render elements on singular pages or in the query loop depending on whether the selected Date-type custom field for the current post is in the past or is today or is in the future.

Ex.:

Tested with ACF and Meta Box.

Operators: is in the past, is today, is in the future (default).

For ACF users: Display format and Return format do not matter.

For Meta Box users: Do NOT save the value as timestamp.

Datetime field value

Render elements on singular pages or in the query loop depending on whether the selected Date time-type custom field for the current post is in the past or is in the future.

Tested with ACF and Meta Box.

Operators: is in the past, is in the future (default).

For ACF users: Display format and Return format do not matter.

For Meta Box users: Do NOT save the value as timestamp.

Has child category

Render elements on category archive pages depending on whether the current category has at least one child category i.e, whether the current category is a parent or not.

Has custom excerpt

Render elements on posts depending on whether the current post has a custom excerpt set.

View: Singular pages of any post type (like pagepost, CPT) that has support for excerpts enabled. Also works in query loops.

Operators: is, is not

Has post content

Render elements on posts (of any post type) depending on whether the current post has any content in the WordPress editor.

View: Singular pages of any post type (like pagepost, CPT). Also works in query loops.

Operators: is, is not

Is child

Render elements depending on whether the current single page (of any hierarchical post type) is a child of another.

View: Designed for use in singular pages or a template that applies to static Pages or any other post type that is hierarchical.

Operator: ==

Is parent

Render elements depending on whether the current single page (of any hierarchical post type) has at least 1 child.

View: Designed for use in singular pages or a template that applies to static Pages or any other post type that is hierarchical.

Operator: ==

Language (Polylang)

Render elements depending on whether the current page’s language as set in Polylang matches the one you select in the condition.

Operators: is, is not

Language (TranslatePress)

Render elements depending on the page’s language when using TranslatePress.

Operators: is, is not

The default value will be the default language set in TranslatePress’ settings.

View: Can be used anywhere.

Language (visitor)

Render elements depending on whether the user’s locale as set in their browser is equal to what is entered in the condition.

View: Can be used anywhere.

The locale code should be entered in the last Value field of the Conditions interface.

The code can be obtained from this page.

You can check your locale by typing navigator.language in your browser’s console and hitting return.

Operators: ==, !=

Language (WPML)

Render elements depending on whether the language of the page being viewed is the one selected in the condition.

View: can be applied on any element sitewide.

(Note that this condition will not appear without the WPML plugin active)

Operators: is, is not

Loop item number

Render elements inside query loops depending on the item number (beginning with 1) in the loop.

By selecting every operator, it is possible output elements every 2nd post for example (you would enter 2 in the Value field in this case).

Operators: ==, !=, >=, <=, >, >=, every

Page type

Render elements depending on whether the current page being viewed on the frontend is a post or Page or homepage or blog posts index or category archive or several other criteria.

Front page: This is for what is displayed at your site’s main URL. If you set a static page for the front page of your site, this function will return true (when the operator is is) when viewing that page. Otherwise the same as the Posts page a.k.a. Blog posts index.

Posts page (blog): Blog posts index.

Static Page: Any single Page (i.e, a post of the page post type).

Single post: A single post (of the post post type).

Singular: post of any post type.

Single: post of any post type, except attachments and pages.

Archive: Any archive page.

Category archive: Any category archive page.

Tag archive: Any tag archive page.

Search results: Search results pages.

Author archive: Any Author archive page.

Taxonomy archive: Archive page of any custom taxonomy.

404: Any 404 Error / Page Not Found page.

Date archive: Any date archive page.

Note: WooCommerce-specific options will only appear if WooCommerce is active.

WooCommerce: A page which uses WooCommerce templates (cart and checkout are standard pages with shortcodes and thus are not included).

WC Shop: The main WooCommerce Shop page.

WC Product category: Any WooCommerce product category archive page.

WC Product tag: Any WooCommerce product tag archive page.

WC Single product: Any WooCommerce product page.

WC Cart: WooCommerce Cart page.

WC Checkout: WooCommerce Checkout page.

WC Account: WooCommerce Account page.

WC Endpoint: Any WooCommerce Endpoint page.

WC Order Pay … WC Add payment method: Other WooCommerce endpoint pages. Reference.

Operators: is, is not

Post ancestor (v1.4.1+)

Render elements depending on whether the post has an ancestor matching the given ID. Similar to ‘post parent’ but includes searching for grandparent and further up.

Operators: includes, does not include

Post category

Render elements depending on whether the single post page being viewed on the front end has the selected category assigned to it.

You may read this condition as “Is this post in this category?”.

View: Designed for use in a template that applies to single posts.

Operators: ==, !=

Post comment count

Render elements based on the result of comparing the number of comments with the inputted number.

View: Designed for use in single Post template or templates of other post types that have comments support.

Operators: ==, !=, >=, <=, >, >=

Page parent

Bricks includes a Post parent condition that enables us to conditionally render elements if the current post is a child of another post specified by its ID.

Our condition is similar but with two differences:

  1. It is limited to the page post type i.e., the regular static Pages
  2. It lists titles of all the parent Pages in the Value dropdown – meaning you don’t need to look for the ID and type/paste it in

Operators: is, is not

Post publish date

Render elements depending on whether the current post’s publish date is in the past or today.

View: Single post pages and/or in query loops anywhere.

Operator: is

Post tag

Render elements depending on whether the single post page being viewed on the front end has the selected tag assigned to it.

You may read this condition as “Does the current post have this tag assigned?”.

View: Designed for use in a template that applies to single posts.

Operators: ==, !=

Post type (v1.4.1+)

Render elements depending on if the current viewed post is a specific post type. Useful for when using the template for multiple post types, or inside query loops that may contain multiple post types.

Operators: ==, !=

Published during the last

Render elements on posts on single post pages or in query loops depending on whether the date on which post was published is within the last day or month or week or year.

[Update – will add support for all post types in next update.]

Operators: ==, !=

Tag archive

Render elements depending on whether a tag archive page being viewed on the front end is that of the selected tag.

View: Designed for use in a template that applies to tag archives.

Operators: ==, !=