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

@legmet

Nice snippet!

http://monstracreative.com - themes, plugins and snippets for monstra cms

:: ATTENTION ::
Need help? Login at your account at: http://monstracreative.com/users/login. -> You have a excellent support center at our website! wink

wormsunited's Website