【发布时间】:2021-07-07 21:37:03
【问题描述】:
好的,所以我知道如何回显帖子的 meta_key 值:
<?php
$meta_print_value=get_post_meta(get_the_ID(),'_heart_this',true);
echo($meta_print_value);
?>
我也知道如何用这个特定的 meta_key 回显所有帖子:
<?php $query = new WP_Query( array( 'meta_key' => '_heart_this' ) )
echo $query->found_posts; ?>
我需要的是帖子作者的此 meta_key 的帖子总数。
我知道我需要在上面的代码中添加get_the_author() 以仅显示帖子作者的帖子总数,但现在挣扎了一段时间。
任何帮助将不胜感激。
【问题讨论】: