Answer the question
In order to leave comments, you need to log in
Different header on different pages - how to include different styles in function.php?
there is a landing page - it's the main one.
it has its own template - front-page.php
and its own header - header-main.php,
and its own footer - footer-main.php :
this option includes everything in the usual header.php and footer.php.
if ( is_page_template( 'front-page.php' )) {
//include style
wp_enqueue_style( 'my-main-style', get_template_directory_uri() . '/src/css/style.css', array(), '1.0' );
//include the script
wp_enqueue_script('my-main-js', get_template_directory_uri() . '/src/js/script.js', array(), true, true);
}
Including header-main.php and footer-main.php in the front-page.php template itself.
Answer the question
In order to leave comments, you need to log in
Use the conditional tag is_front_page()
, it checks that the main (home) page of the site is displayed
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question