1. Home
  2. Docs
  3. Divi Query Builder
  4. Content Settings
  5. Post Meta Query (Custom Fields)

Post Meta Query (Custom Fields)

This section appears for post/term/user queries and it is helpful to restrict your query using custom field values. See WP Documentation.

  • Relation:  Relation for the taxonomy query. Use AND if you want all conditions to be true to select the post, OR if you only need one condition to be true.
  • Operator: Operator to use to compare the custom field value(s).
  • Custom Field Name:  Name of the custom field.
  • Custom Field Value: Comma separate string of values. These values will be checked using the operator for each post.

You can create several groups of custom field comparisons to satisfy the condition you want to show the posts.

Let’s say that, for example, you want to show posts that have a value ‘hello’ on a custom field called ‘acf_text’ and a value 4 on a custom field called ‘number’. For this use case, you will select the AND relation, and create two groups of conditions one for acf_text EQUAL  ‘hello’ and another for number EQUAL 4.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

How can we help?