-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patharchives.php
41 lines (40 loc) · 1.48 KB
/
archives.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
<?php get_header(); ?>
<div id="main">
<div id="content" class="container">
<!-- archives.php -->
<h1><?php echo $post->post_name;?></h1>
<?php if (function_exists('dimox_breadcrumbs')) dimox_breadcrumbs(); ?>
<div class="row">
<div class="col-sm-3">
<?php get_sidebar(); ?>
</div>
<div class="col-sm-9 grid">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="col-sm-6 grid-item">
<?php
$categories = get_the_category();
$separator = ', ';
$output = '';
if($categories){
foreach($categories as $category) {
$output .= '<a href="'.get_category_link( $category->term_id ).'" title="'.esc_attr( sprintf( __( "View all posts in %s" ), $category->name)).'">'.$category->cat_name.'</a>'.$separator;
}
}
?>
<article>
<header>
<h2><a href="<?php echo get_permalink(); ?>"><?php echo get_the_title(); ?></a></h2>
<span class="news-post-category"><?php echo trim($output, $separator).' - '.get_the_time('F jS, Y'); ?></span>
</header>
<p><?php the_post_thumbnail( ); ?></p>
<p><?php the_content(__('(more...)')); ?></p>
<p><?php comments_template( $file, $separate_comments ); ?></p>
</article>
</div>
<hr> <?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>