-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle.php
More file actions
executable file
·105 lines (100 loc) · 3.11 KB
/
single.php
File metadata and controls
executable file
·105 lines (100 loc) · 3.11 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php get_header(); ?>
<section class="single-page">
<div class="section-title-area"></div>
<?php
if (have_posts()) {
while (have_posts()) {
the_post();
global $post;
?>
<div id="post-<?php the_ID(); ?>" <?php post_class('page-content'); ?>>
<?php
if (has_post_thumbnail()) {
?>
<div class="image">
<img src="<?php echo get_the_post_thumbnail_url(); ?>" alt="" />
</div>
<?php
}
?>
<div class="content">
<div class="category">
<?php
$categories = wp_get_post_categories($post->ID);
foreach ($categories as $category) {
echo "<a style='margin-right: 15px;' href=" . get_category_link($category) . ">" . get_the_category_by_ID($category) . "</a>";
}
?>
</div>
<div class="title">
<?php the_title(); ?>
</div>
<div class="texts">
<?php
the_content();
wp_link_pages();
?>
</div>
<div class="tags">
<?php
the_tags();
?>
</div>
<div class="meta">
<div class="date"><?php echo get_the_date(); ?></div>
<a href class="comments"><?php comments_number(); ?></a>
<div class="socials">
<a href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>" target="_blank"><i class="fa fa-facebook"></i></a>
<a href="https://twitter.com/intent/tweet?text=<?php the_permalink(); ?>" target="_blank"><i class="fa fa-twitter"></i></a>
<a href="https://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>&media=<?php echo get_the_post_thumbnail_url(); ?>&description=<?php the_title(); ?>" target="_blank"><i class="fa fa-pinterest"></i></a>
</div>
</div>
</div>
</div>
<?php }
} ?>
</section>
<section class="next-prev-posts">
<?php
$previous = get_previous_post();
$next = get_next_post();
if (get_previous_post()) {
?>
<div class="prev-post">
<div class="image">
<?php
if (has_post_thumbnail()) {
?>
<img src="<?php echo get_the_post_thumbnail_url($previous); ?>" alt="" />
<?php } ?>
</div>
<div class="content">
<a href="<?php the_permalink($previous); ?>"><i class="fa fa-angle-double-left"></i>Previous post</a>
<p><?php echo get_the_title($previous) ?></p>
</div>
</div>
<?php
}
if (get_next_post()) {
?>
<div class="next-post">
<div class="content">
<a href="<?php the_permalink($next); ?>">Next post<i class="fa fa-angle-double-right"></i></a>
<p><?php echo get_the_title($next) ?></p>
</div>
<div class="image">
<?php
if (has_post_thumbnail()) {
?>
<img src="<?php echo get_the_post_thumbnail_url($next); ?>" alt="" />
<?php } ?>
</div>
</div>
<?php } ?>
</section>
<?php
if (comments_open() || get_comments_number()) {
comments_template();
}
?>
<?php get_footer(); ?>