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