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/taxonomy-roman.php

67 lines
2.2 KiB
PHP
Raw Normal View History

2021-01-04 13:05:09 +01:00
<?php get_header(); ?> <!-- ouvrir header,php -->
<main>
<?php $tag = get_category( get_query_var( 'roman' ) );
$tag_id = get_queried_object()->term_id;?>
<div class="flex-that">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<?php echo site_url(); ?>">kazhnuz.space</a></li><li class="breadcrumb-item" aria-current="page"><span class="active"><i class="fa fa-book"></i> <?php echo single_cat_title(); ?></span></li>
</ol>
</nav>
<div class="rss">
2021-01-25 13:23:50 +01:00
<?phpecho '<a href="' . get_tag_link( $tag_id ) . 'feed/" title="RSS de la categorie" class="btn btn-orange" /><i class="fa fa-rss"></i></a>'; ?>
2021-01-04 13:05:09 +01:00
</div>
</div>
<img class="cover" src="<?php
$term_meta = get_option( "taxonomy_term_$tag_id" );
echo $term_meta['cover'];
?>">
<div class="roman">
<div class="card">
<h1><?php echo single_cat_title(); ?></h1>
<div class="card-body">
<?php echo tag_description();?>
</div>
</div>
<?php
$args = array(
'tax_query' => array(
array(
'taxonomy' => 'roman',
'field' => 'term_id',
'terms' => $tag_id // you need to know the term_id of your term "example 1"
),
),
'posts_per_page' => -1,
'order' => 'ASC',
);
$query = new WP_Query( $args );
?>
<div class="card card-primary">
<div class="card-header"><i class="fa fa-list"></i> Chapitres</div>
<div class="card-menu">
<?php if($query->have_posts()) : ?>
<?php $i = 1; ?>
<?php while($query->have_posts()) : $query->the_post(); ?>
<a href="<?php the_permalink(); ?>" class="menu-element">
<span class="text-dark">
<strong>Chapitre <?php echo $i++; ?>.</strong>
<?php the_title(); ?>
</span>
<span>
<em class="text-dark"><?php the_time('d/m/Y') ?></em>
</span>
</a>
<?php endwhile; ?>
<?php endif; ?>
</div>
</div>
</div>
</main>
<?php get_sidebar(); ?>
<?php get_footer(); ?>