-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblog_list.php
87 lines (71 loc) · 2.38 KB
/
blog_list.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
require_once( "include/page_elements.php" );
/* Short and sweet */
define('WP_USE_THEMES', false);
require('wp-backend/wp-blog-header.php');
http_response_code(200); // override wp
if ( isset( $_GET['id'] ) ) {
$offset = intval( $_GET['id'] );
} else {
$offset = 0;
}
$nPosts = wp_count_posts()->publish;
$nPerPage = 5;
$args = array(
'posts_per_page' => $nPerPage,
'offset' => $offset,
'orderby' => 'date',
);
$posts = get_posts( $args );
?>
<!DOCTYPE html>
<html>
<?php page_head( "LigerBots Blog" ); ?>
<body>
<div id="header-ghost" ></div>
<div class="container-fluid no-side-padding">
<div class="col-xs-12 no-side-padding">
<?php
output_header();
output_navbar();
?>
<div class="row page-body">
<div class="col-md-12 col-md-offset-0 col-sm-10 col-sm-offset-1 col-xs-12">
<div class="row top-spacer"> </div>
<div class="row bottom-margin text-background">
<div class="col-md-10 col-md-offset-1 col-sm-12">
<?php
foreach ($posts as $post)
{
setup_postdata( $post );
echo '<div class="level4-heading">';
the_title();
echo "</div>\n";
echo '<div class="announce-date">';
the_date();
echo "</div>\n";
echo '<div class="blog-content">';
the_content();
echo "</div>\n";
/*echo apply_filters( 'the_content', $page->post_content );*/
echo '<br clear="all" />'. "\n";
}
if ( $offset > 0 ) {
$newid = max( 0, $offset - $nPerPage );
echo '<div class="blog-newer">« <a href="/blog_list.php?id=' . $newid . '">Newer Posts</a></div>';
}
$newid = $offset + $nPerPage;
if ( $newid < $nPosts ) {
echo '<div class="blog-older"><a href="/blog_list.php?id=' . $newid . '">Older Posts</a> »</div>';
}
?>
</div>
</div>
<?php output_footer(); ?>
</div>
</div>
</div>
</div>
<?php page_foot(); ?>
</body>
</html>