forked from hacklabcbba/Ciudadania-Activa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloop-blog.php
62 lines (54 loc) · 2.18 KB
/
loop-blog.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
59
60
<?php
$img_size = "extralarge";
if ( has_post_thumbnail() ) {
$blog_img = "<figure>".get_the_post_thumbnail($post->ID,$img_size,array('class' => 'img-responsive'))."</figure>";
} else { $blog_img = ""; }
$blog_date = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$blog_date = '<time class="entry-date published" datetime="%1$s">%2$s</time> (última modif. <time class="updated" datetime="%3$s">%4$s</time>)';
}
$blog_date = sprintf( $blog_date,
esc_attr( get_the_date( 'c' ) ),
get_the_date(),
esc_attr( get_the_modified_date( 'c' ) ),
get_the_modified_date()
);
$blog_author = "Por <a href='".get_author_posts_url( get_the_author_meta( 'ID' ) )."'>".get_the_author()."</a>";
$categories_list = get_the_category_list(', ');
$tags_list = get_the_tag_list( ', ', ', ' );
?>
<article id="post-<?php the_ID(); ?>" class="blog-article">
<?php echo $blog_img; ?>
<header class="blog-header">
<h2 class="blog-tit"><a href="<?php the_permalink() ?>" title="Leer artículo completo" rel="bookmark"><?php the_title(); ?></a></h2>
<?php // meta
echo "<div class='blog-meta'>";
if ( $categories_list ) {
printf( '<span class="blog-cat-links">%1$s</span>',
$categories_list
);
}
if ( $tags_list ) {
printf( '<span class="blog-tag-links">%1$s</span>',
$tags_list
);
}
echo " <span class='glyphicon glyphicon-star' aria-hidden='true'></span> ".$blog_date;
echo " <span class='glyphicon glyphicon-star' aria-hidden='true'></span> ".$blog_author;
echo "</div>"; ?>
</header>
<section class="page-desc">
<?php
/* translators: %s: Name of current post */
the_content( 'Continuar leyendo' );
wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfifteen' ) . '</span>',
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
'pagelink' => '<span class="screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>%',
'separator' => '<span class="screen-reader-text">, </span>',
) );
?>
</section>
</article><!-- .row .hentry -->