Cut site logo and menu bar from '404' error page template (3 posts)

  1. kanote
    Posted 5 years ago #

    I've got this 404.php error page code:

    <?php get_header('header'); ?>
    <div id="content3">
        <div id="posts">
            <!--THE POST-->
            <div id="content_wrap" class="error_page">
            <!--404 Error-->
            <div class="fourofour"><label><a href="<?php echo get_option('home'); ?>">404</a></label></div>
            <div class="post">
            <!--<h2><?php _e('Page Not Found', 'scylla'); ?></h2>-->
    		<div class="error_msg">
            <p><label><?php _e('Serwer nie mógł odnaleźć wyszukiwanej strony. Być może strona została przeniesiona lub skasowana, albo link do niej został wpisany z błędem. Sprawdź czy wpisany URL/wyszukiwana fraza są poprawne.
    		Użyj wyszukiwarki pod spodem aby przeszukać blog ponownie lub wróć na stronę główną (kliknij na "404")</a>.', 'scylla'); ?></label></p><br />
            <?php get_search_form(); ?>
    		<!-- Miejsce na Google AdSense Search -->

    And i know that this first line is neccesary - i mean the "get_header" func. But what i want, is to show people the 404 page without my website's logo and menu bar, only with the set background, 404 number printed on it and this warning post content. I know that when i delete this line <?php get_header('header'); ?> the header (logo and menu bar) won't be loaded, but also style.css won't be too. What function i could use to achieve what i want? I know i can write some arguments to get_header(); function, but what it must be, to load only wanted elements - i tried with classes of those elements but it didn't helped.

  2. peredur
    Posted 5 years ago #

    You could load a custom header instead:

    <?php get_template_part( '404-header' ) ?>

    That should look for the file 404-header.php, if understand things properly, and load (include) it.

    Or you could just put the header code in the 404.php file.



  3. kanote
    Posted 5 years ago #

    I've already found solution, just used <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" /> instead any function.

    But thanks for response, cheers.

Topic Closed

This topic has been closed to new replies.

About this Topic