Would you like to display the total number of posts on your WordPress website?

Showing the total number of articles can help you highlight the consistency of your blog and encourage users to search for more content.

In this tutorial, we are going to show you how to easily display the total number of posts on WordPress.

But before, if you have never installed WordPress discover How to install a WordPress blog in 7 steps et How to search, install and activate a WordPress theme on your blog 

Then back to why we are here.

how to display the number of articles on WordPress.png

Method 1: Display the total number of articles using a plugin WordPress

This method is easier and recommended for all users.

The first thing to do is to install and activate the plugin Simple Blog Stats. For more details, see our step-by-step guide to way to install a WordPress plugin.

After activating this WordPress Plugin, you need to access Settings »Simple Blog Stats  to configure the settings for this plugin.

The Simple Blog Stats plugin presents you with useful WordPress statistics like the total number of comments, users, pages and posts. You can easily view these statistics using shortcodes anywhere on your WordPress website.

shortcodes wordpress to display statistics.png

Just copy the shortcode [sbs_posts]and add it to any WordPress shortcode compatible widget.

It will display the total number of posts published on your WordPress website.

number of positions

You can also use [sbs_blog_stats] which will display all the blog statistics, including the total number of articles.

Blog stats

2 method. Manually display the total number of articles on WordPress

This method requires you to add code to your WordPress website. If you haven't already, take a look at our guide on how to create a WordPress plugin.

You must first add this code to the file functions.php of your theme or on one of your plugins.

function bpc_total_posts() {  $total = wp_count_posts()->publish; echo 'Tous les articles: ' . $total; } 

This code simply displays the total number of items each time the template tag bpc_total_postsis called.

Then you have to add <?php bpc_total_posts(); ?>in your theme files where you want to display the total number of articles.

Also read our guide on How to optimize your publications before publishing them

If you do not want to use the php tag, you can create and use a shortcode which does exactly the same thing.

Copy and paste the following code into your theme's functions.php file or plugin to create a shortcode.

function bpc_total_posts () {$ total = wp_count_posts () -> publish; return $ total; } add_shortcode ('total_posts', 'bpc_total_posts');

You can now use the shortcode [total_posts]to display the total number of articles, in articles, pages or widgets.

Discover more How to use shortcodes in WordPress widgets

Now you can view the total number of articles on your blog.

Discover also some premium WordPress plugins  

You can use other WordPress plugins to give a modern appearance and to optimize the handling of your blog or website.

We offer you here some premium WordPress plugins that will help you do that.

1. Zxeion

Zxeion is a powerful WordPress Plugin premium responsible for improving the security of your website. This plugin contains a collection of protection and security tools that will protect your website against possible attacks.Zxeion wordpress plugins protect site against malware virus attacks

Its real-time protection system will help you identify threats to your website and block them, without you having to do anything.

Discover also our 7 plugins to boost your sidebars on WordPress

Its features are: real-time protection, excellent customer support, regular updates, IP address blocker, excellent documentation, modern and professional interface, dedicated customer support and others

Download | Demo | Web hosting

2. Slaido 

Slaido is a WordPress Plugin premium which allows you to choose from nearly 320 responsive slider templates and import one of them into your website in just a few clicks. It's a complete pack of templates, perfect for slider Revolution. So you will first have to install the latter to fully use this WordPress pluginSlaido template pack for slider revolution wordpress

Its main features are: a responsive layout of its sliders, the ease of importing or exporting sliders, regular updates, customer support available 24/7, fluid and very cool animations, the availability of video tutorials for a quick start, support for Google Fonts, and many more.

Download | Demo | Web hosting

3. Contact Us Form

Contact Us Form is a premium responsive WordPress plugin and a simple tool but rich in customization options that allows you to display a clear and encouraging form, on which your visitors can contact you by leaving their message.

Contact us form wordpress contact form plugin

You will be able to define the necessary fields, choose the best layout of the fields and customize it completely to encourage your customers or visitors to leave their suggestions or messages.

We also invite you to read: 10 WordPress plugins to create and manage a restaurant website

Just set up the e-mail address where you want to receive the messages and use it to grow your business in the most profitable direction.

Download | Demo | Web hosting

Recommended Resources

Find out about other recommended resources to help you build and manage your website.

Conclusion

Here! That's it for this tutorial. We hope this article has helped you learn how to display total post count in WordPress. Feel free to share this article with your friends on your favorite social networks

However, you will also be able to consult our resources, if you need more elements to carry out your projects of creation of Internet sites, by consulting our guide on the WordPress blog creation.

If you have suggestions or remarks, leave them in our section Comments.

...