Created
February 15, 2017 23:05
-
-
Save jonathanfann/6e7fc5d49f23bdf284853fe210ec3ef9 to your computer and use it in GitHub Desktop.
Include Different Header For Each Custom Post Type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$post_type = get_post_type( get_the_ID() ); | |
get_template_part( 'headers/' . $post_type, 'header' ); | |
?> | |
<!-- | |
if your custom post type label is named 'support' for example | |
this will include the contents of 'yourtheme/headers/support-header.php' | |
Note: Fails silently so if file doesn't exist, nothing will be included. | |
--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment