[Resolved] custom 404 page

Home Forums Support [Resolved] custom 404 page

Home Forums Support custom 404 page

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #1142130
    Paul

    Hi, Is it possible to have a custom 404 page with the template I’m using?

    #1142392
    David
    Staff
    Customer Support

    Hi there,

    simplest method is to use this plugin:

    https://en-gb.wordpress.org/plugins/404page/

    #1143177
    Paul

    OK – Good to know, I’m on a plugin diet.

    #1143332
    David
    Staff
    Customer Support

    Options:

    1. Use a child theme and make a copy of the 404.php template and recode….
    2. Create a Header Element for your 404 and we can use some CSS to ‘hide’ the default content
    3. Or the plugin.

    The plugin does do all the grunt work that you need to cover if you go with the (1) child theme route

    #1143786
    Paul

    Let’s give option 2 a try.

    #1143792
    David
    Staff
    Customer Support

    So create a new Element, add whatever content backgrounds etc.

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

    Then add this CSS to hide the standard 404 content:

    .error404 #page {
        display: none;
    }
    #1144743
    Paul

    This seems like a good fit – is it possible for me to add a search box in the custom header? Pretty much looking to have the template layout withing the new custom header. Thanks.

    #1144863
    Leo
    Staff
    Customer Support

    You can create a hook element and use this to add a search form;
    <?php get_search_form(); ?>

    #1146027
    Paul

    I was able to try that out, ideally I’d like the search box to be under the text that’s there https://www.trademarkinteriors.com/404 how would I accomplish that?

    #1146043
    David
    Staff
    Customer Support

    Tom provides a shortcode function here:

    https://generatepress.com/forums/topic/search-field-in-404-page/#post-787184

    Once that snippet is added to your site
    https://docs.generatepress.com/article/adding-php/

    You can add the [search_form] shortcode to the header element

    #1146053
    Paul

    BEAUTIFUL! Thanks!!

    #1146664
    David
    Staff
    Customer Support

    You’re welcome

    #2069164
    Ravi Dixit

    Hey, David!

    I’ve followed your instructions and created a block element and select the location as a 404 templates to have a custom 404-page body. I also tried this CSS you suggested:

    .error404 #page {
        display: none;
    }

    But it is hiding the entire page content including the block I created.

    How can I remove these items from the page: https://prnt.sc/260b1qe

    #2069186
    Ying
    Staff
    Customer Support

    I’ve followed your instructions and created a block element

    David was suggesting using a header element, not a block element. If you are using a block element, make sure you choose page hero as the element type.

    #2069189
    Ravi Dixit

    Okay, I selected the page hero as the element type then how to hide those items from page?

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