This members-only tutorial is similar to Other Posts in the same category while excluding the current post in Oxygen with the difference being that this one is for Custom Post Type and a Custom Taxonomy instead of the standard posts and categories.

We shall use pre_get_posts to filter the posts of a Repeater that has been set to show 5 entries of a project CPT when viewing singular pages of the CPT such that

  1. only the ones in the same custom taxonomy, project_category as the current entry appear AND
  2. the current entry being viewed is not included.

Step 1

Create (if not present) and edit the Template that applies to your CPT's singular view.

Below the Inner Content component that shows your entry's content, add a Repeater having this manual query:

post_type=project&posts_per_page=5&no_found_rows=true

Replace project with your CPT's name.

Configure the Repeater's Div as needed by showing say, the post title linking to permalink.

To show the entry's taxonomy terms, a Text component can be added and its default text replaced with

Terms: [oxygen data='terms' taxonomy='project_category' separator=', ']

where project_category is the taxonomy name.

Step 2

Add a Code Block above the 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: