Created
July 20, 2017 16:01
-
-
Save generatepress/687f18772343314b05828725253db342 to your computer and use it in GitHub Desktop.
Remove sidebars and footer widgets on 404 page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'generate_sidebar_layout', 'tu_remove_sidebars' ); | |
function tu_remove_sidebars( $sidebar ) { | |
if ( is_404() ) { | |
return 'no-sidebar'; | |
} | |
return $sidebar; | |
} | |
add_filter( 'generate_footer_widgets', 'tu_remove_footer_widgets' ); | |
function tu_remove_footer_widgets( $widgets ) { | |
if ( is_404() ) { | |
return '0'; | |
} | |
return $widgets; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment