您可以定义自定义where
如果你的桌子wp_posts
function _20170112( $where ){
$where = $where . \' AND wp_posts.menu_order > 0 \';
return $where;
}
并将您的查询包含在以下内容中:
$args = array(
\'post_type\' => \'page\',
\'post_status\' => \'publish\',
\'meta_key\' => \'tile-home\',
\'meta_value\' => 1,
\'orderby\' => \'menu_order\',
\'order\' => \'ASC\'
);
add_filter( \'posts_where\', \'_20170112\' );
$q = new WP_Query($args);
remove_filter( \'posts_where\', \'_20170112\' );