The code in this tutorial enables you to set a different header image based on any condition(s).
In this example, the code displays a different image based on category and a default image for all other pages as seen in the following demo video.
Demo Video
Shows a custom header image displayed for different categories and a default image shown for all other pages.
Simple Installation
There’s 2 simple steps :
Step 1 : Copy & paste the PHP code to the end of your child themes functions.php file.
Step 2 : Add 2 images to your child themes images folder. Name one financial.png and the other accounting.png.
Assumes you have added your default header image via Header Image setting in the customizer.
Usage With Custom Post Types
Swap out the conditional tags in the code with the following for usage on single custom post type pages:
is_singular( 'add-cpt-name-here' )
For usage with a custom post type archive :
is_post_type_archive( 'add-cpt-name-here' )
Based on this question from a member of the Genesis community :
I need to set a custom logo on a per page and CPT basis.
Register or login to access the PHP code for members.
Leave a Reply
You must be logged in to post a comment.