- This topic has 12 replies, 2 voices, and was last updated 5 years, 5 months ago by
David.
-
AuthorPosts
-
November 9, 2018 at 3:35 pm #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.
November 9, 2018 at 6:18 pm #723422Tom
Lead DeveloperLead DeveloperHi 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 🙂
November 10, 2018 at 3:42 pm #724083Zad
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?
November 10, 2018 at 3:45 pm #724084Zad
ANd if so, is there a particular area in the document where I can include some html to include an image?
November 10, 2018 at 5:27 pm #724127Tom
Lead DeveloperLead DeveloperThat’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
November 10, 2018 at 7:00 pm #724167Zad
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; }November 11, 2018 at 8:35 am #724582Tom
Lead DeveloperLead DeveloperGive this a shot:
.no-results img { display: block; margin: 0 auto; } .no-results { text-align: center; }November 11, 2018 at 10:15 am #724632Zad
Thanks much it worked!!
November 11, 2018 at 3:42 pm #724778Tom
Lead DeveloperLead DeveloperYou’re welcome 🙂
November 10, 2020 at 1:34 am #1524943Alexandra
Hi, Tom!
Any news on the filters for the No results page?
https://alex.bandiwork.dev/?s=reteszatI’m looking for a way to change the title and text, and found this old thread.
Thank you!November 10, 2020 at 3:23 am #1525049David
StaffCustomer SupportHi 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.
November 10, 2020 at 5:11 am #1525125Alexandra
Hi, David!
It’s no problem, I actually prefer this solution 🙂
Thank you so much for your help!
AlexandraNovember 10, 2020 at 5:56 am #1525173David
StaffCustomer SupportYou’re welcome
-
AuthorPosts
- You must be logged in to reply to this topic.