This members-only tutorial provides the steps to limit the posts output by a Oxygen's Easy Posts or Repeater component on singular entries of another post type to only those that belong to the terms selected using ACF's Taxonomy custom field.

Sample Scenario:

tutor Custom Post Type uses the standard WordPress categories Ex.: Maths, Science, Geography.

Advanced Custom Fields field group has a tutor_category_selector custom field of type Taxonomy set to appear on regular Posts.

When editing a Post, Maths and Science are ticked.

The objective is to show a section on singular posts that shows all the tutors that are filtered by the selected categories.

Step 1

If you have not already, register your CPT using a plugin like CPT UI or otherwise, tick support for categories and add a few entries while setting some categories.

Step 2

Add your field group.

Adding a custom field group having a Taxonomy type of field

Leave the Return Value as Term ID.

Step 3

In your post edit screens, select the taxonomy terms that the current post should be "related to".

Step 4

Edit the Oxygen Template that applies to singular posts.

Add a Section.

Add a Easy Posts or Repeater.

Set to Query to custom (or manual, if you prefer that) and select/set your Post Type and optionally, the Count or posts_per_page.

Add a Code Block above the Easy Posts/Repeater.

PHP & HTML:

This is a premium members-only content.

To view the rest of the content, please sign up for membership ($47/month or $399 one-time).

Already a member? Log in below or here.

Need help implementing a tutorial in your site or want to hire me for custom work?

HIRE ME

Find the article helpful and wish to donate?

DONATE

Comments

You need to be logged in to view and post comments.
Not a member yet? Join here.
magnifiercross
>
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram
%d bloggers like this: