Answer the question
In order to leave comments, you need to log in
How to change the header for the main page?
Hello. You need to make 2 options for the header, for the static page fron-page.php and for everything else. I created a special header, named the file two.php in the file I write:
<?php
/**
* Template for front page.
*
* @package Easy_Commerce
*/
if ( 'posts' === get_option( 'show_on_front' ) ) :
get_template_part( 'home' );
else :
if ( true === apply_filters( 'easy_commerce_filter_home_page_content', true ) ) :
get_template_part( 'page' );
else :
get_header('two'); //Вот здесь указываю, вроде нужный мне файл.
get_footer();
endif;
endif;
Answer the question
In order to leave comments, you need to log in
https://codex.wordpress.org/Template_tags/get_header
[For a template named two, the header-two.php template will be added]
In general, I didn’t quite understand what and how you connect.
If you need a separate header for the main one, isn't it easier to just put a condition in header.php:
if( is_front_page() ){
echo "Это главная шапка";
}
else {
echo "это не главная шапка";
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question