Counting posts and trigger it [closed]

Modify your wpb_total_posts function like bellow:

function wpb_total_posts() { 
    $total = wp_count_posts()->publish;
    if($total == 1){
        echo 'We found', "<strong>" . $total . "</strong>", 'job';
    }elseif($total > 1){
        echo 'We found', "<strong>" . $total . "</strong>", 'jobs';
    }else{
        echo 'No posts found ';
    }
} 

Here I’m first checking if total amount of post is 1 or more and handling singular/plural accordingly. Lastly if there is no post then rendering “No post found”

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