/** * 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]); }
/** * Get the post relaction with the commnet * * @return Post */ public function getPost() { return Post::find($this->comment_post_ID); }
/** * * @return Post */ public function getNextPost() { return Post::find(get_next_post()->ID); }