-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage.php
More file actions
22 lines (17 loc) · 702 Bytes
/
Copy pathpage.php
File metadata and controls
22 lines (17 loc) · 702 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
$context = \Timber\Timber::context();
$post_obj = \Timber\Timber::get_post();
if ( ! $post_obj ) {
wp_safe_redirect( home_url( '/404' ), 307 );
exit;
}
$post_obj->setup();
$context['post'] = $post_obj;
$split = observata_split_hero_from_content( get_the_content(), 'observata/section-hero-page' );
$context['hero'] = $split['hero'];
$context['content'] = $split['content'];
$context['body_class'] = implode( ' ', get_body_class( 'page' ) );
$context['header'] = do_blocks( '<!-- wp:observata/header /-->' );
$context['footer'] = do_blocks( '<!-- wp:observata/footer /-->' );
\Timber\Timber::render( 'templates/page-default.twig', $context );
$post_obj->cleanup();