In order to have two blogs on one website, I was able to put in the menu two categories: DOCUMENTATION and ACTUALITES. My problem is in the header. The titles are displayed well however for both categories, the titles correspond to the title of the last article of the page... You can see an example in the picture (You will see that the CONTACT page is OK but for the DOCUMENTATION and ACTUALITES pages the titles are those of the last article). I would like to replace these article titles with those of the DOCUMENTATION and ACTUALITES categories. I think I have found the problem code but I don't know how to solve it.
<?php
if ( is_front_page() )
{
?>
<div class="bloc-header-home">
<span class="decouvrez">Découvrez</span>
<h1>La chasse</h1>
<span class="avantages">Text description</span>
<a href="<?php echo get_page_link(221); ?>"><button class="header__see-more">en savoir plus</button></a>
</div>
<?php
}
elseif ( is_home() ) {
?>
<h1>Actualités</h1>
<?php
}
else {
?>
<h1><?php the_title(); ?></h1>
<?php
}
?>
Could someone help me? Thanks in advance for your help! Els
get_the_title()
? You can add one moreif
statement stating thatelseif( is_page('documentation') )
then add yourh1
tag? You can also use page ID's instead of the page name if that is easier for you!