<?php
global $wp_query;
$curauth = $wp_query->get_queried_object();
$post_count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = \'" . $curauth->ID . "\' AND post_type = photoshop_tutorial\' AND post_status = \'publish\'");
?>
<p>Post Count: <?php echo $post_count; ?></p>
我已尝试使用此代码(&P);它显示了整个
photoshop_tutorial
帖子很重要,但我想为每个作者的帖子显示,因为我想将其添加到作者页面中。
例如:
史密斯发布<?php $post_count; ?>
photoshop教程
我该怎么做?