-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist-posts.php
47 lines (38 loc) · 1.56 KB
/
list-posts.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
<?php
//Template name: List posts
get_header();
//grab posts
$posts = $C->pagePosts($pagename,0,20);
?>
<h1><?php echo $C->pageTitle(); ?></h1>
<?php if($C->isPageMeta("custom_subtitle")): ?>
<h2><?php echo $C->pageMeta("custom_subtitle"); ?></h2>
<?php endif; ?>
<?php echo $C->pageContent(); ?>
<ul>
<?php if(!empty($posts["posts"])): ?>
<?php foreach($posts["posts"] as $key => $post): ?>
<li>
<a href="<?php echo $C->postLink($post->ID); ?>" title="<?php echo $post->post_excerpt; ?>"><?php echo $C->pageFeatureImage("feature_thumb",false,$post->ID); ?></a>
<h2><a href="<?php echo $C->postLink($post->ID); ?>" title="<?php echo $post->post_excerpt; ?>"><?php echo $post->post_title; ?></a> - <small><?php echo $post->post_created; ?></small></h2>
<p><?php echo $post->post_excerpt; ?> <a href="<?php echo $C->postLink($post->ID); ?>" title="<?php echo $posts->post_excerpt; ?>">Read more</a></p>
</li>
<?php endforeach; ?>
<?php if($posts["paging"]["prev"] || $posts["paging"]["next"]): ?>
<?php wp_reset_postdata(); ?>
<div class="pagination">
<ul>
<?php if($posts["paging"]["prev"]): ?>
<li class="prev"><a href="<?php echo $C->pageLink(get_the_ID()).$posts["paging"]["prev"]; ?>">« Prev</a></li>
<?php endif; ?>
<?php if($posts["paging"]["next"]): ?>
<li class="next"><a href="<?php echo $C->pageLink(get_the_ID()).$posts["paging"]["next"]; ?>">Next »</a></li>
<?php endif; ?>
</ul>
</div>
<?php endif; ?>
<?php else: ?>
<li>Sorry, No <?php echo $C->pageTitle(); ?> found.</li>
<?php endif; ?>
</ul>
<?php get_footer(); ?>