Skip to content
Snippets Groups Projects
Verified Commit 1aa1ff5c authored by David Beniamine's avatar David Beniamine
Browse files

Show categories descriptions

parent 61109e89
Branches
No related tags found
No related merge requests found
......@@ -3,37 +3,26 @@
<section class="content">
<?php
$title="Blog";
$text="";
if (preg_match('/category.*/',current_url())){
echo "<p id='".current_url()."'></p>";
while(categories()){
echo "<p id='".category_url()."'></p>";
if(category_url() == "/".current_url()){
$title.=" - ".category_title();
$text="<div class='wrap'><p>".category_description()."</p>";
$text.="<p>Cette catégorie regroupe ".category_count()." ".pluralise(category_count(), "article", "s")."</p></div>";
}
}
}
echo "<h1 style='text-align:center'>$title</h1>\n";
echo $text;
?>
<?php if(has_posts()): ?>
<?php posts(); ?>
<h2> Dernier article </h2>
<?php include("single_article.php"); ?>
<!--
<?php if (!preg_match('/category.*/',current_url())): ?>
<h2> Catégories d'articles </h2>
<ul style="list-style:none">
<?php $i = 0; while(categories()): ?>
<?php if(category_count() > 0 ):?>
<li >
<?php include("single_category.php"); ?>
</li>
<?php endif; ?>
<?php endwhile; ?>
</ul>
<?php endif; ?>
-->
<?php if(total_posts() > 1 || $title=="Blog"):?>
<h2> Articles précédents </h2>
<ul class="items">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment