-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle.php
65 lines (47 loc) · 1.5 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
<?php
/**
* The template for displaying all single posts.
*
* @package Sydney
*/
get_header(); ?>
<?php if (get_theme_mod('fullwidth_single')) { //Check if the post needs to be full width
$fullwidth = 'fullwidth';
} else {
$fullwidth = '';
} ?>
<?php do_action('sydney_before_content'); ?>
<?php
//vérification si sidebar présente à droite pour gérer l'espace du main
$col='col-md-12';
if (is_active_sidebar( 'sidebar-1' )){
$col='col-md-9';
}
?>
<div id="primary" class="content-area <?php echo($col); ?> <?php echo $fullwidth; ?>">
<?php sydney_yoast_seo_breadcrumbs(); ?>
<main id="main" class="post-wrap" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php
$type_post=get_post_type();
if($type_post=='post'): //pour 'post' (actualités du blog)
get_template_part( 'content', 'single' );
else: //pour les CPT :'strasbourg_infos' (plus d'infos), 'strasbourg_activites' (ativités du mois) et 'bouton_menu' (accueil)
get_template_part( 'content', 'single2' );
endif;
?>
<?php sydney_post_navigation(); ?>
<?php
// 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;
?>
<?php endwhile; // end of the loop. ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php do_action('sydney_after_content'); ?>
<?php if ( get_theme_mod('fullwidth_single', 0) != 1 ) {
get_sidebar();
} ?>
<?php get_footer(); ?>