Exemple #1
0
 /**
  * Load all articles
  *
  * @access public
  * @return void
  */
 public static function load()
 {
     $args = ['post_type' => 'post'];
     $query = new \WP_Query($args);
     $result = [];
     foreach ($query->posts as $postData) {
         $article = new Article();
         $result[] = $article->populate($postData);
     }
     return $result;
 }
Exemple #2
0
 /**
  * Single blog page view
  *
  * @access public
  * @return void
  */
 public function single()
 {
     the_post();
     $post = get_post();
     $this->data["article"] = Article::find($post->ID);
     $this->render("blog/single", $this->data);
 }