Problème :
Quand vous afficher les articles d’une catégorie sélectionnée, par défault WordPress affiche quelques chose du style
Archives category : Name of the category
en haut de page au dessus des articles.
Solution proposée :
Dans le template en question (a priori category.php) il est possible d’utiliser le code suivant au dessus du loop wordpress:
Exemple basique :
<?php single_cat_title(); ?>
Exemple avec condition :
<?php if (is_category('scolaire')) : ?> <h1>This is the text to describe category SCOLAIRE</h1> <?php elseif (is_category('Loisirs')) : ?> <h1>This is the text to describe category LOISIRS</h1> <?php else : ?> <h1>CATEGORY EN QUESTION</h1> <?php endif; ?>
Leave A Comment