Menu Close

Query custom post types and taxonomies

Blocksify Pro lets a Content Loop query custom post types, filter their entries, and show their taxonomies on each card.

You can use the loop on a page or inside a reusable layout described in Dynamic Templates overview.

Before you start: Activate Blocksify Pro and create a custom post type with published entries. This tutorial uses Properties with Property type, City, and Amenity taxonomies, plus a Meta Box Bedrooms field.

Choose the post type and taxonomy

  1. Select the Content Loop block, then open General → Query in the right sidebar.
  2. Set Query source to Custom and Content type to Posts. The Parameters list appears.
  3. Open the Post types token field and select Properties. The loop preview changes from blog posts or pages to property entries.
  4. Click Add parameter, choose Taxonomy filter, then select Property Types.
  5. Under Terms, select Villa. Leave Match at Has any; with one selected term, the loop now shows villas.
The Content Loop Parameters list shows the Properties post type, property_type and city taxonomy rows, and the Property Types panel with Villa selected.

Without Pro, the free Blocksify plugin lists Post and Page under Available, while custom choices are dimmed under Pro version. Blocksify Pro makes suitable custom post types selectable.

Taxonomy row summaries use stored slugs such as property_type, while the Terms picker shows the human label Villa. The Match choice belongs to one taxonomy row: Has any accepts any selected term, while Has all requires every selected term in that row.

Set the Taxonomy relation

  1. Select the Content Loop block and open General → Query.
  2. Click Add parameter and choose another Taxonomy filter if the listing needs a second rule, such as City = Brighton.
  3. Click Add parameter again and choose Taxonomy relation.
  4. Select Match all rows to require both Villa and Brighton, or Match any row to accept an entry that matches either row. The summary adds (AND) or (OR), and the card preview updates to the combined result.
The Taxonomy relation panel shows Match all rows selected for the property_type and city taxonomy rows, and the row summary includes AND.

Note: Taxonomy relation changes how separate taxonomy rows work together. It does not replace the Match choice inside each row.

Add a Meta query row

  1. Select the Content Loop block and open General → Query.
  2. Click Add parameter, choose Meta query, and open the new row.
  3. Under Field, select Bedrooms — Meta Box · number. Choose Custom meta key… only when the field does not appear, then type its exact saved key.
  4. Set Compare to ≥ at least, enter 3 in Value, and set Type to Number. The Type choices are Auto, Number, and Date; the loop now keeps villas with three or more bedrooms.
The Meta query panel shows Bedrooms — Meta Box · number, Compare set to ≥ at least, Value set to 3, the Dynamic value choices, and Number selected from Auto, Number, and Date.

Compare offers these choices:

  • = equals, ≠ not equals, > greater than, ≥ at least, < less than, and ≤ at most.
  • LIKE contains, NOT LIKE, IN (comma list), NOT IN (comma list), and BETWEEN (a,b).
  • EXISTS (has any value) and NOT EXISTS. These two choices do not need a value.

Use the lightning-bolt Dynamic value control when a comparison should follow the page or visitor. Its choices are Current post, Current post author, Logged-in user, and Current archive term; each supplies an ID when the page has that context.

For a plain number such as three bedrooms, keep the static value. See Supported field plugins: ACF/SCF, Meta Box, Pods and Toolset when a custom field is missing from the picker.

Show the taxonomy on each card

  1. Select the Content Loop block, open General → Card, and find Card Elements.
  2. Click Add element, choose Taxonomy, and place the card item in Card Header or another card area.
  3. Open the new Taxonomy row and select Property Types. Blocksify Pro makes the custom taxonomy available in this picker.
  4. Set Link to term archive, Max terms, and Separator as needed. Each visible card now shows its Property Types terms.
The Taxonomy card-item controls show Property Types selected, term-archive links enabled, one maximum term and None as the separator.

The query filter decides which properties appear; the Taxonomy card item only displays terms for each result. For other custom values, start with Dynamic data in the Content Loop.

Publish and test the result

  1. Select the Content Loop block and reopen General → Query.
  2. Confirm that Post types includes Properties, the Taxonomy filter row shows property_type with Villa selected, and Meta query contains Bedrooms ≥ 3.
  3. Click Publish or Update, then open the page on the front end.
  4. Check several cards and their links. Only matching properties should appear, and every card should show its Property Types term.
The Find a Property page shows the filter sidebar on the left and three matching Villa cards with prices, bed, bath and area details, agents, Property type and City on the right.

To let visitors change these restrictions themselves, add a Loop Filter and follow Facet types and fields. The free Content Loop block guide covers the underlying block controls.

If the result is unexpectedly empty, temporarily remove the newest row and check that the remaining cards still match before adding it again.

Was this helpful?

0

Updated