admin管理员组文章数量:1122846
I have two functions for query filter:
function my_query_filter_most_views( $query ) {
$query->set( 'orderby', 'meta_value_num' );
$query->set( 'meta_key', 'entry_views' );
$query->set( 'order', 'DESC' );
}
add_action( 'elementor/query/custom_filter', 'my_query_filter_most_views' );
function my_query_filter_most_views1( $query ) {
$tax_query = array(
array(
'taxonomy' => 'filter',
'field' => 'slug',
'terms' => 'trending',
),
);
$query->set( 'tax_query', $tax_query );
}
add_action( 'elementor/query/custom_filter1', 'my_query_filter_most_views1' );
I want to combine these two functions, query filter as one, through which I want to show posts that have views and also show the posts that may or may not have views but have 'trending' as a term. It is working correctly as separate functions, but I am unable to achieve both when combined.
本文标签: phpShow post in elementor based on views and specific category with query id feature in elementor
版权声明:本文标题:php - Show post in elementor based on views and specific category with query id feature in elementor 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736305261a1932527.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论