-
Notifications
You must be signed in to change notification settings - Fork 0
/
single-news.php
49 lines (45 loc) · 1.52 KB
/
single-news.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
<?php
/**
* Single post template for news items
*
* @package KCSU
* @file single_news.php
* @author Gideon Farrell <[email protected]>
* @license BSD 3-Clause
*/
?>
<div class="container news post">
<header>
<h1><?php the_title(); ?></h1>
<p>Posted <span class="date relative" title="<?php echo get_the_date('c'); ?>"><?php echo get_the_date('Y/m/d H:i:s'); ?></span> by <span class="author"><?php the_author_link(); ?></span></p>
</header>
<hr />
<div class="row">
<div class="span8">
<article>
<?php the_content(); ?>
</article>
</div>
<section class="roll news span4">
<h2>Hot off the press</h2>
<ul class="posts-list news">
<?php
# Need to loop through posts with cat=news
query_posts( array ( 'category_name' => 'news', 'posts_per_page' => 10 ) );
while (have_posts()){
the_post();
echo string_format(
'<li><!-- {id} --><a href="{link}" title="{title}">{title}</a></li>',
array(
'id' => get_the_ID(),
'link' => get_permalink(),
'title' => get_the_title()
)
);
}
wp_reset_query();
?>
</ul>
</section>
</div>
</div>