Topic: Number of total posts in blog

add to your blog.plugin.php:

     * Get Blog Total Posts number
     *      echo Blog::getTotalPosts();
     * @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:

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

wormsunited's Website