-
Notifications
You must be signed in to change notification settings - Fork 0
/
category.php
58 lines (43 loc) · 1.27 KB
/
category.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
<?php
/*
Template Name: Categorie
*/
get_header() ?>
<div id="container">
<div class="se-pre-con"></div>
<?php
$myposts = query_posts( 'cat=6' );
foreach( $myposts as $post ) : setup_postdata($post);
?>
<?php
$thumb = wp_get_attachment_image_src( get_post_thumbnail_id(), array(400,400));
$url = $thumb['0'];
$num_comments = get_comments_number();
?>
<div class="articleGrid">
<article>
<?php if ( has_post_thumbnail() ) : ?>
<figure>
<a href="<?php the_permalink() ?>" title="<?php the_title() ?>">
<img src="<?php echo $url ?>" alt="Immagine di <?php the_title() ?>">
</a>
</figure>
<?php endif; ?>
<span class="commenti"><b><?php echo $num_comments ?></b></span>
<div class="didascalia">
<?php
foreach((get_the_category()) as $category) {
echo '<span class="' . $category->cat_ID . '">' . $category->cat_name . '</span>';
}
?>
<time datetime="<?php echo get_the_date('Y-m-d'); ?>"><?php echo get_the_date(); ?></time>
<h3><?php the_title() ?></h3>
<p><?php the_excerpt() ?>
</p>
</div>
</article>
</div>
<?php endforeach; ?>
<div class="clearfix"></div> <!-- Clearfix -->
<div class="pagelink"><?php wp_link_pages('pagelink=Page %'); ?></div>
<?php get_footer() ?>