• Resolved Johnny

    (@johnny18sg)


    Hi Ben,

    When the 404 error page is shown, it defaults to the Double Sidebars layout.

    Is there a way to change the layout to No Sidebar?

    Thanks,
    Johnny

    PS: I have a child theme to modify functions.php.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Ben Sibley

    (@bensibley)

    Hi Johnny,

    There are a few ways you can approach this with a child theme, but here’s what I think is the simplest method.

    Copy both sidebar-left.php and sidebar-right.php from Mission News into your child theme. Then add the following snippet to the very top of both files.

    if ( is_404() ) {
      return;
    }

    That simply checks if the current page is the 404 page and will exit the file without running any of the code which means no sidebar is output.

    Thread Starter Johnny

    (@johnny18sg)

    Thank you!

    Theme Author Ben Sibley

    (@bensibley)

    You’re welcome ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘404 Error Layout’ is closed to new replies.