Multiple Header Images Using Single Template
-
My goal is to just use the page.php template for all of my secondary pages, but I want to have a different header image for each section. This code should allow this so that the user doesn’t have to select a template in the admin panel.
function my_different_header_images() { if (is_page('about')) { ?> <img src="<?php bloginfo('template_directory'); ?>/images/my-other-header.jpg" width="" height="" alt="" /> <?php } } add_action('hook_header_images','my_different_header_images');
My real question, if the above works, is how to tell all sub-pages of About to use that same header image? Is that possible with this code?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Multiple Header Images Using Single Template’ is closed to new replies.