Element Conditions

Bricksforge adds a lot of new Element Conditions to the Bricks Builder. These conditions can be used to show or hide elements based certain conditions. In this page, we will list all the conditions that are added by Bricksforge.

General Conditions

Number of Search Results

This condition can be used to show or hide elements based on the number of search results. As operators, you can use =, !=, >, >=, <, <=. The value expects a number.

Example: Show an element if there are more than 10 search results

Loop Index

This condition can be used to show or hide elements based on the loop index. The loop index is the number of the current query loop iteration. As operators, you can use =, !=, >, >=, <, <=. The value expects a number. Important: The first element in the loop has the index 0.

Example: Never show the first element in the loop

Loop Element ID

This condition can be used to show or hide elements based on the element ID of the current loop iteration. As operators, you can use == and !=. The value expects an element ID with the following format: abcdef. So, if your bricks element ID is #brxe-fkeogf, you have to use fkeogf as value.

Example: Never show the element with the ID fkeogf

Body Class

This condition can be used to show or hide elements based on the body classes. As operators, you can use Includes and Not includes. The value expects a string.

Example: Show an element if the body classes include woocommerce-cart

Plugin Is Active

This condition can be used to show or hide elements based on the active plugins. As operators, you can use Is active and Is not active. The value expects a string in the following format: plugin-folder/plugin-file.php. So, if you want to check if WooCommerce is active, you have to use woocommerce/woocommerce.php as value. You can find the correct value in the plugin folder.

Example: Show an element if WooCommerce is active

Is Multisite

This condition can be used to show or hide elements if you currently are on a multisite installation. As operators, you can use Is. The value expects True or False.

Example: Show an element if you are on a multisite installation

Is Multisite Main

This condition can be used to show or hide elements if you currently are on the main site of a multisite installation. As operators, you can use Is. The value expects True or False.

Example: Show an element if you are on the main site of a multisite installation

Is Multisite Subdomain

This condition can be used to show or hide elements if you currently are on a subdomain of a multisite installation. As operators, you can use Is. The value expects True or False.

Example: Show an element if you are on a subdomain of a multisite installation

Post Conditions

Publishing as been longer than

This condition can be used to show or hide elements based on the publishing date of the current post. You can choose between Minutes, Hours, Days, Weeks, Months and Years. The value expects a number.

Example: Show an element if the post has been published longer than 1 year

Is Parent

This condition can be used to show or hide elements if the current post is a parent post. As operators, you can use Is. The value expects True or False.

Example: Show an element if the current post is a parent post

Is Child

This condition can be used to show or hide elements if the current post is a child post. As operators, you can use Is. The value expects True or False.

Example: Show an element if the current post is a child post

Is Frontpage

This condition can be used to show or hide elements if the current post is the frontpage. As operators, you can use Is. The value expects True or False.

Example: Show an element if the current post is the frontpage

Page Type

This condition can be used to show or hide elements based on the page type of the current post. You can choose between 404, Frontpage, Home, Singular, Archive, Search Results, Attachment, Taxonomy Archive, Date Archive, Author Archive, Custom Post Type, WC Shop, WC Product, WC Product Category, WC Cart, WC Checkout, WC Account, WC Order Received, WC Endpoint.

Example: Show an element if the current post is a WooCommerce product

Post Tag

This condition can be used to show or hide elements based on the tags of the current post. As operators, you can use Includes and Not includes. The value expects a tag name.

Example: Show an element if the current post has the tag news

Post Meta

This condition can be used to show or hide elements based on the meta data of the current post. As operators, you can use Matches and Not matches. The value expects a meta key and a meta value in the following format: meta-key=meta-value. So, if you want to check if the meta key my-key has the value my-value, you have to use my-key:my-value as value.

Example: Show an element if the meta key color has the value red

Comments Open

This condition can be used to show or hide elements if the comments are open for the current post. As operators, you can use Is. The value expects True or False.

Example: Show an element if the comments are open for the current post

Pings Open

This condition can be used to show or hide elements if the pings are open for the current post. As operators, you can use Is. The value expects True or False.

Example: Show an element if the pings are open for the current post

Post Comment Count

This condition can be used to show or hide elements based on the comment count of the current post. As operators, you can use =, !=, >, >=, <, <=. The value expects a number.

Example: Show an element if the current post has more than 10 comments

Is Sticky

This condition can be used to show or hide elements if the current post is sticky. As operators, you can use Is. The value expects True or False.

Example: Show an element if the current post is sticky

Has Excerpt

This condition can be used to show or hide elements if the current post has an excerpt. As operators, you can use Is. The value expects True or False.

Example: Show an element if the current post has an excerpt

Has Post Thumbnail

This condition can be used to show or hide elements if the current post has a post thumbnail. As operators, you can use Is. The value expects True or False.

Example: Show an element if the current post has a post thumbnail

User Conditions

User Meta

This condition can be used to show or hide elements based on the meta data of the current user. As operators, you can use Matches and Not matches. The value expects a meta key and a meta value in the following format: meta-key=meta-value. So, if you want to check if the meta key my-key has the value my-value, you have to use my-key:my-value as value.

Example: Show an element if the meta key premium_user has the value true

User Comment Count

This condition can be used to show or hide elements based on the comment count of the current user. As operators, you can use =, !=, >, >=, <, <=. The value expects a number.

Example: Show an element if the current user has more than 10 comments

Has Profile Picture

This condition can be used to show or hide elements if the current user has a profile picture. As operators, you can use Is. The value expects True or False.

Example: Show an element if the current user has a profile picture

User Post Count

This condition can be used to show or hide elements based on the post count of the current user. As operators, you can use =, !=, >, >=, <, <=. The value expects a number.

Example: Show an element if the current user has more than 10 posts

Date Conditions

Current Day

This condition can be used to show or hide elements based on the current calendar day. As operators, you can use is and is not. As value, you can choose between 1 and 31.

Example: Show an element if the current day is the 1st

Current Month

This condition can be used to show or hide elements based on the current calendar month. As operators, you can use is and is not. As value, you can choose January, February, March, April, May, June, July, August, September, October, November and December.

Example: Show an element if the current month is December

Current Year

This condition can be used to show or hide elements based on the current calendar year. As operators, you can use is and is not. The value expects the year in the following format: 2023.

Example: Show an element if the current year is 2023

Location Conditions

Browser Language

This condition can be used to show or hide elements based on the browser language. As operators, you can use is and is not. The value expects a language code in the following format: en. You can find a list of all language codes here.

Example: Show an element if the browser language is en

Website Language

This condition can be used to show or hide elements based on the website language. As operators, you can use is and is not. The value expects a language code in the following format: en. You can find a list of all language codes here.

Note: Bricksforge will automatically detect WPML, TranslatePress and Polylang and use the language saved by the plugin. As fallback, it will use get_locale().

Country

This condition can be used to show or hide elements based on the country of the current visitor. As operators, you can use is and is not. The value expects a country code in the following format: us.

Example: Show an element if the country of the current visitor is us

Note: Bricksforge will use http://www.geoplugin.net to detect the country of the current visitor.

WooCommerce Conditions

Items In Cart

This condition can be used to show or hide elements based on the number of items in the cart. As operators, you can use =, !=, >, >=, <, <=. The value expects a number.

Example: Show an element if there are more than 10 items in the cart

Product In Cart

This condition can be used to show or hide elements based on the products in the cart. As operators, you can use Is in cart and Is not in cart. The value expects a product ID.

Example: Show an element if the product with the ID 1234 is in the cart

Cart Total

This condition can be used to show or hide elements based on the cart total. As operators, you can use =, !=, >, >=, <, <=. The value expects a number.

Example: Show an element if the cart total is more than 100

Cart Subtotal

This condition can be used to show or hide elements based on the cart subtotal. As operators, you can use =, !=, >, >=, <, <=. The value expects a number.

Example: Show an element if the cart subtotal is more than 100

Product in Stock

This condition can be used to show or hide elements based on the stock status of a product. As operators, you can use Is in stock and Is not in stock. The value expects a product ID.

Example: Show an element if the product with the ID 1234 is in stock

Product Downloadable

This condition can be used to show or hide elements based on the downloadable status of a product. As operators, you can use Is downloadable and Is not downloadable. The value expects a product ID.

Example: Show an element if the product with the ID 1234 is downloadable

Is Purchasable

This condition can be used to show or hide elements based on the purchasable status of a product. As operators, you can use Is purchasable and Is not purchasable. The value expects a product ID.

Example: Show an element if the product with the ID 1234 is purchasable

Product On Sale

This condition can be used to show or hide elements based on the sale status of a product. As operators, you can use Is on sale and Is not on sale. The value expects a product ID.

Example: Show an element if the product with the ID 1234 is on sale

This condition can be used to show or hide elements based on the featured status of a product. As operators, you can use Is featured and Is not featured. The value expects a product ID.

Example: Show an element if the product with the ID 1234 is featured

Product Type

This condition can be used to show or hide elements based on the type of a product. As operators, you can use Is and Is not. As value, you can choose between Simple, Grouped, External and Variable.

Example: Show an element if the product is a Simple product

Product Stock

This condition can be used to show or hide elements based on the stock of the current product. As operators, you can use =, !=, >, >=, <, <=. The value expects a number

Example: Show an element if the stock of the current product is more than 10

Product Variation Count

This condition can be used to show or hide elements based on the number of variations of the current product. As operators, you can use =, !=, >, >=, <, <=. The value expects a number

Example: Show an element if the current product has more than 10 variations

Product Category

This condition can be used to show or hide elements based on the categories of the current product. As operators, you can use Includes and Not includes. The value expects a category slug.

Example: Show an element if the current product has the category shirts

Product Tag

This condition can be used to show or hide elements based on the tags of the current product. As operators, you can use Includes and Not includes. The value expects a tag slug.

Example: Show an element if the current product has the tag new

Product Price

This condition can be used to show or hide elements based on the price of the current product. As operators, you can use =, !=, >, >=, <, <=. The value expects a number

Example: Show an element if the price of the current product is more than 100

Product Rating

This condition can be used to show or hide elements based on the rating of the current product. As operators, you can use =, !=, >, >=, <, <=. The value expects a number

Example: Show an element if the rating of the current product is more than 4

Product Weight

This condition can be used to show or hide elements based on the weight of the current product. As operators, you can use =, !=, >, >=, <, <=. The value expects a number

Example: Show an element if the weight of the current product is more than 10

Is Product Page

This condition can be used to show or hide elements if the current page is a product page. As operators, you can use Is. The value expects True or False.

Example: Show an element if the current page is a product page

Is Shop Page

This condition can be used to show or hide elements if the current page is the shop page. As operators, you can use Is. The value expects True or False.

Example: Show an element if the current page is the shop page

Is Cart Page

This condition can be used to show or hide elements if the current page is the cart page. As operators, you can use Is. The value expects True or False.

Example: Show an element if the current page is the cart page

Is Checkout Page

This condition can be used to show or hide elements if the current page is the checkout page. As operators, you can use Is. The value expects True or False.

Example: Show an element if the current page is the checkout page

Is Account Page

This condition can be used to show or hide elements if the current page is the account page. As operators, you can use Is. The value expects True or False.

Example: Show an element if the current page is the account page

User has purchased product

This condition can be used to show or hide elements if the current user has purchased a product. As operators, you can use Has purchased and Has not purchased. The value expects a product ID.

Example: Show an element if the current user has purchased the product with the ID 1234

User Order Count

This condition can be used to show or hide elements based on the order count of the current user. As operators, you can use =, !=, >, >=, <, <=. The value expects a number.

Example: Show an element if the current user has more than 10 orders

User Total Spend

This condition can be used to show or hide elements based on the total spend of the current user. As operators, you can use =, !=, >, >=, <, <=. The value expects a number.

Example: Show an element if the current user has spent more than 100

User Last Order (Day ago)

This condition can be used to show or hide elements based on the last order of the current user. As operators, you can use =, !=, >, >=, <, <=. The value expects a number.

Example: Show an element if the last order of the current user was more than 10 days ago