Load a Different Header in WordPress
Tento článek (nebo jeho část) je převzat z externího zdroje. Je tedy slušností jej uvést včetně případného autora.
This little snippet can come in handy when you need to serve a different header on a per page basis.
All you need to do is create a new header file – header-yourfilename.php
and then put in some logic in your desired template file.
In my case I have a header file called header-home.php
and in my homepage template I include the following at the top like so:
1 2 3 4 5 6 7 |
<?php if(is_front_page()) { get_header('home'); } else { get_header(); } ?> |
Napsat komentář