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


Comments

15 responses to “Remove Footer Or Widgets On Specific Pages”

  1. Hi Brad,
    How about removing footer and footer widgets on home page only? )The opposite of the fourth snipped of code you provided above). Using Agency Pro theme.

    1. Brad Dalton Avatar
      Brad Dalton

      Try changing the following line

      [code]if( !is_home() ) {[/code]

      to this

      [code]if( is_front_page() ) {[/code]

      1. 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);
        }}

        1. Brad Dalton Avatar
          Brad Dalton

          Don’t forget to add this:
          [code]remove_action( ‘genesis_before_footer’, ‘genesis_footer_widget_areas’ );[/code]

          Like this:

          [code]
          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);
          }}
          [/code]

          Tested and works.

          1. That worked, thank you Brad 🙂

  2. Your advise helped me fix my site. Thanks so much!

    1. Brad Dalton Avatar
      Brad Dalton

      Thanks for the positive feedback.

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

    1. Brad Dalton Avatar
      Brad Dalton

      Glad to hear it Jeremy

  4. Robert Avatar

    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.

      1. Robert Avatar

        Thanks a lot, that works perfect!

  5. 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?

    1. Brad Dalton Avatar
      Brad Dalton

      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.
      [code]
      is_front_page() // Only displays on front page
      !is_front_page() // Excludes the front page
      [/code]

      1. Thanks Brad. JetPack was the perfect solution – so easy!

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.