Categories
Genesis Tutorials

Remove Footer Or Widgets On Specific Pages

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.

Note: Please be aware that the footer and footer widgets are different. removing the footer will not remove the footer widgets and vice versa.

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.

Related Posts

15 replies on “Remove Footer Or Widgets On Specific Pages”

Try changing the following line

if( !is_home() ) {

to this

if( is_front_page() ) {

No luck. I’ve tried:

add_action( ‘genesis_before’, ‘agency_remove_footer_exclude_home’ );
function agency_remove_footer_exclude_home() {
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);
}}

as well as
add_action( ‘genesis_before’, ‘agency_remove_footer_exclude_home’ );
function agency_remove_footer_exclude_home() {
if( is_front_page() ) {
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);
}}

Don’t forget to add this:

remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );

Like this:

add_action( 'genesis_before', 'remove_footer_exclude_home' );
function remove_footer_exclude_home() {
if( is_front_page() ) {
remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );
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);
}}

Tested and works.

thanks for this. just spent the last 2 hours trying figure this out and fixed it in 2 minutes after reading this.

Hi Brad,

Is this also possible with sub footers? I would like to display the sub footers (Outreach Pro theme) only on the homepage.
I’ve been trying this with code snippets but I can’t figure it out.
Thanks in advance.

Very helpful, thanks Brad!
Is there a way to add another set of footer widgets so one could have 3 footer widgets on the Home page and then a different set of 3 footer widgets on all other pages?

Yes but no need as you can add multiple footer widgets to each footer widget area with different conditional tags to control where they display using the Widget Logic plugin, Jetpack etc.

is_front_page() // Only displays on front page
!is_front_page() // Excludes the front page

Leave a Reply

Your email address will not be published. Required fields are marked *