I've spent all day trying to work out how to do this, and have only advanced a little - and that's mainly in finding methods that DON'T work. Am hoping someone knows something or can see something that I'm missing!
I have two custom post types: Episode and Snippets. Episode holds some info itself but also the display then builds itself using Snippets. I achieve this by both the Episode and all of the Snippets having the same title. So when I view an Episode part of the process is that it looks at all Snippets and displays those which have the same title. Each associated snippet has the same slug as the Episode plus a unique identifying suffix - e.g. '-1', '-2', '-3', etc.
I now need to query the database to find out if an Episode has a particular type of Snippet associated with it. This SHOULD be easy if 'page_title' was a valid entry in $args but it seems that it isn't. (It took me a sizeable chunk of today to realise that!)
The first six characters of the Snippet slug are the same as the Episode slug. But doesn't this mean I need to use a wildcard on the left-hand side of the $arg line? In words, "The first six characters of the slug => Episode_slug".
Can anyone suggest how I can achieve this?
(I don't think it will be particularly helpful but you can see an example of how the two post types work together here.)