[Support request] Error page 404 remove items – Страница ошибки 404.

Home Forums Support [Support request] Error page 404 remove items – Страница ошибки 404.

Home Forums Support Error page 404 remove items – Страница ошибки 404.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1675638
    nikoff

    Hello. Please help me solve the problem.
    I have a website. Here’s his address https://covid-signs.ru
    I changed the 404 page to my own code.
    I have the old code.
    But I need that on the 404 page there is no header and footer.
    How to implement it?
    The fact is that I have a traffic counter installed in my footer, and the site is periodically attacked through the 404 page. The attack is not terrible, but the counters that are in the footer and in the header read the information.
    Help me to make sure that there is no footer and header on the error page 404.
    Thank you in advance! I’m really looking forward to it!

    ————

    Здравствуйте.
    Помогите пожалуйста решить задачу.
    У меня есть сайт. Вот его адрес https://covid-signs.ru я изменил 404 страницу на свой код.
    У меня есть старый код.
    Но мне нужно, что бы на 404 странице не было шапки и футера.
    Как это реализовать?
    Дело в том, что у меня в футере установлен счетчик посещаемости, и на сайт периодический идет атака через 404 страницу.
    Атака не страшная но счетчики которые в футере и в хедере считывают информацию.
    Помогите мне сделать так, чтобы не было футера и шапки на странице ошибки 404. Заранее спасибо! Очень жду!

    #1676306
    David
    Staff
    Customer Support

    Hi there,

    how are you generating the 404 page ? If its an adaptation to the themes 404 template then you can use the Layout Element to disable elements:

    https://docs.generatepress.com/article/layout-element-overview/

    #1676447
    nikoff

    Hello.
    I need it in the standard code 404.php remove the cap and the basement.
    Here is a copy of the code:

    <?php
    /**
    * The template for displaying 404 pages (Not Found).
    *
    * @package GeneratePress
    */

    if ( ! defined( ‘ABSPATH’ ) ) {
    exit; // Exit if accessed directly.
    }

    get_header(); ?>

    >
    <main id=”main” <?php generate_do_element_classes( ‘main’ ); ?>>
    <?php
    /**
    * generate_before_main_content hook.
    *
    * @since 0.1
    */
    do_action( ‘generate_before_main_content’ );

    generate_do_template_part( ‘404’ );

    /**
    * generate_after_main_content hook.
    *
    * @since 0.1
    */
    do_action( ‘generate_after_main_content’ );
    ?>
    </main>

    <?php
    /**
    * generate_after_primary_content_area hook.
    *
    * @since 2.0
    */
    do_action( ‘generate_after_primary_content_area’ );

    generate_construct_sidebars();

    get_footer();

    I understand that it is possible to make a page 404 by plug-in, but it gives the response code 200 and should be 404.

    The standard version accurately returns the code of the non-existent page 404, only I need to remove the header and the basement in it.
    ————————

    Здравствуйте.
    Мне нужно в стандартном коде 404.
    php убрать шапку и подвал. Вот копия кода:

    <?php
    /**
    * The template for displaying 404 pages (Not Found).
    *
    * @package GeneratePress
    */

    if ( ! defined( ‘ABSPATH’ ) ) {
    exit; // Exit if accessed directly.
    }

    get_header(); ?>

    >
    <main id=”main” <?php generate_do_element_classes( ‘main’ ); ?>>
    <?php
    /**
    * generate_before_main_content hook.
    *
    * @since 0.1
    */
    do_action( ‘generate_before_main_content’ );

    generate_do_template_part( ‘404’ );

    /**
    * generate_after_main_content hook.
    *
    * @since 0.1
    */
    do_action( ‘generate_after_main_content’ );
    ?>
    </main>

    <?php
    /**
    * generate_after_primary_content_area hook.
    *
    * @since 2.0
    */
    do_action( ‘generate_after_primary_content_area’ );

    generate_construct_sidebars();

    get_footer();

    Я понимаю, что можно сделать страницу 404 путем плагина, но она отдает ответ код 200 а должна 404. Стандартный вариант точно отдает код несуществующей страницы 404, только мне нужно убрать шапку и подвал в нем.

    I understand that it is possible to make a page 404 by plug-in, but it gives the response code 200 and should be 404.

    The standard version accurately returns the code of the non-existent page 404, only I need to remove the header and the basement in it.

    #1676718
    Elvin
    Staff
    Customer Support

    Hi there,

    I’m not sure what you mean by “cap” and “basement”.

    Perhaps you meant the “Header” and “Footer”.

    If that’s the case, you can try David’s suggestion to use Layout Elements.
    https://docs.generatepress.com/article/layout-element-overview/

    You can use the Disable elements feature of the Layout Element
    https://docs.generatepress.com/article/layout-element-overview/#disable-element

    Checking “Site Header” and “Footer” removes the mentioned sections on the pages included on the Layout Element’s display rule location.

    You can set the display rule location to 404 page so the Layout Element only applies on the 404 page.

    #1676745
    nikoff

    Я не могу понять не единого слова на английском языке.
    Неужели вы не понимаете что я написал на русском языке.
    Да. Я имел виду «Верхний колонтитул» и «Нижний колонтитул».
    Но мне нужно это реализовать на 404.php странице.

    I can’t understand a single word in English.
    Don’t you understand what I wrote in Russian?
    Yes. I meant “Header” and “Footer”.
    But I need to implement this on 404.php the page.

    #1676938
    David
    Staff
    Customer Support

    You can use the Layout Element.
    1. Go to Dashboard > Appearance > GeneratePress and enable the Elements Module.
    2. Go to Appearance > Elements > Add New > Layout Element.
    3. Go to Disable Elements and check Site Header and Footer:

    https://docs.generatepress.com/article/layout-element-overview/#disable-element

    4. Set the Display Rules Location to 404 Page

    https://docs.generatepress.com/article/layout-element-overview/#display-rules

    5. Publish the Element.

    #1677189
    nikoff

    Thanks! You’ve helped me out again!
    Everything worked out.
    Managed to correctly hide the top and bottom through the element.
    Here is my result https://covid-signs.ru/thanks-generatepress

    Thank you again for your prompt support!

    ✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯
    ✯ ☭ + Û$Ά = Friends! ✯
    ✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯✯

    Спасибо! Вы снова меня выручили!
    Все получилось.
    Удалось правильно скрыть верх и низ через элемент.
    Вот мой результат https://covid-signs.ru/thanks-generatepress

    Спасибо еще раз за оперативную поддержку!

    #1677191
    David
    Staff
    Customer Support

    Glad we could be of help!

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