This repository has been archived on 2024-04-03. You can view files and clone it, but cannot push or open issues or pull requests.
kspace-wordpress-theme/components/featured.php

35 lines
1.2 KiB
PHP
Raw Permalink Normal View History

2021-01-02 19:31:24 +01:00
<div id="featured-articles">
<?php
2021-01-02 19:31:24 +01:00
query_posts(array(
'post_type' => 'post',
'tax_query' => array(
array(
'taxonomy' => 'niveau',
'terms' => 'featured',
'field' => 'slug',
)
),
'orderby' => 'date',
2021-01-02 19:31:24 +01:00
'post_count' => '1',
'order' => 'DESC',
'posts_per_page' => '1'
));
2021-01-02 19:31:24 +01:00
if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
2023-05-20 12:02:34 +02:00
<article class="card head-primary" id="post-<?php the_ID(); ?>">
<h1 class="card-header"><?php the_title(); ?></h1>
2021-01-02 19:31:24 +01:00
<div class="flex-that mb">
<div class="article-category">
<?php $category = get_the_category();
2023-11-18 12:17:07 +01:00
echo"<a href= '" . esc_url( get_category_link( $category[0]->term_id ) ) . "' class='btn btn-small c-info'><svg class='icon' alt=''><use xlink:href='#icon-folder'></use></svg> " . $category[0]->cat_name . "</a>"; ?>
2021-01-02 19:31:24 +01:00
</div>
<time itemprop="datePublished"><em><?php the_time('j F Y') ?></em></time>
</div>
<?php the_excerpt(); ?>
2023-10-13 09:11:42 +02:00
<p class="align-center"> <a href="<?php the_permalink(); ?>" class="btn btn-link" title="<?php the_title();?>">Lire l'article</a> </p>
2023-05-20 12:02:34 +02:00
</article>
2021-01-02 19:31:24 +01:00
<?php endwhile; ?> <?php wp_reset_query(); /*4*/ ?>
</div>