This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

Tagged: 

Remove sidebar from 404 error page

  • Creator
    Topic
  • #25573
    lizonbc
    Member

    Hi Jason,

    Sorry to bother you again. My client noticed that when he Google’s a non-existent page on our website, the 404 error comes up with the default sidebar in it. It looks like this:

    http://www.ataitec.net/junk

    Is it possible to get rid of that sidebar?

    Liz

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #25576
    Jason Bobich
    Keymaster

    Hi,

    If you go to Appearance > Widget Areas, you can create a custom widget area and apply it to the right sidebar location and give it the 404 page assignment. Then just leave the widget area blank at Appearance > Widgets.

    But honestly, why would you want to do this? You want your 404 pages to have content and crawlable links for search engines, which is what your sidebar gives you. It’s set up perfectly the way it is to push google crawlers onto your archives and through to your content.

    #25577
    Jason Bobich
    Keymaster

    Also, if you wanted to programmatically make 404 pages only all be a “full-width” sidebar layout (i.e. no sidebar), you can do it by simply filtering the themeblvd_sidebar_layout from your child theme functions.php.

    http://dev.themeblvd.com/tutorial/sidebar-layouts/#custom

    function my_sidebar_layout( $sidebar_layout ) {
     
        if ( is_404() ) {
            $sidebar_layout = 'full_width';
        }
     
        return $sidebar_layout;
    }
    add_filter( 'themeblvd_sidebar_layout', 'my_sidebar_layout' );
    #25580
    lizonbc
    Member

    I want it removed because we don’t blog.

    I tried to remove it by creating a widget area, but it didn’t work. I think it’s because I have named the page incorrectly. I don’t even know if there is a page for 404. I did not create it. Is it within the theme php?

    #25582
    Jason Bobich
    Keymaster

    #25625
    lizonbc
    Member

    THANK YOU! That did it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.