-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-home-formater.php
127 lines (104 loc) · 3.23 KB
/
template-home-formater.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?php
/*
* Template Name: Home poleterre
*
* @author epointal
* template for incude events in posts list
* copy of template-home.php where add event in selected post :
* 'post_type' => array('post', 'tribe_events'),
*
* and add sidebar
*/
get_header();
// Description (slogan)
$description = get_bloginfo( 'description', 'display' );
while ( have_posts() ) : the_post();
// get_template_part( 'template-parts/header-content', 'page' );
?>
<div id="breadcrumbs">
<?php if (function_exists('the_breadcrumb')) the_breadcrumb(); ?>
</div>
<div class="site-branding" style="background-image:url(<?php header_image()?>);">
<div>
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<?php
if ( $description || is_customize_preview() ) { ?>
<p class="site-description"><?php echo $description; ?></p>
<?php
}
?>
</div>
</div><!-- .site-branding -->
<div id="content-area" class="wrapper sidebar">
<main id="main" class="site-main" role="main">
<?php
get_template_part( 'template-parts/content', 'page' );
// 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;
?>
<section role="listNews" class="posts">
<?php
/******* WP_QUERY
* Liste des derniers articles (actus)
*/
// $argsListPost = array (
// 'post_type' => array( 'post' ),
// 'post_status' => array( 'publish' ),
// 'order' => 'DESC'
// );
// list_pages($argsListPost, false);
global $post;
$argsListPost = array(
'posts_per_page' => get_option('posts_per_page') ,
'offset' => 0,
'category' => '',
'category_name' => '',
'orderby' => 'date',
'order' => 'DESC',
'include' => '',
'exclude' => '',
'meta_key' => '',
'meta_value' => '',
'post_type' => array('post', 'tribe_events'),
'post_mime_type' => '',
'post_parent' => '',
'author' => '',
'author_name' => '',
'post_status' => 'publish',
'suppress_filters' => true
);
if(current_user_can('read_private_posts')){
$argsListPost['post_status'] = array('publish', 'private');
}
$postsList = get_posts ($argsListPost);
foreach ($postsList as $post) :
setup_postdata( $post );
?>
<div class="post-container">
<?php
if(get_post_type() == "tribe_events"){
get_template_part( 'template-parts/content', 'tribe_events' );
}else{
get_template_part( 'template-parts/content', get_post_format() );
}
?>
</div>
<?php
endforeach;
?>
</section>
<?php
the_posts_navigation();
wp_reset_postdata();
?>
</main><!-- #main -->
<?php
get_sidebar();
?>
</div><!-- #content-area -->
<?php
endwhile; // End of the loop.
// get_sidebar();
get_footer();