- This topic has 22 replies, 4 voices, and was last updated 5 years, 1 month ago by
David.
-
AuthorPosts
-
January 31, 2016 at 8:33 pm #169472
Siong Boon Lim
Hi Tom,
I would like to customise the error 404.
I have learn about changing the text on the page 404 using the filter.
https://generatepress.com/forums/topic/change-the-text-404-error/#post-115744May I know how can I add more text with clickable links, before and after the default appearing search bar? I am also interested to add a icon/graphic to this error page (page not found).
Thank you.
-
This topic was modified 9 years, 8 months ago by
Siong Boon Lim.
January 31, 2016 at 11:45 pm #169496Tom
Lead DeveloperLead DeveloperHi there,
You can do this by using filters, but it may be easier to do using this plugin: https://wordpress.org/plugins/404page/
Let me know.
February 1, 2016 at 12:56 am #169506Siong Boon Lim
Thank you.
I used this plugin. Easy to use.
Just that, The search bar is no longer around.
Wonder if it is possible to have it back for the “page not found” page.February 1, 2016 at 9:26 am #169631Tom
Lead DeveloperLead DeveloperJust answered this here: https://generatepress.com/forums/topic/insert-the-search-bar-on-a-content-page/#post-169629
February 4, 2016 at 11:53 pm #170570Siong Boon Lim
Hi Tom,
I have come across the following page after using the search bar.
{
Nothing Found
Sorry, but nothing matched your search terms. Please try again with some different keywords.
}I was then I realise it is different from 404page.
My intention was also to have a custom page to guide the guest when they couldn’t find what they want in the website.Would need your advise on this.
Thank you.February 5, 2016 at 8:45 am #170675Tom
Lead DeveloperLead DeveloperAh yea, that’s the no results page.
You can ask the plugin developer if they have an option for that – if not, I’ll see if I can come up with something 🙂
February 5, 2016 at 10:17 pm #170803Siong Boon Lim
If I only want to customise the text, and have clickable links,
will the simple hook works?February 6, 2016 at 1:05 am #170839Tom
Lead DeveloperLead DeveloperLooks like I need to add some filters to the no-results.php template.
Are you using a child theme? If so, copy the no-results.php template from the generatepress folder and add it to your child theme. Then you can change the content as needed 🙂
February 6, 2016 at 3:23 am #170851Siong Boon Lim
Yes. I am using a child Theme.
Thank you for your advise.February 6, 2016 at 4:03 am #170864Siong Boon Lim
Hi Tom,
I am able to customise the “Nothing Found” page.
How do I disable the sidebar?
The sidebar is not showing relevant content and I do not want to show it.February 6, 2016 at 4:14 pm #170997Tom
Lead DeveloperLead DeveloperThe page uses the is_search() conditional, so removing the sidebar would also remove it from search result pages.
Would that be ok?
February 6, 2016 at 5:22 pm #171016Siong Boon Lim
Hi Tom,
I don’t understand.
How is “is_search()” related to the sidebar?February 6, 2016 at 10:53 pm #171031Tom
Lead DeveloperLead DeveloperWe can disable sidebars, but we need to be able to pick the page where we disable it.
In this case, the only way to target that specific template to remove the sidebar is to use is_search() which is used by all search results.
I’ve researched it quite heavily and there doesn’t seem to be a way to only target the no results page.
add_filter( 'generate_sidebar_layout','generate_custom_search_sidebar_layout' ); function generate_custom_search_sidebar_layout( $layout ) { if ( is_search() ) return 'no-sidebar'; return $layout; }
Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/
May 13, 2019 at 8:56 pm #898452Somnath
Hi Tom,
I do not want to use plugin for small thing. Can you provide filter that will redirect to custom 404 page.
Let me know 🙂
Thanks.
May 13, 2019 at 9:44 pm #898472Leo
StaffCustomer SupportThere isn’t a filter built-in to the theme for this.
We’d definitely provided that solution if there was 🙂
-
This topic was modified 9 years, 8 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.