Archived topic
Custom post type using different header image
1 reply · Started by Christi on April 29, 2021
I need to override single.php for a custom post type. I have copied it to a child theme and renamed it. All I want to do with it is replace the header image with a different one for these specific custom posts. Where would I do that? Your help would be greatly appreciated.
Hi there,
If you only need to replace the page header, I think it may be easier to do it with Block Elements or Hook Elements set to different display role location for each CPT.
Please see:
https://docs.generatepress.com/article/block-element-overview/
https://docs.generatepress.com/article/hooks-element-overview/
You can use generate_before_content, generate_before_main_content or generate_after_header for the hooks.