-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle.php
More file actions
88 lines (73 loc) · 3.35 KB
/
single.php
File metadata and controls
88 lines (73 loc) · 3.35 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
/*
|--------------------------------------------------------------------------
| Wordpress theme > single.php
|--------------------------------------------------------------------------
*/
# header
get_header();
the_post();
if (has_post_thumbnail()) :
$banner = post_featured_image(array(1920, 380));
?>
<div class="post-banner" style="background-image: url(<?=$banner?>)">
</div>
<?php
endif;
?>
<main class="main">
<div class="container">
<div class="row">
<section class="col-md-8 content">
<article class="post post-single">
<p class="post-category"><?=post_category_name()?></p>
<h3 class="post-title"><?php the_title(); ?></h3>
<div class="post-content">
<?php the_content(); ?>
</div><!-- .post-content -->
<div class="post-meta">
<div class="post-meta-left">
<p class="post-meta-item">Postado em: <?php the_time('d/m/Y') ?></p>
<p class="post-meta-item">Por: <?php the_author() ?></p>
</div><!-- .col-md-6 -->
<div class="post-share">
<div class="share-bar" data-title="<?php the_title() ?>" data-url="<?php the_permalink() ?>" data-image-url="<?=post_featured_image(array(800, 600))?>"></div>
</div><!-- .col-md-6 -->
</div><!-- .post-meta -->
</article><!-- .post -->
<?php $posts = get_posts(array('post__not_in' => array($post->ID), 'posts_per_page' => 3, 'order' => DESC)); ?>
<div class="other-posts">
<div class="row">
<?php
foreach ( $posts as $post ) : setup_postdata( $post ); ?>
<div class="col-sm-4 other-post">
<a href="<?php the_permalink(); ?>">
<?php
if (has_post_thumbnail()) { ?>
<div class="post-thumb">
<?php the_post_thumbnail(array(285, 160)); ?>
</div>
<?php } ?>
<div class="post-meta-left">
<p class="post-meta-item">Publicado em <?php the_time('d') ?> de <?php the_time('M') ?> de <?php the_time('Y') ?> por <?php the_author() ?></p>
</div><!-- .col-md-6 -->
<h2 class="post-title"><?php the_title(); ?></h2>
</a>
</div>
<?php
endforeach;
wp_reset_postdata();
?>
</div><!-- .row -->
</div><!-- .other-posts -->
<?php comments_template(); ?>
</section><!-- .content -->
<aside class="col-md-4 sidebar">
<?php get_sidebar() ?>
</aside><!-- .sidebar -->
</div><!-- .row -->
</div><!-- .container -->
</main><!-- .main -->
<?php
# footer
get_footer();