🏠 Root
/
home
/
artorgp
/
www
/
wp-content
/
themes
/
olorun
/
Editing: page-actualites.php
<?php /** Template Name: Template actualités * * If the user has selected a static page for their homepage, this is what will appear. * Learn more: https://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Base theme developped by Arthur H. * @version 1.0 */ get_header(); while ( have_posts() ) : the_post(); ?> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <?php echo '<h1>'.get_the_title().'</h1>'; ?> <p>Retrouvez l'ensemble de nos actualités sur cette page.</p> <form action="<?php echo site_url() ?>/wp-admin/admin-ajax.php" method="POST" id="filter" class="artistfilter" style="display:none;"> <?php if( $terms = get_terms( 'type', 'orderby=name' ) ) : echo '<select name="filtertype"><option value="">Filtrer par compétences</option>'; foreach ( $terms as $term ) : echo '<option value="' . $term->slug . '">' . $term->name . '</option>'; endforeach; echo '</select>'; endif; ?> <?php if( $terms = get_terms( 'country', 'orderby=name' ) ) : echo '<select name="filtercountry"><option value="">Filtrer par pays</option>'; foreach ( $terms as $term ) : echo '<option value="' . $term->slug . '">' . $term->name . '</option>'; endforeach; echo '</select>'; endif; ?> <input type="hidden" name="filterrole" value="artist"> <button class="txtRight">Rechercher</button> <input type="hidden" name="action" value="artistfilter"> </form> <div id="response"> <?php the_content(); ?> <section id="last-elements" style="display:block;"> <?php $query_posts = array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page'=> 10, 'orderby' => 'date', 'order' => 'DESC', ); $query_posts = new WP_Query($query_posts); $i = 0; if($query_posts->have_posts()): echo '<div class="timeline">'; while ($query_posts->have_posts()) : $query_posts->the_post(); echo '<div class="container '.(($i%2==0)?"left":"right").'">'; echo '<div class="content">'; echo '<a href="'.get_the_permalink().'"><h2>'.get_the_title().'</h2></a>'; echo '<p>'.the_excerpt().'</p>'; echo '</div>'; echo '</div>'; $i++; endwhile; echo '</div>'; endif; wp_reset_query(); ?> </section> </div> <?php endwhile; ?> </main><!-- #main --> </div><!-- #primary --> <?php get_footer(); ?>
Save
Cancel