diff --git a/functions.php b/functions.php index d502ec17e259f8b96f58365f512e7e652ccf912d..101f514c783f1922dac510c80be92a1875eed001 100644 --- a/functions.php +++ b/functions.php @@ -803,11 +803,12 @@ add_action('wp_ajax_hankin_like', 'hankin_like'); // 获取点赞总数量 function count_post_meta($key){ global $wpdb; + global $table_prefix; $sql = "SELECT count(*) as total, SUM(meta_value) as count FROM - wp_postmeta + ".$table_prefix."postmeta WHERE `meta_key` = '".$key."'"; $res = $wpdb->get_row($sql,ARRAY_A);