Different header on page template

I would like to use different header on my page.php. so on my page.php i am loading :smile:

<?php get_template_part('templates/header-page'); ?>

but how to hide the default header from page.php. i know that something has to be changed ion base.php.

thanks

If you replace the existing get_template_part() call with your own then you do not need to do anything else.

but i want to use on home page: get_template_part(‘templates/header’);
and on other pages like page.php this <?php get_template_part('templates/header-page'); ?>

how can i disable to use get_template_part(‘templates/header’); from base.php just on page.php

<?php get_template_part('templates/header', (is_page()) ? 'page' : ''); ?>

thanks Foxaii. solved

<?php
    do_action('get_header');
    if (is_page('Home')) { 
      get_template_part('templates/header');
    } else {
      get_template_part('templates/header-page');
    }
  ?>
1 Like