Blog headlines on homepage
I would like to know how it is possible to show the blog headlines on the homepage of my website. I use the default Fuelcms blog and the content of the homepage are in the views folder. Can someone helping me with this? Thank you.
Comments
$this->load->module_library('blog','fuel_blog'); $posts = $this->fuel_blog->get_recent_posts();
There's a few methods in there to get category posts or by date etc.
$posts = $this->fuel->blog->recent_posts();
How can I load the code in the fuel blog libary? Paste the code in fuel\modules\blog\libraries\Fuel_blog.php ?
http://www.getfuelcms.com/user_guide/parsing
A PHP Error was encountered
Severity: Notice
Message: Undefined property: MY_Loader::$fuel_blog
Filename: views/home.php
Line Number: 64
Fatal error: Call to a member function get_recent_posts() on a non-object in E:\server\xampp\htdocs\fuelfmm\fuel\application\views\home.php on line 64
Change to:
$CI =& get_instance(); $CI->load->module_library('blog','fuel_blog'); $posts = $CI->fuel_blog->get_recent_posts();
You will get a load of info back as those records (IIRC) are tied to record class objects. It's expected.