Compare commits

..

No commits in common. "2cfaf89b3f30d1498d71a8048ac3ac09ed6b4d41" and "3237b5325c130cdafeeb42b1b93ba0d650cbb3ae" have entirely different histories.

4 changed files with 34 additions and 45 deletions

View file

@ -1,34 +1,40 @@
<div id="featured-articles">
<div id="featured-articles" class="preview-container">
<?php
query_posts(array(
query_posts(array(
'post_type' => 'post',
'tax_query' => array(
array(
'taxonomy' => 'category',
'terms' => 'blog',
'taxonomy' => 'niveau',
'terms' => 'featured',
'field' => 'slug',
)
),
'orderby' => 'date',
'post_count' => '1',
'order' => 'DESC',
'posts_per_page' => '1'
'post_count' => '2',
'order' => 'DESC'
));
if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<div class="card card-primary" id="post-<?php the_ID(); ?>">
<div class="card-header"><h1><?php the_title(); ?></h1></div>
<div class="flex-that mb">
<div class="article-category">
<?php $category = get_the_category();
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>"; ?>
</div>
<time itemprop="datePublished"><em><?php the_time('j F Y') ?></em></time>
</div>
<?php the_excerpt(); ?>
<p class="align-center"> <a href="<?php the_permalink(); ?>" class="btn btn-readmore" title="<?php the_title();?>">Lire l'article</a> </p>
</div>
<article class="preview">
<a href="<?php the_permalink(); ?>" class="preview-link">
<div class="preview-item" style="background-image:url('<?php echo get_the_post_thumbnail_url(); ?>');">
<div class="preview-overlay">
<div class="preview-categories">
<?php $category = get_the_category();
echo"<span class='badge badge-category'>" . $category[0]->cat_name . "</span>"; ?>
</div>
<h2 class="preview-title"><?php the_title();/*3*/ ?></h2>
</div>
</div>
</a>
</article>
<?php endwhile; ?> <?php wp_reset_query(); /*4*/ ?>
</div>

View file

@ -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/
global $post;
if(is_singular() && !is_page()){
if(is_singular() || is_home()){
// Get current page URL
$mypost_URL = urlencode(get_permalink());

View file

@ -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(); ?>

View file

@ -1,7 +1,10 @@
<?php get_header(); ?>
<main class="col-md-8">
<h1 class="page-title">Publications</h1>
<?php include(TEMPLATEPATH . '/components/preview-list.php'); ?>
<h1 class="page-title"><i class="fa fa-fw fa-star"></i> À la une</h1>
<?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>
<?php get_sidebar(); ?>
<?php get_footer(); ?>