I just want to hide the footer from the homepage and the rest of the website footer should remain the same. how can i do that? here is my website http://texmex-cantina.com/ Thanks in advance.
2 Answers
You can copy the footer.php file to your child theme and add condition to not display on home page.
if (!is_home() || ! is_front_page()){
// All the codes which are not supposed to display on the front page or home page
}
-
Instead of child theme, Can i add this code the parent theme?– TRG SoftCommented Jun 22, 2018 at 10:22
-
you can, but it'd not recommended because if you update parent theme then it'll be lost after you update the theme, and you will have to re apply.– AkshatCommented Jun 22, 2018 at 10:28
-
Should i replace your code with some other codes in footer.php? i tried to put it at the end of footer.php but it didn't worked out.– TRG SoftCommented Jun 22, 2018 at 10:38
-
which all div's do you want to remove? you can put all under this condition.– AkshatCommented Jun 22, 2018 at 10:39
Depending on your theme, Wordpress has a front-page.php file that will act as the home page if present and set. This would allow you to use it as a separate page template from the rest of your site.
https://codex.wordpress.org/Creating_a_Static_Front_Page#Configuration_of_front-page.php