admin管理员组

文章数量:1389903

i have post type name series and another name episodes in the homepage i show the series but rank them based on the one that has an episode added to it by time

this is the original code which is only showing by updated for series

    <?php 
        $wpquery = new WP_Query(array(
                "post_type"  => "series",
                "showposts"     => $lm,
                "ignore_sticky_posts" => 1,
                "no_found_rows"  => true,
                "update_post_term_cache" => false,
                "update_post_meta_cache" => false,
                "cache_results" => false,
                "orderby" => "modified"
            )); while($wpquery->have_posts()) : $wpquery->the_post();
            get_template_part('series');
        endwhile; ?>

i tried this

    <?php 
        $wpquery = new WP_Query(array(
                "post_type"  => "series",
                "showposts"     => $lm,
                "ignore_sticky_posts" => 1,
                "no_found_rows"  => true,
                "update_post_term_cache" => false,
                "update_post_meta_cache" => false,
                "cache_results" => false,
                'orderby' => array(
                        "post_type" => 'epsiode',   // taxonomy name
                        "orderby" => "modified",
                )
            )); while($wpquery->have_posts()) : $wpquery->the_post();
            get_template_part('series');
        endwhile; ?>

but did not work please help

本文标签: queryorder one custom post type by modified time of another post type