56 lines
1.0 KiB
PHP
56 lines
1.0 KiB
PHP
<?php
|
|
/*
|
|
Template Name: Archives
|
|
*/
|
|
get_header(); ?>
|
|
<h3>Archives:</h3>
|
|
|
|
<!--
|
|
<section class="archive-year">
|
|
<?php //wp_get_archives('type=yearly'); ?>
|
|
</section>
|
|
-->
|
|
<?php
|
|
// the query
|
|
$wpb_all_query = new WP_Query(array('post_type'=>'post', 'post_status'=>'publish', 'posts_per_page'=>-1)); ?>
|
|
|
|
|
|
<?php while ( $wpb_all_query->have_posts() ) : $wpb_all_query->the_post(); ?>
|
|
|
|
|
|
<?php
|
|
$arc = get_the_title();
|
|
|
|
if ( strcmp( $arc ,"Archives") ) {
|
|
echo "
|
|
<article>
|
|
<a href=" . get_the_permalink() . ">
|
|
<h3>" . get_the_title() . "</h3></a>
|
|
" . get_the_excerpt();
|
|
}
|
|
?>
|
|
|
|
<footer>
|
|
<?php
|
|
$categories = get_the_category();
|
|
if ( ! empty( $categories ) ) {
|
|
$art_cat_link = esc_url( get_category_link( $categories[0]->term_id ));
|
|
$art_cat_name = esc_html( $categories[0]->name );
|
|
$art_permalink = get_the_permalink();
|
|
$post_date = get_the_date( 'j F o' );
|
|
|
|
echo "
|
|
<span>$post_date</span>
|
|
<a href='". $art_permalink ."'>
|
|
<span class='dtlink'>Lire la suite</span>
|
|
</a>";
|
|
} ?>
|
|
|
|
</footer>
|
|
</article>
|
|
|
|
<br>
|
|
<br>
|
|
<?php endwhile; ?>
|
|
<?php get_footer(); ?>
|