-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
51 lines (44 loc) · 1.17 KB
/
index.php
File metadata and controls
51 lines (44 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* The index page. The last file WordPress will try to load when resolving template.
* See http://wphierarchy.com for help.
*/
namespace k1;
$obj = \get_queried_object();
$thumb = \get_post_thumbnail_id($obj->ID);
$title = \is_archive() ? get_the_archive_title() : $obj->post_title;
$app = app();
$hero = $app->getBlock('Hero');
get_header(); ?>
<div class="k1-root k1-root--archive k1-scheme--base-default">
<?php
echo withTransient(capture([$hero, 'render'], [
'blockSettings' => [ // cloned field
'scheme' => [
'base' => 'invert',
'advancedMode' => false,
],
],
'content' => [
'data' => '<h1>' . title($title) . '</h1>',
'position' => 'centerBottom',
],
'background' => [
'backgroundMedia' => [
'type' => 'image',
'image' => [
'data' => $thumb,
'imagePosition' => 'centerCenter'
]
]
]
]), [
'key' => 'indexHero',
'options' => [
'type' => 'manual-block',
]
], $missReason);
echo "\n\n\n<!-- Block " . $hero->getName() . " cache: " . transientResult($missReason) . " -->";
Templates\PostList(); ?>
</div>
<?php get_footer();