I have a custom page template created. When I load my page, it shows the header logo of the mainpage but what I want to achieve is for each custom template created, I want it to only show its own logo.
This is the bit of the header code that calls the logo.php file:
<?php get_template_part('parts/logo', 'top') ?>
This is what I have tried but not working
<?php if ( is_page('custom-page')) {
get_template_part ('parts/custom-logo', 'top');
} else {
get_template_part('parts/logo', 'top');
} ?>
Any help will be much appreciated.
Thanks
get_template_part
the right way. Please check theCodex
for details