getPosts() 공개 메소드

public getPosts ( ) : Post
리턴 Post
예제 #1
0
파일: Blog.php 프로젝트: stojg/puny
 /**
  *
  * @param  int $limit [description]
  * @return array
  */
 public static function get_posts($limit = false)
 {
     $blog = new Blog('posts/');
     // Get drafted posts as well
     if (User::is_logged_in()) {
         return $blog->getAllPosts($limit);
     }
     return $blog->getPosts($limit);
 }
예제 #2
0
<div class="container-wide">

    <div class="container">

        <div class="row">
            <div class="col-xs-12">
                <?php 
Action::run('theme_pre_content');
?>
            </div>
        </div>

        <div class="row">
            <div class="col-xs-8">
                <?php 
echo Blog::getPosts(3);
?>
            </div>
            <div class="col-xs-4 tags">
                <h3>Tags</h3>
                <?php 
echo Blog::getTags();
?>
            </div>
        </div>

        <div class="row">
            <div class="col-xs-12">
                <?php 
Action::run('theme_post_content');
?>
예제 #3
0
<!DOCTYPE html>
<html lang="en">

<?php 
include 'src/Config.php';
include 'src/Post.php';
include 'src/Bio.php';
include 'src/Blog.php';
include 'src/Header.php';
$blog = new Blog();
$bio = $blog->getBio();
$header = $blog->getHeader();
if (empty($_GET["tag"])) {
    $posts = $blog->getPosts();
} else {
    $p = new Post();
    $posts = $p->getPostsByTag($_GET["tag"]);
}
//var_dump($p);
$actual_link = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
?>

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title><?php