2014-07-04 31 views
0

我想在過去24小時內顯示最受歡迎的分類標準。如何在24小時內顯示最受歡迎的分類標準(Wordpress)

網址是像 在管理員:http://domain.com/wp-admin/edit-tags.php?taxonomy=store&post_type=coupon_type

在直播現場:http://domain.com/store/merchant-name

目前使用此代碼顯示分類

<?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; 
    } 
    } 
?> 

回答

1

分類法不會跟蹤觀看次數。你可以買一個插件,如this plugin - 我從來沒有用過它。或者您可以構建自己的鉤子來跟蹤瞬態中的各個分類法。

需要記住的一件事就是緩存,請確保您沒有使用非常硬的緩存,這樣您就不會捕獲所有的跟蹤數據。