Get a particular header, footer, or sidebar of wordpress
January 4, 2009 · Print This Article
Since WordPress 2.7, it is easier to choose which header, footer or sidebar file you want to include on your theme.
The following code will check if the reader is on the “WordPress” category. If yes, header-wordpress.php will be inclued, otherwise the default header will be used:
<?php if is_category('WordPress') {
get_header('wordpress');
} else {
get_header();
} ?>
You can also use that new functionality with footers and sidebars:
<?php get_footer('myfooter'); ?>
will include footer-myfooter.php
<?php get_sidebar('mysidebar'); ?>
will include sidebar-mysidebar.php





















[...] … . I have been running WordPress 2.5 for a year, and the major shifts that have happened Get a particular header, footer, or sidebar of wordpress - livexp.net 01/04/2009 Since WordPress 2.7, it is easier to choose which header, footer or sidebar [...]