Advanced title and Content fields

Adding custom fields, taxonomy terms, WooCommerce add to cart, star rating, price to the results.

Advanced title and content fields editor is used to add various fields, such as custom field values, taxonomy terms list, WooCommerce Add To cart, Price, Star rating and many different result fields.

The advanced field editors can be found under the Advanced Options -> Content & Fields panel.

Most of these use cases are explained in detail in the video above. For special cases not covered in the video, please read below.

Conditional Brackets

The square brackets aka [ and ] represent a conditional wrapper. Whatever is wrapped within these brackets is considered conditional, meaning:

  • If any of the field values is empty, everything within the conditional is returned as empty

  • You can use any number of fields in the conditionals

  • You can use any text or HTML within the conditionals

Practical example

Say you have a field name "text_field", which may not be assigned to all of the results. You want to display the field value such as:

My field: {field value here}

The issue is, that when a result has no "text_field", the following text will be displayed:

My field:

By using conditionals, you can wrap the field and the preceeding text with the conditional, to avoid printing the "My field:" text when the "text_field" is empty.

Inserting my_rfield
Adding the "My field:" text and the conditional wrappers

Using Shortcodes in Advanced Title or Content Fields

Because the square brackets are used for conditional brackets, using shortcodes is possible via double square brackets.

To use a shortcode [my_shortcode] in the field, the brackets have to be doubled so it becomes [[my_shortcode]]

Using my_shortcode in a paragraph block

<p>[[my_shortcode]]</p>

Using a shortcode with an opening and closing tag

[[shortcode_with_closing_tag]]Shortcode Content[[/shortcode_with_closing_tag]]

Using nested shortcodes within a div element

<div>
[[nested_shortcodes]]
    [[single_shortcode]]
[[/nested_shortcodes]]
</div>

Last updated