How to use a customized page as error 404 page
-
I would like to use the linked page above (https://alexluna.000webhostapp.com/erro) as my site’s 404 error page. In order to do that, I’ve created a child theme and there I’ve created a 404.php file using the content of Bento’s original page.php code, replacing “The WordPress Loop” code with the following:
<div class=”page-content”>
<?php
global $post;
$post = get_page_by_title(“Erro”);
if ($post) {
setup_postdata($post);
get_template_part( ‘content’, ‘page’ );
}
?>
</div>Now, I’m able to see the content of the customized page, but it isn’t formatted correctly.
You can check the differences accessing both the page I have linked here and a random URL on the same site, let’s say:
https://alexluna.000webhostapp.com/bento
Any clues about what I must add to my 404.php code in order to correct the page formatting when a 404 error happens?
Thanks,
Alex
The page I need help with: [log in to see the link]
- The topic ‘How to use a customized page as error 404 page’ is closed to new replies.