Skip to content

Show content per row (If / then)

Not every page of a template needs the same content. With If / then you show one part of the design when a page’s values match your rules, and another part (or nothing) when they don’t:

  • If Price is greater than 100, then show “Free delivery”, else nothing.
  • If Date is in the year 2026, then show the text of Places, else the text of Districts.
  • If Status is equal to full or Seats is less than 1, then show “Sold out”, else the booking button.

If / then is part of the free plugin, for the block editor, Elementor and WPBakery. It works with the properties of the template you are editing, so you find it while you edit a template.

Every rule compares one property of the page’s row with a value. Add as many rules as you need, each joined to the one above with and or or. “And” goes first, as in most programming languages: A and B or C means (A and B) or C. No rules, or no property chosen, shows Else.

Which operators a rule offers depends on the property’s type:

Property type Operators
Text, Textarea, URL, Email and other text is empty, is not empty, is equal to, is not equal to, contains, does not contain, starts with, ends with
Number is empty, is not empty, is equal to, is not equal to, is greater than (or equal to), is less than (or equal to), is between
Date, Date and time (Pro) is empty, is not empty, is on, is in the year, is before, is after, is between, is today, is in the past, is in the future, is within the next … days, is within the last … days
Checkbox (Pro) is checked, is not checked
Item list (Pro) is empty, is not empty, contains the item, has an item containing, has more than … items, has fewer than … items
  • Text is compared without regard to case: Hotel is equal to hotel.
  • Numbers may be written as 1234.5, 1,234.5 or 1.234,5.
  • Dates are written as YYYY-MM-DD, such as 2026-10-31, and compared in the site’s time zone.

Then is shown when the rules match, Else when they don’t. In the block editor and WPBakery each is an area you fill with any blocks or elements, including RowSprout’s own and placeholder tokens. In Elementor, each shows a property, your own text, or (with Elementor Pro) a saved Elementor template; see the If / then widget.

Add the If / then block from the RowSprout category of the inserter. It holds two areas, Then and Else: put any blocks in them.

  • The rules are in the block’s sidebar, under If: choose the property, the operator and the value, and Add rule for the next one.
  • Above the rules, a note tells you what the template’s preview group gets: whether the rules match, so Then is shown, or not. It also warns about a rule whose operator doesn’t fit its property, or a property the template no longer has.
  • The editor shows both areas and marks the one the preview group gets. In the block toolbar, choose Then or Else to see only that one while you work, or Both. This only changes the editor, not the page.

Drag the If / then widget from the RowSprout group. Its rules, Then and Else are in the Content tab, with the preview note at the top, and the Style tab has settings for the text, the links and a different look for Else. See the If / then widget.

Add the If / then element from the RowSprout category. It holds a Then and an Else container: put any elements in them. Edit the If / then element to set its rules under If, each with And / or, Property, Operator, Value and, for is between, a second value under And. The Preview at the top of the edit window says whether the template’s preview group gets Then or Else.

The rules, the comparison and the output are shared by the three editors. A property type of your own add-on can choose how it is compared with the rowsprout_condition_kind filter.