wordpress,cos-html-cache静态化后,点击数失效问题的解决方案
程序员文章站
2022-05-07 15:18:03
...
跳至
get_var($strsql); if ($clicks!='') { $clicks = $clicks +1; $strout = $clicks; $strsql = "UPDATE wp_postmeta set meta_value=".$clicks." where meta_key = 'article_clicks' and post_id='".$postid."' "; $wpdb->query($strsql); } else { $strout = "1"; $strsql = "INSERT INTO wp_postmeta(post_id,meta_key,meta_value) VALUES (".$postid.", 'article_clicks', '1') "; $wpdb->query($strsql); } echo $clicks+1; ?>
7. [代码][PHP]代码
点击: 次", }, function(data,status){ if (status ==='success'){ $("#views").text(data); }else{ $("#views").text(); } }); " _ue_custom_node_="true">