-
Notifications
You must be signed in to change notification settings - Fork 3
/
taxonomy-podcast-programa.php
44 lines (36 loc) · 1.23 KB
/
taxonomy-podcast-programa.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
<?php
/**
* The template for displaying podcasts programs pages, for native and custom post_types
*
* Used to display archive-type pages if nothing more specific matches a query.
* For example, puts together date-based pages if no date.php file exists.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* Methods for TimberHelper can be found in the /lib sub-directory
*
* @package wp-softcatala
*/
$templates = array( 'archive-podcast-programa.twig' );
$title = single_term_title('', false);
//Context initialization
$context_filterer = new SC_ContextFilterer();
$context_overrides = array( 'title' => $title );
$context = $context_filterer->get_filtered_context( $context_overrides, false );
$context['content_title'] = $title;
$context['term'] = new Timber\Term();
$context['sidebar_bottom'] = Timber::get_widgets('sidebar_bottom');
$context['posts'] = Timber::get_posts(
array(
'posts_per_page' => 15,
'post_type' => 'podcast',
'tax_query' => array(
array(
'taxonomy' => 'podcast-programa', // required
'terms' => $context['term']->term_id
),
),
)
);
$context['pagination'] = Timber::get_pagination();
Timber::render( $templates, $context );