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
版权声明:本文标题:query - order one custom post type by modified time of another post type 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744621654a2616063.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论