예제 #1
0
 /**
  * post.php
  */
 public function getPost()
 {
     if (have_posts()) {
         the_post();
         $post = Post::find(get_the_ID());
     }
     if (!isset($post)) {
         return $this->getError();
     }
     return $this->renderPage('post', ['post' => $post]);
 }
 /**
  * single.php
  *
  * @param string $type post | page
  *        Default: post
  */
 public function getSingle($type = 'post')
 {
     if (!have_posts()) {
         return $this->get404();
     }
     the_post();
     $post = Post::find(get_the_ID());
     return $this->renderPage('base/' . $type, [$type => $post]);
 }
예제 #3
0
 /**
  * Get the post relaction with the commnet
  *
  * @return Post
  */
 public function getPost()
 {
     return Post::find($this->comment_post_ID);
 }
예제 #4
0
 /**
  *
  * @return Post
  */
 public function getNextPost()
 {
     return Post::find(get_next_post()->ID);
 }