In the past we wrote about Other Posts in the same category while excluding the current post in Oxygen and Related entries based on taxonomy in Oxygen that showed how to output posts or Custom Post Type items assigned to the same term(s) as the current single post being viewed.
Oxygen's advanced query option means it has been possible to do this w/o writing any code for some time now.
This members-only tutorial provides the steps for setting up advanced query type to output posts of a
project CPT that have the same
project_type (a custom taxonomy) as the current single project when viewing a singular project page whilst excluding the current project.
For example, let's say there are four published posts titled "Project 1", "Project 2", "Project 3" and "Project 4" with 1, 2 and 4 sharing the same "Design" project type. When viewing Project 2 under a "Related Projects" heading Projects 1 and 4 will appear.
Edit the Template that applies to singular projects with Oxygen.
Add a Section with Heading and Text components for showing the post title and content.
Add another Section having a "Related Projects" heading.
Add a Repeater or an Easy Posts component.
Query → advanced.
Select the "All posts except the current" preset and edit it.
Set it up like this:
This is a premium members-only content.
To view the rest of the content, please sign up for membership ($47/month or $599 one-time).
Already a member? Log in below or here.