Thread Starter
bojvlc
(@bojvlc)
Ok. Thanks, I’m going to subscribe now.
Thread Starter
bojvlc
(@bojvlc)
I know! Please, when you have this part worked out, tell me here. Thanks for everything.
Thread Starter
bojvlc
(@bojvlc)
Hi, fireproofsocks:
Thanks for your quick answer. I’m going to make more complicated my question.
What if I have more than one ingredient and I want a recipe which has one of those ingredients at least? In other words, how I combine several ‘like’ queries:
$Q = new GetPostsQuery();
$args = array();
$args['post_type'] = 'recipe';
$args['ingredients']['like'] = 'sugar';
$args['ingredients']['like'] = 'honey';
$args['ingredients']['like'] = 'chocolate';
$args['ingredients']['like'] = 'strawberries';
// Set the the 2nd argument argument to "true" to force results to include
// unpublished or otherwise non-standard results
$results = $Q->get_posts($args);
foreach ($results as $r) {
// print stuff here
}