You can remove your footer and or footer widgets using several methods.
The best way is to write a custom function and add the code to the end of your child themes functions.php file.
If you only want to remove your footer or footer widgets from specific pages, posts, category and other archive pages, tbe best way is to add a conditional tag to your custom function.
The easiest way to remove footer widgets or any widgets for that matter, is to choose from a list of conditional tags, and paste the tag into the widget logic field added to all widgets after installing the plugin.
Simply change the hooks depending on which theme your are using.
You can also easily change the conditional tag as well.
Remove Footer Site Wide
This code removes the footer from your entire site
remove_action('genesis_footer', 'genesis_do_footer');
remove_action('genesis_footer', 'genesis_footer_markup_open', 5);
remove_action('genesis_footer', 'genesis_footer_markup_close', 15);
Remove Footer On Home Page Only
This code removes the footer and markup from the home page only using a conditional tag.
add_action('get_footer', 'child_remove_genesis_do_footer');
function child_remove_genesis_do_footer() {
if (is_home()) {
remove_action('genesis_footer', 'genesis_do_footer');
remove_action('genesis_footer', 'genesis_footer_markup_open', 5);
remove_action('genesis_footer', 'genesis_footer_markup_close', 15);
}
}
If you’re using another theme, you can change the hooks to match your themes.
Remove Footer Site Wide Excluding Home Page
Remove Footer Widgets & Footer Excluding Home Page
Display Footer Widgets Front Page Only
Use this code if you’re using a static or custom page as your home page and another page as your blog page.
Display Footer Widgets Home Page Only
Use this code if you’re using the default settings to display blog posts on your home page.
Using CSS Code To Remove Footer Widgets
Note: Uses the old XHTML markup. Please convert to HTML 5 if your themes supports it and change the I.D classes to HTML selector classes.
An easier way to remove footer widgets is to use CSS code:
This code will remove footer widgets on the home page.
.home #footer-widgets {
display: none;
}
This code will remove footer widgets using the page i.d
.page-id-007 #footer-widgets {
display: none;
}
This code will remove the footer widgets on all posts in a specific category.
.category-134 #footer-widgets {
display: none;
}
Change the category i.d to match your own.
You may also find this post about how to remove different widgets using various methods helpful.
Leave a Reply
You must be logged in to post a comment.