wordpress使用笔记

来源:互联网 发布:nodejs怎么执行js文件 编辑:程序博客网 时间:2024/05/16 04:32
使用postviews管理wordpress的访问量
在需要的地方加入代码
 <?php if(function_exists('the_views')) { the_views('views', true); } ?>  
bug:wp-postviews计数最高位有问题
fix:

$output = $prefix.str_replace('%VIEW_COUNT%', number_format_i18n($post_views), $views_options['template']).$postfix;

解决方案,去掉$prefix,把上面那句话改成

$output = str_replace('%VIEW_COUNT%', number_format_i18n($post_views), $views_options['template']).$postfix;

更新数据库的访问数量
update  wp_postmeta set meta_value = 2378
WHERE meta_key = 'views'

0 0
原创粉丝点击