-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcategory.php
More file actions
47 lines (45 loc) · 1.5 KB
/
category.php
File metadata and controls
47 lines (45 loc) · 1.5 KB
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
/**
* The template for displaying Category Archive pages.
*
* @package WordPress
* @subpackage Boilerplate
* @since Boilerplate 1.0
*/
get_header(); ?>
<article id="recent">
<h1><?php single_cat_title(); ?></h1>
<?php $count = 1; ?>
<?php $randomthumb = 0; ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post-excerpt <?php if($count%2 == 0) echo 'second'; ?>">
<a href="<?php the_permalink(); ?>">
<?php if ( has_post_thumbnail() ) {
the_post_thumbnail('frontpage-thumb', array('title' => get_the_title()));
} else {
$thumbnails = array('blue', 'green', 'purple', 'yellow');
?>
<img src="<?php echo bloginfo('template_directory'); ?>/images/thumb_default_<?php echo $thumbnails[$randomthumb]; ?>.png" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" />
<?php
if($randomthumb >= 3){
$randomthumb = 0;
} else {
$randomthumb++;
}
?>
<?php } ?>
</a>
<h3><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<?php the_excerpt(); ?>
</div>
<?php $count++; ?>
<?php endwhile; ?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<nav id="nav-below" class="navigation">
<?php next_posts_link( __( '← Vanhemmat artikkelit', 'boilerplate' ) ); ?>
<?php previous_posts_link( __( 'Uudemmat artikkelit →', 'boilerplate' ) ); ?>
</nav><!-- #nav-below -->
<?php endif; ?>
<div class="clear"></div>
</article>
<?php get_footer(); ?>