-
Notifications
You must be signed in to change notification settings - Fork 218
Expand file tree
/
Copy pathpage.php
More file actions
executable file
·77 lines (77 loc) · 3.45 KB
/
page.php
File metadata and controls
executable file
·77 lines (77 loc) · 3.45 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
<?php
/**
* The template for displaying all single page
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-page
*
* @package Design_Scuole_Italia
*/
get_header();
?>
<main id="main-container" class="main-container redbrown">
<?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");
?>
<?php if(has_post_thumbnail($post)){ ?>
<section class="section bg-white article-title">
<?php
$attachment_id = get_post_thumbnail_id(); // Get the featured image ID
$didascalia = wp_get_attachment_caption($attachment_id);
$alt_text = get_post_meta($attachment_id, '_wp_attachment_image_alt', true);
?>
<div class="title-img d-flex align-items-end" <?php if ($image_url) { ?>style="background-image: url('<?php echo $image_url; ?>');" <?php } ?><?php if ($alt_text) { ?> role="img" aria-label="<?php echo $alt_text ?>" <?php } ?>><?php if ($didascalia) { ?><div class="w-100 p-4 bg-black text-white"><?php echo $didascalia; ?></div><?php } ?></div>
<?php
$colsize = 6;
}else{
?>
<section class="section bg-white article-title article-title-small" style="height:auto">
<?php
$colsize = 12;
} ?>
<div class="container">
<div class="row variable-gutters">
<div class="col-md-<?php echo $colsize; ?>">
<div class="title-content">
<h1><?php the_title(); ?></h1>
<?php
$badgeclass = "badge-outline-redbrown";
get_template_part("template-parts/common/badges-argomenti"); ?>
</div><!-- /title-content -->
</div><!-- /col -->
</div><!-- /row -->
</div><!-- /container -->
</section><!-- /section -->
<section class="section bg-white">
<div class="container container-border-top">
<div class="row variable-gutters">
<div class="col-lg-12 col-md-12">
<article class="article-wrapper pt-4">
<div class="row variable-gutters">
<div class="col-lg-12 d-flex justify-content-end pb-2">
<?php get_template_part("template-parts/single/actions"); ?>
</div><!-- /col-lg-12 -->
</div><!-- /row -->
<div class="row variable-gutters">
<div class="col-lg-12">
<div class="col-lg-12 px-0 wysiwig-text">
<?php the_content(); ?>
</div>
</div><!-- /col -->
</div><!-- /row -->
<div class="row variable-gutters">
<div class="col-lg-12">
<?php get_template_part( "template-parts/single/bottom" ); ?>
</div><!-- /col -->
</div><!-- /row -->
</article>
</div><!-- /col -->
</div><!-- /row -->
</div><!-- /container -->
</section>
<?php
endwhile; // End of the loop. ?>
</main><!-- #main -->
<?php
get_footer();