File: //proc/thread-self/root/home/awaldron/www/archive/mg/application/models/wordpress_model.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
*
*/
class Wordpress_model extends CI_Model {
public function getPosts() {
$this->db->select("post_title as title, post_content as content, post_date as date, post_name as name, post_excerpt as excerpt, p.ID as id");
$this->db->from("wp_posts p");
//$this->db->where('t.slug', $slug);
$this->db->where('p.post_status', "publish");
$this->db->where('p.post_type', "post");
$this->db->order_by('p.post_date', 'desc');
$this->db->limit(2);
$query = rset($this->db->get());
if (is_array($query)) return $query;
else return false;
}
}
//$this->db->select();
//$this->db->from();
//$this->db->where();
//$this->db->join();
//$this->db->insert();
/* End of file */
/* Location: ./ */