query posts and custom post type with meta key
-
04-11-2019 - |
Question
I'm trying to query all-in-one-event-calendar's custom post type ai1ec_event and normal wordpress posts in a slider on my home page. That works pretty well.
Now I want to query only the posts with the custom field value "teaser", but that returns just normal posts, not the events.
<?php
query_posts( array(
'post_type'=>array('post','ai1ec_event'),
'posts_per_page' => 50,
'meta_query' => array(
array(
'key' => 'teaser',
'value' => 'on'
)
)
);
?>
Even if I leave out the post type query:
<?php
query_posts( array(
'meta_query' => array(
array(
'key' => 'teaser',
'value' => 'on'
)
)
);
?>
it only returns posts, no events.
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange