Site logo

Archived topic

How to create a 404

11 replies · Started by Arnaud on January 3, 2023

Viewing posts 1–12 of 12

Hi Arnaud,

As you are using an SEO plugin, they usually offer the option to edit the 404 title and meta data.
https://rankmath.com/kb/titles-and-meta/

– I added the 404.php to my child theme :

Don't think this is required, as the content template is doing the same thing.

I added the 404.php to my child theme by following this thread :

That's for users who don't use block elements, as you are already using a block element - content template, this PHP method is not required.

what do you mean by a specific page title?

do you mean the <title> element in the <head>?
https://www.screencast.com/t/Aogp1fEv8emV

thx Ying.

how does the method with the 404.php added to my child theme work ?

Ideally, i would like to create a Page with a 404 Template. can ?

About the other way that I implemented so far (404 block element with the Element Type : Content Template) -
what do you mean by a specific page title? > I mean the h1/page title we give when creating a new Page, different from the <title> element in the <head> which is the meta-title.

Hope it's clearer now.

thx

Ideally, i would like to create a Page with a 404 Template. can ?

Do you mean a static page? But why would you want to do that?

I mean the h1/page title we give when creating a new Page,

That's what I was confused about, as you've already added an h1 in your content template which is 404, you can change it to anything you want.
https://www.screencast.com/t/bsFuAFDGD

to answer your question (Do you mean a static page? But why would you want to do that?) : to have more control to style this page.

for example, i would like to style the h1 bock in the same manner as the other regular Pages : https://deforges.fr/salon/ with a hero banner that is full width.

thx

i did one with a dynamic text type as Title ; but when applying it to my 404 Template. No title is set.

any solution ?

You don't need to use a dynamic title, you can use a static title.

thx got it

https://deforges.fr/dede

there is big white space between the last paragraph "Le lien que vous avez suivi peut être incorrect ou la page peut avoir été supprimée." and the next block on a grey block.

how can we control this white space ?

thx

Because you have this CSS added to your site:

#main {
    min-height: 65vh;
}

Change it to:

body:not(.error404) #main {
    min-height: 65vh;
}
This archived topic is closed to new replies.