最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

query - order one custom post type by modified time of another post type

programmeradmin2浏览0评论

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

发布评论

评论列表(0)

  1. 暂无评论