-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsingle.php
More file actions
45 lines (36 loc) · 1.51 KB
/
Copy pathsingle.php
File metadata and controls
45 lines (36 loc) · 1.51 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
<?php get_header(); ?>
<!-- template SINGLE-TEST.PHP -->
<main class="container">
<div class="row">
<div id="contenuti" class="col-md-12">
<!--start loop di Wordpress -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div <?php post_class('articolo'); ?>>
<?php
$url = wp_get_attachment_url( get_post_thumbnail_id($post->ID) ); ?>
<h2 <?php echo 'class="bigtitle" style="background: url('. $url.');"'; ?>>
<?php the_title(); ?></h2>
<?php the_content() ?>
<p><small>Scritto da <strong><?php the_author() ?></strong> il <?php the_time('d F Y'); ?></small>
<?php the_tags(
"<small> | <strong>Tags:</strong> ",
", ",
"</small>"
); ?>
<!-- visualizzo il numero dei commenti -->
<p><strong>Commenti:</strong> <span class="badge"><?php comments_number('0','1','%') ?></span></p>
<!-- Carico il template dei commenti, se non è presente comments.php Wordpress carica un suo template predefinito-->
<?php comments_template(); ?>
</div>
<?php endwhile; else: ?>
<!-- testo visualizzato solo se il loop non trova elementi-->
<div class="articolo">
<h2>Attenzione!</h2>
<p>Nessun elemento trovato</p>
</div>
<?php endif; ?>
<!-- end loop Wordpress -->
</div>
</div>
</main>
<?php get_footer(); ?>