Compare commits
No commits in common. "2cfaf89b3f30d1498d71a8048ac3ac09ed6b4d41" and "3237b5325c130cdafeeb42b1b93ba0d650cbb3ae" have entirely different histories.
2cfaf89b3f
...
3237b5325c
4 changed files with 34 additions and 45 deletions
|
@ -1,34 +1,40 @@
|
||||||
<div id="featured-articles">
|
<div id="featured-articles" class="preview-container">
|
||||||
<?php
|
<?php
|
||||||
query_posts(array(
|
query_posts(array(
|
||||||
'post_type' => 'post',
|
'post_type' => 'post',
|
||||||
'tax_query' => array(
|
'tax_query' => array(
|
||||||
array(
|
array(
|
||||||
'taxonomy' => 'category',
|
'taxonomy' => 'niveau',
|
||||||
'terms' => 'blog',
|
'terms' => 'featured',
|
||||||
'field' => 'slug',
|
'field' => 'slug',
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'orderby' => 'date',
|
'orderby' => 'date',
|
||||||
'post_count' => '1',
|
'post_count' => '2',
|
||||||
'order' => 'DESC',
|
'order' => 'DESC'
|
||||||
'posts_per_page' => '1'
|
|
||||||
));
|
));
|
||||||
|
|
||||||
if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
|
if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
|
||||||
|
|
||||||
<div class="card card-primary" id="post-<?php the_ID(); ?>">
|
<article class="preview">
|
||||||
<div class="card-header"><h1><?php the_title(); ?></h1></div>
|
<a href="<?php the_permalink(); ?>" class="preview-link">
|
||||||
<div class="flex-that mb">
|
<div class="preview-item" style="background-image:url('<?php echo get_the_post_thumbnail_url(); ?>');">
|
||||||
<div class="article-category">
|
<div class="preview-overlay">
|
||||||
<?php $category = get_the_category();
|
<div class="preview-categories">
|
||||||
echo"<a href= '" . esc_url( get_category_link( $category[0]->term_id ) ) . "' class='btn-small btn-info'><i class='fa fa-folder'></i> " . $category[0]->cat_name . "</a>"; ?>
|
<?php $category = get_the_category();
|
||||||
</div>
|
echo"<span class='badge badge-category'>" . $category[0]->cat_name . "</span>"; ?>
|
||||||
<time itemprop="datePublished"><em><?php the_time('j F Y') ?></em></time>
|
</div>
|
||||||
</div>
|
|
||||||
<?php the_excerpt(); ?>
|
<h2 class="preview-title"><?php the_title();/*3*/ ?></h2>
|
||||||
<p class="align-center"> <a href="<?php the_permalink(); ?>" class="btn btn-readmore" title="<?php the_title();?>">Lire l'article</a> </p>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</a>
|
||||||
|
</article>
|
||||||
|
|
||||||
|
|
||||||
<?php endwhile; ?> <?php wp_reset_query(); /*4*/ ?>
|
<?php endwhile; ?> <?php wp_reset_query(); /*4*/ ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ function mypost_social_sharing_buttons($content) {
|
||||||
// https://mypost_.com/how-to-create-social-sharing-button-without-any-plugin-and-script-loading-wordpress-speed-optimization-goal/
|
// https://mypost_.com/how-to-create-social-sharing-button-without-any-plugin-and-script-loading-wordpress-speed-optimization-goal/
|
||||||
|
|
||||||
global $post;
|
global $post;
|
||||||
if(is_singular() && !is_page()){
|
if(is_singular() || is_home()){
|
||||||
|
|
||||||
// Get current page URL
|
// Get current page URL
|
||||||
$mypost_URL = urlencode(get_permalink());
|
$mypost_URL = urlencode(get_permalink());
|
||||||
|
|
20
home.php
20
home.php
|
@ -1,20 +0,0 @@
|
||||||
<?php get_header(); ?>
|
|
||||||
<main class="col-md-8">
|
|
||||||
|
|
||||||
<!-- Recuperation de la page de home -->
|
|
||||||
<?php if ( !is_paged() ) {
|
|
||||||
$page = get_page_by_path( 'home' );
|
|
||||||
if ($page != null) {
|
|
||||||
echo '<h1 class="page-title">' . get_the_title( $page ) . '</h1>';
|
|
||||||
echo '<div>' . $page->post_content . '</div>';
|
|
||||||
}
|
|
||||||
echo '<h1 class="page-title">Dernier article</h1>';
|
|
||||||
include(TEMPLATEPATH . '/components/featured.php');
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<h1 class="page-title">Publications</h1>
|
|
||||||
<?php include(TEMPLATEPATH . '/components/preview-list.php'); ?>
|
|
||||||
|
|
||||||
</main>
|
|
||||||
<?php get_sidebar(); ?>
|
|
||||||
<?php get_footer(); ?>
|
|
|
@ -1,7 +1,10 @@
|
||||||
<?php get_header(); ?>
|
<?php get_header(); ?>
|
||||||
<main class="col-md-8">
|
<main class="col-md-8">
|
||||||
<h1 class="page-title">Publications</h1>
|
<h1 class="page-title"><i class="fa fa-fw fa-star"></i> À la une</h1>
|
||||||
<?php include(TEMPLATEPATH . '/components/preview-list.php'); ?>
|
<?php include(TEMPLATEPATH . '/components/featured.php'); ?>
|
||||||
|
|
||||||
|
<h1 class="page-title"><i class="fa fa-fw fa-clock-o"></i> Articles récents</h1>
|
||||||
|
<?php include(TEMPLATEPATH . '/components/posts-list.php'); ?>
|
||||||
</main>
|
</main>
|
||||||
<?php get_sidebar(); ?>
|
<?php get_sidebar(); ?>
|
||||||
<?php get_footer(); ?>
|
<?php get_footer(); ?>
|
||||||
|
|
Reference in a new issue