hallo,
ich versuche gerade verzweifelt post_type 'post' mit custom post_type zu sortieren. allerdings wird 'post' immer als letztes ausgegeben und in sich sortiert aber nicht "vermischt" mit den custom post_types. weiss jemand wieso genau das passiert und wie ich den query so gestalten kann das alles zusammen sortiert wird?
PHP
$custom_query = new WP_Query(
array(
'post_type' => array(
'post',
'custom_1',
'custom_2',
),
'meta_key'=>'sticky',
'meta_value'=> 'yes',
'orderby'=> 'title',
'order'=> 'ASC' )
);
if ( $custom_query->have_posts() ):
while( $custom_query->have_posts() ) : $custom_query->the_post();
Alles anzeigen
ausgegeben wird folgendes:
custom_1, title = AAA
custom_2, title = DDD
custom_1, title = GGG
post, title = BBB
post, title = EEE