Archived topic
CSS for 404 Page
5 replies · Started by Greg on November 30, 2021
Hi guys
I've created a custom 404 page with page-specific CSS (including a locally hosted webfont) using a hook in GP.
I then used the 404page plugin to set the custom 404 page. But, because the page is loaded on the fly as such, rather than the specific /page-not-found URL itself, the hook (and my custom CSS for this page) isn't being called into action.
I found the plugin has it's own action hook '404page_after_404' (https://petersplugins.com/404page/manual/), which I tried as a Custom Hook, but no luck.
Does anyone know or have ideas on a workaround for this?
I would prefer to avoid setting up a 404 plugin which 301's all the 404's, as I've heard it's not great for SEO.
Thanks for any help!
Greg
Hi Greg,
Are you using 404 as the location for the element?
Can you try add page > page name instead?
Let me know :)
Thanks for your reply, Ying - I'm using Page > Page Name already.
I see, not sure how the plugin works, let's try 404 template as the location.
Awesome, that's fixed it :)
Thanks Ying, I thought that would just link to a default theme 404 page, so I didn't even try it!
I thought so too :)
Glad it works!