In this line you are getting only the count of published items (obviously!!!!):
$published_projects = $count_projects->publish;
You should do something like this:
$count_projects = wp_count_posts( 'apps' );
$published_projects = $count_projects->publish;
$draft_projects = $count_projects->draft;
$total = $published_projects + $draft_projects;
More details and examples in wp_count_posts()
reference.
Related Posts:
- C++ – how to find the length of an integer
- How can I make a PHP counter?
- Counting the posts of a loop (WP_Query)?
- Category and children post count
- Hide the post count behind Post Views (Remove All, Published and Trashed) in Custom Post Type
- How to display 2 equal columns of li based on the count of items in wp_nav_menu divided by 2?
- Show weekly posts statistic in WordPress
- Increasing post view count automatically [duplicate]
- Count number of posts by author in a category
- How we count the user draft posts
- What is the best way to count and display the number of posts?
- Get count of terms with a post and another taxonomy term?
- Get Gravity Forms field values and count how many? [closed]
- Counting posts in custom post type by author
- Show ellipsis (…) only if the number of characters exceeds limit defined in substr
- Get total views of all posts by author
- Count post + add number =
- How to do simple addition to increase favorites count of my wordpress posts
- Count posts published in one particular day: the lighter way
- What is the best way to do this? [closed]
- Search Count WordPress Theme
- How to read out the excerpt length (for if-condition)
- CountPost WordPress Custom Taxonomy
- get the count of table rows
- How to calculate posts number? [closed]
- How make animation increase of number
- Having problems getting the number of plays in a WordPress Playlist from an audio file
- How to show the amount of post that have on the site?
- How to find length of digits in an integer?
- How to count instances of character in SQL Column
- How to mark every 3rd post
- Return only Count from a wp_query request?
- Taxonomy count per Post type
- Total word count for posts by one author
- How to cache a shortcode functions output?
- Count posts or custom post types from last 24 hours (or from today)
- Count singular post views automatically
- taxonomy list display custom post count
- Display the number of published posts for each custom taxonomy term?
- Set font size automatically according to number of words in post
- User Published Post Count
- Custom Post Type Category List & Post Count
- Limit tag word count
- Add character count to custom metabox
- Count posts for each year
- How to change post count in wordpress loop?
- How do I count how many top level categories there are?
- How to get the number of child categories a specific parent category has?
- Check if an array of posts has posts from a specific category
- Count total number of post in foreach loop
- Display posts count in front of the tag, for each tag
- right_now_content_table_end function not working?
- How can I count post views of REST API calls and update them in an ACF field?
- Enumeration Contact form using database table’s numbe of rows [closed]
- Getting the current post number / make posts increment
- User’s total comment count excluding comments on their own posts
- How can I make the loop not count special post formats towards the post count?
- How to use wp_query to post count by search term > group post count by date > convert to json. (ex. result 12-21-2020 – 343)
- There any way to get de percentage of number of post by user and category?
- Get count of custom post tags
- How to update the counter of private pages in the dashboard?
- Count Published & Draft Posts Associated With Each Term
- Word count not accurate – potential bug
- How do I display an image before the first post of the loop when I’m using get_template_part?
- Counting posts with argument without retrieving the posts
- Count Number of Posts in Taxonomy Term in Last 24 Hours
- How to add category post count in main navigation menu [closed]
- How to count the number of archives there are
- Add estimated value for a post according to the number of words
- Counter is skipping post when I still want it visible [closed]
- Single.php Category Post Count
- Display count of new members registered today [closed]
- Post loop count is not in order
- How can i count post from my post type taxonomy
- How can i count the post added in relationship field, theme display
- Show the amount of posts in a tag in a specific category has
- I am trying to get cutom post cout by month of current taxonmy term
- Divide post content in three columns
- Display custom post counts for author , not default posts
- Having a variable based on $post_count increase when i move to the next page of results
- It doesn’t matter if I have more than one comment. get_comments_number still equal to one?
- Show the number of the post
- display post count in archive page that have relation with another taxonomy term
- php loop error for count posts in category
- Count how many posts have a specified tag AND category
- Count time from registration date to today
- Count singular post views automatically
- How to count posts in tags within time limit
- Author.php Page views counter
- Retrieve posts inside foundation tabs and tab-content split by 3 per row
- List Most Read Posts from last 7 days (with custom post type and other meta queries)
- RSS Subscriber count
- Order taxonomy terms by the frequency of use in the last 30 days
- Adding Count Post in Page
- Count words for all posts by all authors
- Count images in post then add class if just one
- Display post count on archive page in reverse order
- Complex Custom Loop with Includes
- How to add portfolio category post count in main navigation menu?
- How do i display the number of images on the “post screen”