So. I’m building a theme where the 404 information is handled as a regular page, and in the theme i have a setting for this which stores this page id.
In my 404.php i’m quering this page by this stored id, but I can’t get it to work with SO layout.
I’ve tried to force filtering through the_content with this code:
$page_id_404 = get_option('page-id-404'); if($page_id_404) { $page = get_post($page_id_404); $content = $page->post_content; $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); echo $content; }
but with no luck. I guess this is happening since i’m kind of outside the loop. Any suggestion for how to solve this?
I could of course in my 404 maybe try do some kind of redirect to the created 404-page itself, but i would prefer to make it “right” :)
Hi Linuzitac,
Try the following PHP:
How does that look? The above PHP will check if SiteOrigin Page Builder is enabled on your page and if it is, Siteorigin Page Builder will render the page builder layout.