-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtaxonomy-thema.php
42 lines (33 loc) · 963 Bytes
/
taxonomy-thema.php
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
<?php
/**
* WIP:
* The template for displaying Thema (taxonomy) Landings pages.
*
* @package WordPress
* @subpackage Timber v2
*/
$context = Timber::context();
$archive = get_queried_object();
$taxonomy_name = $archive->taxonomy;
$templates = [
'overview-' . $taxonomy_name . '.twig',
'overview.twig',
'page.twig',
];
// Add our custom ACF fields
// (that we've added to our custom Tax)
// to this WP_Term..
foreach ( get_fields( $archive ) as $key => $val ) {
$archive->$key = $val;
}
$context['intro'] = $archive->description;
$context['post'] = [
'title' => 'TODO THEMA LANDINGSPAGE (taxonomy-thema.php):<br> ' . get_the_archive_title(),
'descr' => $archive->description,
'img' => $archive->thema_taxonomy_image
];
// Set data for overview: linked posts with this Term
foreach ( $context['posts'] as $post ) {
$context['overview']['items'][] = prepare_card_content( $post );
}
Timber::render( $templates, $context );