Closed bassjobsen closed 10 years ago
Hi,
In my opinion you got two option basically:
1) create a home.php or front-page.php in your child theme's folder (see: also http://codex.wordpress.org/Template_Hierarchy and some explanation on http://wordpress.org/support/topic/difference-between-homephp-and-front-pagephp)
2) or use is_home()
in your action, see in http://codex.wordpress.org/Function_Reference/is_home
In fact your home.php / front-page.php can be a copy of index.php.
header.php and footer.php describe the hook available for you. Hope this helps? Please let me know if you are missing some hook or if you need an other solution.
I have a front-page.php Because I want to hook before ".jbst-site-wrap" class only on home page, here is what I write in function.php :
function load_slider()
{
if (is_front_page()) {get_template_part( 'content', 'sliderhome' );}
}
add_action('jbst_before','load_slider');
EDIT : wrong syntax, I edited the post.
Nice! I think adding all code to functions is a choose you have to made. Alternatively you could all front-page related action in front-page.php. The last spare you an if
but on the other hand adds logic to you templates which could make thing more complex than necessarily
Question from @linearis