Site logo

[Resolved] Custom No Results Page

Home Forums Support [Resolved] Custom No Results Page

Home Forums Support Custom No Results Page

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #723353
    Zad

    So I recently made a custom 404 page, but I also want to do the same with no-results page, I know there’s a .php file on the parent theme, but I’m trying to figure out if there’s any filter, function or PHP code thatll allow me to customize the message and insert my own image.

    #723422
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    There currently aren’t any filters for that template – I’ve marked it down as a to-do.

    Let me know if you have any other questions 🙂

    #724083
    Zad

    Hi Tom, thanks for keeping me in the loop. Hope that feature comes out soon! In the mean time, will taking the no-results.php document from the parent theme, duplicating it, and placing in the child theme folder in the PHP and making edits to it work for creating a custom version?

    #724084
    Zad

    ANd if so, is there a particular area in the document where I can include some html to include an image?

    #724127
    Tom
    Lead Developer
    Lead Developer

    That’s exactly how you’d do it.

    It depends on where you want the image.

    For example, if you want it above the content, you could place it here: https://github.com/tomusborne/generatepress/blob/2.1.4/no-results.php#L42

    #724167
    Zad

    Looks like it worked! However, I’m trying to center the image and the search bar using some CSS. This doesn’t seem to work,

    /* Center Custom 200 Image */
    .Custom200, .error200 .search-form {
        text-align: center;
    }
    
    /* Reduce Padding of Custom 200 Image */
    
    .error200 .entry-content {
        margin-top: 0.25em;
    }
    #724582
    Tom
    Lead Developer
    Lead Developer

    Give this a shot:

    .no-results img {
        display: block;
        margin: 0 auto;
    }
    
    .no-results {
        text-align: center;
    }
    #724632
    Zad

    Thanks much it worked!!

    #724778
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

    #1524943
    Alexandra

    Hi, Tom!
    Any news on the filters for the No results page?
    https://alex.bandiwork.dev/?s=reteszat

    I’m looking for a way to change the title and text, and found this old thread.
    Thank you!

    #1525049
    David
    Staff
    Customer Support

    Hi there,

    unfortunately no Filters are available in the no-results.php.
    You would need to make a copy of the template:

    https://github.com/tomusborne/generatepress/blob/master/no-results.php

    And add this to your Child Theme and then modify the template to suit.

    #1525125
    Alexandra

    Hi, David!
    It’s no problem, I actually prefer this solution 🙂
    Thank you so much for your help!
    Alexandra

    #1525173
    David
    Staff
    Customer Support

    You’re welcome

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