Counting the number of posts in custom post type. The wp_count_posts
function has parameter $type
for post type to count, you should use this parameter if you want to get number of jobs
1 | $count_posts = wp_count_posts( 'jobs' )->publish; |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.