FYI get_header function only load “header.php”. You can try the below code to load your custom header template.
<?php // add inside functions.php
function get_template_header($filename='header'){
$file = TEMPLATEPATH.DIRECTORY_SEPARATOR.$filename.'.php';
if ( file_exists( $file ) ){
if (has_filter('get_header')) do_action('get_header');
load_template( $file );
} else {
get_header();
}
}
?>
usage
<?php get_template_header('header2'); // get header2.php ?>
hello chaoskaizer. thank you.
i dropped your code into functions.php and then replace my “get header” code with your usage code into my new template. did not work… i think i did it right.
i tried replacing this…
<?php get_header(); ?>
with this…
<?php include (TEMPLATEPATH . ‘header2.php’); ?>
here is the fix!
chaoskaizer, thank you again. the code above was provided by the theme developer. i just noticed that the ” / ” was missing…
<?php include (TEMPLATEPATH . ‘/header2.php’); ?>
new challenge on header2.php…
i wish to simplify a nav bar that has 10 category titles on it and wish to display only four.
the existing code =
wp_list_categories('title_li='); ?>
i tried this =
<?php wp_list_categories('title_li=' . 'exclude=4,27,32,33,82,147'); ?> <!-- 10/12/08 -->
got an error = Parse error: syntax error, unexpected
this works!
<?php wp_list_categories(‘title_li=&exclude=27,32,33,144,147’); ?> <!– 11/15/08 –>