Categories
Wordpress

Modifier “Archives Category” au dessus du loop WordPress

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 :

[fusion_builder_container hundred_percent=”yes” overflow=”visible”][fusion_builder_row][fusion_builder_column type=”1_1″ background_position=”left top” background_color=”” border_size=”” border_color=”” border_style=”solid” spacing=”yes” background_image=”” background_repeat=”no-repeat” padding=”” margin_top=”0px” margin_bottom=”0px” class=”” id=”” animation_type=”” animation_speed=”0.3″ animation_direction=”left” hide_on_mobile=”no” center_content=”no” min_height=”none”]

<?php single_cat_title(); ?>

Exemple avec condition :[/fusion_builder_column][fusion_builder_column type=”1_1″ background_position=”left top” background_color=”” border_size=”” border_color=”” border_style=”solid” spacing=”yes” background_image=”” background_repeat=”no-repeat” padding=”” margin_top=”0px” margin_bottom=”0px” class=”” id=”” animation_type=”” animation_speed=”0.3″ animation_direction=”left” hide_on_mobile=”no” center_content=”no” min_height=”none”]

<?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; ?>

[/fusion_builder_column][/fusion_builder_row][/fusion_builder_container]

Leave a Reply

Your email address will not be published. Required fields are marked *