Showing CPT posts within a single post page of another CPT
-
Hi there. I love AQL and I surely prefer it over the standard query block.
In one project I would like to achieve that AQL renders posts of a certain (custom) post type. Unfortunately, until now I was unable to solve the “quest” and I am wondering if there is anyone who might have a similar setting and made it work.The setting is as follows:
I have two CPT. First one is “services”.
Second CPT is “testimonials” and has one of its meta data/custom fields being (an array of) the services it is related to.
Now, on a single post page of CPT “services” I would like to render posts of CPT “testimonials” which have custom field set to the post id of the currently displayed service. Does this make sense? 🙂
Is there a way to accomplish this? It seems like I need to have access to the current post id (as a variable?) to match it against the custom fields of the 2nd cpt in a custom query.
Any help is greatly appreciated! 🙂
Cheers
The topic ‘Showing CPT posts within a single post page of another CPT’ is closed to new replies.