/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $numeroposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE (post_status = 'publish' AND post_type = 'custom-post-type')"); // reemplazar "custom-post-type" por el slug del custom post type seleccionado echo $numeroposts; ?>