Hi all - I have a site with 4 distinct types at work: a blog, a magazine, a shop and a video section. When someone goes to the video section I would like that to use a different site header. I have tried a few header plugins but none recognize types, they merely distinguish between pages or posts. Any thoughts?
Thanks!
Dear James,
You will have to edit the header.php file and use conditionals.
<?php if ( get_post_type() == 'magazine' ) : ?>
SHOW MAGAZINE HEADER
<?php elseif ( get_post_type() == 'video' ) : ?>
SHOW VIDEO HEADER
<?php elseif ( get_post_type() == 'shop' ) : ?>
SHOW SHOP HEADER
<?php else: ?>
SHOW BLOG HEADER
<?php endif; ?>
Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.
Regards,
Caridad
Thanks for the prompt response. The header is presently drawn from this code:
<?php
do_action('skeleton_header');
?>
This is the correct header for everything apart from post_type single-tv
How would I go about getting the new image in and having it recognize this with the above code?
(apologies if this is more rudimentary than I am seeing)
Dear James,
Try replacing that line with the following block of code:
<?php if ( get_post_type() == 'single-tv' ) : ?>
SHOW YOUR CUSTOM HEADER HERE
<?php else : ?>
<?php
do_action('skeleton_header');
?>
<?php endif; ?>
Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.
Regards,
Caridad
That worked a treat - thanks so much!!