先月、このクエリは機能しましたが、今ではこの 3 日間 (新しい月が始まりました)、投稿はまったくありません:
<?php $current_year = date('Y'); ?>
<?php $current_month = date('m'); ?>
<?php endif;
arras_featured_loop( arras_get_option('featured1_display'),
apply_filters('arras_featured1_query', array(
'list' => $featured1_cat,
'taxonomy' => arras_get_option('featured1_tax'),
'query' => array( 'posts_per_page' => 15,
'meta_key' => 'post_views_count',
'orderby' => 'meta_value_num',
'order' => 'DESC',
'year' => $current_year,
'monthnum' => $current_month,
'category_name' => Music,
'posts_per_page' => $featured1_count,
'exclude' => $post_blacklist,
'post_type' => arras_get_option('featured1_posttype')
)
) ) );
?>
あらゆる種類の助けをいただければ幸いです。
アップデート:
これは腹立たしいことではありませんでした。しかし今、プラグインWordpres Popular Postsでこれを行う方法を見つけました.
このコードを使用して、テンプレートで単独で動作します。
<?php
if (function_exists( 'wpp_get_mostpopular' )) {
wpp_get_mostpopular('range=weekly&cat=276&order_by=views&limit=8');
}
?>
今、私がする必要があるのは、このコードをこのテンプレートの下に使用することです:
<?php endif;
arras_featured_loop( arras_get_option('featured1_display'), apply_filters('arras_featured1_query', array(
'list' => $featured1_cat,
'taxonomy' => arras_get_option('featured1_tax'),
'query' => array(
'posts_per_page' => $featured1_count,
'exclude' => $post_blacklist,
'post_type' => arras_get_option('featured1_posttype')
)
) ) );
?>
ここに入れる必要があると思います:
'query' => array(
問題は、クエリを既存のものから「range = weekly」から「range」への矢印を持つクエリに変更する方法がわからないことです => 毎週は機能しませんでした。