- This topic has 22 replies, 4 voices, and was last updated 3 years, 7 months ago by David.
-
AuthorPosts
-
January 31, 2016 at 8:33 pm #169472Siong 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 8 years, 2 months ago by Siong Boon Lim.
January 31, 2016 at 11:45 pm #169496TomLead 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 LimThank 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 #169631TomLead 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 LimHi 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 #170675TomLead 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 LimIf I only want to customise the text, and have clickable links,
will the simple hook works?February 6, 2016 at 1:05 am #170839TomLead 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 LimYes. I am using a child Theme.
Thank you for your advise.February 6, 2016 at 4:03 am #170864Siong Boon LimHi 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 #170997TomLead 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 LimHi Tom,
I don’t understand.
How is “is_search()” related to the sidebar?February 6, 2016 at 10:53 pm #171031TomLead 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 #898452SomnathHi 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 #898472LeoStaffCustomer SupportThere isn’t a filter built-in to the theme for this.
We’d definitely provided that solution if there was π
-
AuthorPosts
- You must be logged in to reply to this topic.