How to display the Post count one less than it really is (1 post)

  1. perthmetro
    Posted 6 years ago #

    Is there a way to make the post count 1 less than it really is?


    <!-- Get number of posts -->                     
                    <?php foreach((get_the_category()) as $category) {
    					if ($category->count == 1){
    					//if there is only one post in the category
    					echo $category->category_count, " propriété dans";
    					}else if ($category->count > 1){
    					//if there is more than one post in this category
    					echo $category->category_count, " propriétés dans";
    					//if there is no post in this category
    					echo "aucune propriété dans";
    				} ?>
                    <!-- Show Category name -->
                    <?php single_cat_title(); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic