Topic: Number of total posts in blog

add to your blog.plugin.php:

     * Get Blog Total Posts number
     *  <code> 
     *      echo Blog::getTotalPosts();
     *  </code>
     * @return string
    public static function getTotalPosts() {

$posts = Pages::$pages->select('[parent="'.Blog::$parent_page_name.'" and status="published"]');

$count = count($posts); 

return  $count;


add to your template:

<?php echo Blog::getTotalPosts(); ?>

it returns total number of published posts in blog

Re: Number of total posts in blog


Nice snippet! - themes, plugins and snippets for monstra cms

Need help? Login at your account at: -> You have a excellent support center at our website! wink