I tried this way to display NO of post:
<?php
$news_2 = new WP_Query( array ('post_type'=> 'jobs','posts_per_page'=> '10' , 'meta_key' => 'status_for_jobs','meta_value' => '1') );
if ( $news_2->have_posts() ) { while ( $news_2->have_posts() ) { $news_2->the_post();
$count = $news_2->post_count;
?>
<li><h3><a href="https://wordpress.stackexchange.com/questions/139614/<?php the_permalink(); ?>"><?php the_title(); ?></a></h3></li>
<?php } } ?> <?php wp_reset_query(); ?>
if the NO of post = 0 i need to display this :-
<?php
$news_2 = new WP_Query( array ('post_type'=> 'jobs','posts_per_page'=> '10' , 'meta_key' => 'status_for_jobs','meta_value' => '1') );
if ( $news_2->have_posts() ) { while ( $news_2->have_posts() ) { $news_2->the_post();
$count = $news_2->post_count;
if ($count == '0') {
?>
<li><h3><a href="https://wordpress.stackexchange.com/questions/139614/javascript:void(0)">No Post</a></h3></li>
<?php
} else {
?>
<li><h3><a href="https://wordpress.stackexchange.com/questions/139614/<?php the_permalink(); ?>"><?php the_title(); ?></a></h3></li>
<?php } ?>
<?php } } ?> <?php wp_reset_query(); ?>
But instead of the total of posts, I not getting any thing.
Any suggestions to fix this?