Site logo

[Support request] How to create a 404

Home Forums Support [Support request] How to create a 404

Home Forums Support How to create a 404

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #2482511
    Arnaud

    Hello

    I created a personalized 404 page, but I would like to be able to edit the Page Title, the meta-title and the meta-description.

    Note :
    – I had 404 block element with the Element Type : Content Template
    – I added the 404.php to my child theme : https://github.com/tomusborne/generatepress/blob/master/404.php

    Site: https://deforges.fr/dede

    #2482598
    Ying
    Staff
    Customer Support

    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.

    #2482635
    Arnaud

    I added the 404.php to my child theme by following this thread : https://generatepress.com/forums/topic/creating-a-customized-404-page/

    I was able to change the meta-title with RankMath plugin.

    Also how can I give a specific page title for my 404 ?

    thx.

    #2482779
    Ying
    Staff
    Customer Support

    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

    #2483687
    Arnaud

    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

    #2483804
    Ying
    Staff
    Customer Support

    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

    #2484866
    Arnaud

    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

    #2485033
    Ying
    Staff
    Customer Support

    i would like to style the h1 bock in the same manner as the other regular Pages

    It can be easily done using a block element - page hero.
    https://docs.generatepress.com/article/block-element-page-hero/

    #2485043
    Arnaud

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

    any solution ?

    #2485050
    Ying
    Staff
    Customer Support

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

    #2485076
    Arnaud

    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

    #2485106
    Ying
    Staff
    Customer Support

    Because you have this CSS added to your site:

    #main {
        min-height: 65vh;
    }

    Change it to:

    body:not(.error404) #main {
        min-height: 65vh;
    }
Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.