Php 如何在24小时内显示浏览次数最多的分类法(Wordpress)
我想展示过去24小时内浏览次数最多的分类法 URL就像 在管理中: 现场: 当前正在使用此代码显示分类Php 如何在24小时内显示浏览次数最多的分类法(Wordpress),php,wordpress,Php,Wordpress,我想展示过去24小时内浏览次数最多的分类法 URL就像 在管理中: 现场: 当前正在使用此代码显示分类 <?php // taxonomies $id = get_the_ID(); foreach ( get_object_taxonomies( get_post_type($id) ) as $taxonomy ) { $terms_list = get_the_term_list( $id, $taxonomy, '', '<span class="tax-
<?php // taxonomies
$id = get_the_ID();
foreach ( get_object_taxonomies( get_post_type($id) ) as $taxonomy ) {
$terms_list = get_the_term_list( $id, $taxonomy, '', '<span class="tax-sep">'.__( ', ', 'twentytwelve' ).'</span>','' );
if ( $terms_list )
{
echo $terms_list;
}
}
?>
不会跟踪分类法的视图数量。你可以买一个插件,比如-我从来没有用过它。或者,您可以构建自己的钩子来跟踪瞬态中的单个分类法
要记住的一件事是缓存,确保您没有使用非常硬的缓存,这样您就不会捕获所有跟踪数据。大多数自定义帖子类型的浏览帖子
“meta_键”=>“视图”
:
Install it in your theme and use taxonomy code format and
get most view taxonomy post using