Hi.
You can use this code:
add_shortcode( 'testimonial_pending_count', 'wpmtst_testimonial_pending_count' );
function wpmtst_testimonial_pending_count( $atts ) {
$args = array(
'post_type' => 'wpm-testimonial',
'post_status' => 'pending',
'posts_per_page' => -1,
);
$testimonials = get_posts( $args );
return count( $testimonials );
}
Then place the shorcode on a page with [testimonial_pending_count]
Hi,
thanks for your support.
I do not know php and so where do I add your code. In which module?
@gverhaeg – you should add that code inside your theme’s functions.php file.
Alternatively, you could create a plugin just for this: https://www.wpbeaverbuilder.com/creating-wordpress-plugin-easier-think/
Thanks,
/Cristian.