$popularpost = new WP_Query(
array(
'post_type' => 'drama',
'showposts' => 10,
'orderby' => 'meta_value_datetime' )
);
while ( $popularpost->have_posts() ) : $popularpost->the_post(); ?>
<?php $listseri = new WP_Query( array( 'showposts' => '3' ,'post_type' =>
'series' ,'meta_key' => 'smoker_episodebaru', 'meta_value' => 'true',
'orderby' => 'smoker_episodebaru','order' => 'DESC', 'meta_key' =>
'smoke_seri', 'meta_value' => $valuez) ); ?>
<?php if ( $listseri->have_posts() ) : while($listseri->have_posts())
 :$listseri->the_post(); ?>
<?php $meta = get_post_meta( get_the_ID(), 'smoke_seri', true ); if 
($meta) : ?><?php echo get_the_title($meta); ?><?php else :?>
<?php endwhile; ?>
<?php else : ?><?php endif; ?>
<?php endwhile; ?>
<?php wp_reset_query(); ?>

I want To making order post_date by post_type that related with first post_type I have Tried This Code Below:

'post_type' => 'drama',
'showposts' => 10,
'meta_key' => $valuez,
'orderby' => 'meta_value_datetime' 

but it doesn’t work
This The Image I Want to make
The post is ordering by Episode post_date ,

Read more here: Order By Another Post Type date (WordPress)


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: