Counting the number of posts (custom post type) Query problems

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

like so:

$count_posts = wp_count_posts( 'jobs' )->publish;

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)