-
Notifications
You must be signed in to change notification settings - Fork 216
/
single.php
executable file
·100 lines (89 loc) · 4.39 KB
/
single.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
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
<?php
/**
* The template for displaying all single posts
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
*
* @package Design_Scuole_Italia
*/
global $post, $autore;
$args = ["post", "evento", "circolare"];
$fallback_image_url = get_template_directory_uri() ."/assets/placeholders/placeholder-1280x960.jpg";
get_template_part("template-parts/single/related-posts");
get_header();
?>
<main id="main-container" class="main-container greendark">
<?php get_template_part("template-parts/common/breadcrumb"); ?>
<?php while ( have_posts() ) : the_post();
set_views($post->ID);
$image_url = get_the_post_thumbnail_url($post, "item-gallery");
$autore = get_user_by("ID", $post->post_author);
?>
<?php
if (has_post_thumbnail($post)) { ?>
<section class="section bg-white article-title">
<div class="title-img" style="background-image: url('<?php echo $image_url; ?>');"></div>
<?php
} else { ?>
<section class="section bg-white article-title">
<div class="title-img" style="background-image: url('<?php echo $fallback_image_url; ?>');"></div>
<?php } ?>
<div class="container">
<div class="row variable-gutters">
<div class="col-md-6 article-title-author-container">
<div class="title-content">
<h1><?php the_title(); ?></h1>
</div><!-- /title-content -->
<div class="card card-avatar card-comments">
<div class="card-body p-0">
<?php get_template_part("template-parts/autore/card"); ?>
<?php if(dsi_get_option("show_contatore_commenti", "setup") != "false") { ?>
<?php if ( comments_open() || get_comments_number() ){
?>
<div class="comments ml-auto">
<p><?php echo $post->comment_count; ?></p>
</div><!-- /comments -->
<?php
} ?>
<?php } ?>
</div><!-- /card-body -->
</div><!-- /card card-avatar -->
</div><!-- /col-md-6 -->
</div><!-- /row -->
</div><!-- /container -->
</section>
<section class="section bg-white py-5">
<div class="container">
<div class="row variable-gutters">
<div class="col-lg-3 col-md-4">
<?php get_template_part("template-parts/single/actions"); ?>
<?php get_template_part("template-parts/common/badges-argomenti"); ?>
</div>
<div class="col-lg-9 col-md-8">
<article class="article-wrapper pt-4">
<div class="row variable-gutters">
<div class="col-lg-8 ">
<div class="col-lg-12 px-0 wysiwig-text">
<?php
the_content();
?>
</div>
<?php
//the_post_navigation();
// If comments are open or we have at least one comment, load up the comment template.
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
?>
</div><!-- /col-lg-8 -->
</div><!-- /row -->
</article>
</div><!-- /col-lg-8 -->
</div><!-- /row -->
</div><!-- /container -->
</section>
<?php get_template_part("template-parts/single/more-posts"); ?>
<?php endwhile; // End of the loop. ?>
</main><!-- #main -->
<?php
get_footer();