Advanced title and description fields

With these options you can combine or replace more fields to the title and description field. There are two default variables:

  1. {titlefield} - this is the default title value
  2. {descriptionfield} - the default description value

Anything besides these two variables inside "{}" crates is treated as a custom field name. These fields support HTML tags as well.

Simple usage examples

Example 1: You have a custom field called 'location', which holds the location name for each post, and you want to display it before the description, separated by comma.

The simplest solution would be:

{location}, {descriptionfield}

You can use HTML tags in this field as well, so let's display the location in bold letters:

<strong>{location}</strong>, {descriptionfield}

Example 2: You have WooCommerce installed and you want to output the title in the following format: "Product name - 10$"

In this case the _price custom field holds the price of a product. Then simply try the following input in the Advanced title field:

{titlefield} - {_price}

Note, that you don't need the currency symbol, the plugin will automatically detect and display it along with the formatted price! (only works with WooCommerce)

Equivalently, as in the previous example, displaying the price in strong letters:

{titlefield} - <strong>{_price}</strong>

Conditional bracket examples

Only available since version 4.11

Conditional brackets are used to display custom fields, only if they have values, simple as that. If the fields in the conditional brackets does not have value or does not exist, then everything in the bracket is ignored.

Syntax

[text 1 {field1} text 2 {field2} ..text n {fieldN}..]

..where {field1} to {fieldN} is replaced with their values, and the text between the fields is displayed as it is. HTML is supported. If any of the fields is empty or does not exist, then nothing from the brackets is displayed. This becomes especially handy, if the custom fields are only set on some of the post type objects.

Examples

Example 1

You have WooCommerce and want to display some text and the price in the title, but some items does not have prices. Like so: Item title - Price: 10.0$

You need to use conditional brackets, as you don't want to display the '- Price' text if there is no price set:

{titlefield}[ - Price: {_price}]

This will result in:

Example 2

You have WooCommerce and want to display some text and the sale price, if not on sale, then the regular price in the title - but some items does not have prices. Like so: Item title - Now only: 9$ instead of - 10.0$

You need to use conditional brackets, as you don't want to display the '- Price' text if there is no price set:

{titlefield}[ - Now only: {_sale_price} instead of][ - {_regular_price}]

This will result in:

Example 3

This one is the exact one that's used on the property search example as seen on the demo site. We have fields re_property_type, re_price, re_bedrooms, re_bathrooms and re_area custom fields, attached to a real estate custom post type. As the fields name imply, they contain the property type, price, bedrooms and bathrooms count and the area in sq feet.

We use the following Advanced description field code to display those fields:

[<p><strong>{re_property_type}</strong></p>]
[<p>Price: {re_price}$</p>]
[<p>Rooms: {re_bedrooms}</p>]
[<p>Bathrooms: {re_bathrooms}</p>]
[<p>Area: {re_area} (sq feet)</p>]

..which displays as:

results matching ""

    No results matching ""