• Resolved Ally_Huang

    (@ally_huang)


    Hi,

    I am trying to remove footer widgets on all the pages except front page. This is my code.

    add_action('wp_head','my_footer_widget_removal');
    function my_footer_widget_removal() {
    	if ( is_front_page() )
    		return;
    	remove_action('__footer', array(TC_init::$instance, 'footer_widgets'), 10);
    }

    would anyone know how to remove footer widgets please?

    thanks,

    Ally

Viewing 2 replies - 1 through 2 (of 2 total)
  • I would try removing the entire widget areas, possibly via conditionally de-register the footer-sidebars.

    Might be easier to use CSS, maybe something like:

    footer .widget-area {display:none;}
    .home footer .widget-area {display:block;}
    Thread Starter Ally_Huang

    (@ally_huang)

    Thank you santeven

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove Footer widgets except front page’ is closed to new replies.