Filter by post types query string

Hello

I’ve got sooo close to what i need to do but can’t get past the final hurdle.

Im listing all of my B custom post types on post A by matching a meta_value={{dc:post:title}} so far it works well …

the meta_value={{dc:post:title}} checks my B custom posts for a field value that matches my custom A post types’ title … and inserts them…

meta_value={{dc:post:title}}&post_type=B&meta_query…

This works beautifully… pulls all of my B post types onto my post type A that have its title as a field value

Until i try to sort the order of the posts using a separate custom field value … e.g.

meta_value= {{dc:post:title}}&post_type=bonus&meta_key=bonus_type&orderby=meta_value_num&order=ASC&meta_query…
this works perfectly when i don’t include …meta_value={{dc:post:title}}…however in doing so it of course just pulls in all B post types nicely order.

SO my question is…

can you show me how i can create a looper inside of a looper, or a way of matching field values between post types before then executing orderby= wp_query…

end goal being…

if post type B has a field value that matches the title of post A then list these posts AND/then order by separate custom field value & meta query =

thanks!

Hi Jack,

Thanks for reaching out.
It is not very clear what exactly you are trying to do here. If you want to sort the post with some meta value for the B post type, you need to use meta_value or meta_value_num. I would suggest you go through the following article which may help you.

If that is not the case and you are trying to point out something else, I would suggest you elaborate it bit more with some screenshot or video.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.