A
A
Andrew2015-09-28 10:48:47
WordPress
Andrew, 2015-09-28 10:48:47

How to create a 404 page in wordpress if it is not in the template by default?

Dear programmers, tell me how to create a 404 error page? By default, it is not included in the template. I will be very grateful for your help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mr Crabbz, 2015-09-28
@Traders

well, like this for example. Save as 404.php to your theme folder

<?php
/**
 * The template for displaying 404 pages (not found).
 *
 * @link https://codex.wordpress.org/Creating_an_Error_404_Page
 *
 * @package MyTheme
 */

get_header(); ?>

<section id="page-404">
  <div class="wrapper">
    <h1>404<span> - Не найдено</span></h1>
    <p>К сожалению, необходимая вам информация отсутствует.</p>
    <a href="/" class="button button-orange">Перейти на главную</a>
  </div>
</section>

<?php get_footer(); ?>

Information can be absolutely anything. The main thing is get_header, get_footer and save as 404.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question