Embed Blog Posts on Every Page
Does anybody have some code that I can copy to show the most recent 5 blog posts anywhere on the website, regardless of whether its the News page or not? I want to show this on the footer of every page.
Does the Blog module work just like other modules in the sense that I can use the fuel_model() function right inside the view I want to embed the blog posts in?
Thanks,
Erik
Comments
$posts = $CI->fuel->blog->get_recent_posts(5)
You could also use the fuel_model function but you'll need to specify the "module" parameter like so:
$posts = fuel_model('blog_posts', array('module' => 'blog', 'limit' => 5))
Erik