Exemplo n.º 1
0
 /**
  * Custom implementation for get_context method.
  */
 public function get_context()
 {
     global $content_width;
     if (class_exists('Easy_Digital_Downloads')) {
         global $edd_options;
     }
     $context = Timber::get_context();
     $sidebar_primary = Timber::get_widgets('sidebar_primary');
     $sidebar_footer = Timber::get_widgets('sidebar_footer');
     $context['theme_mods'] = get_theme_mods();
     $context['site_options'] = wp_load_alloptions();
     $context['teaser_mode'] = apply_filters('maera/teaser/mode', 'excerpt');
     $context['thumbnail']['width'] = apply_filters('maera/image/width', 600);
     $context['thumbnail']['height'] = apply_filters('maera/image/height', 371);
     $context['menu']['primary'] = has_nav_menu('primary_navigation') ? new TimberMenu('primary_navigation') : null;
     $context['sidebar']['primary'] = apply_filters('maera/sidebar/primary', $sidebar_primary);
     $context['sidebar']['footer'] = apply_filters('maera/sidebar/footer', $sidebar_footer);
     $context['pagination'] = Timber::get_pagination();
     $context['comment_form'] = TimberHelper::get_comment_form();
     $context['comments_args'] = array('style' => 'ul', 'reply_text' => __('Reply', 'maera'), 'short_ping' => true, 'avatar_size' => 60);
     $context['site_logo'] = get_option('site_logo', false);
     $context['content_width'] = $content_width;
     $context['sidebar_template'] = maera_templates_sidebar();
     if (class_exists('Easy_Digital_Downloads')) {
         $data['edd_options'] = $edd_options;
         $data['download_categories'] = Timber::get_terms('download_category');
         $data['download_tags'] = Timber::get_terms('download_tag');
         $data['default_image'] = new TimberImage(get_template_directory_uri() . '/assets/images/default.png');
     }
     return apply_filters('maera/timber/context', $context);
 }
Exemplo n.º 2
0
 /**
  * Function to create sitemap.xml file in root directory
  *
  */
 public function create_sitemap($post_id, $post, $update)
 {
     // only create a site map if the post is new or no file exists
     if (wp_is_post_revision($post_id) || is_file($this->path())) {
         // return false;
     }
     $post_types = get_post_types(array('public' => true, 'publicly_queryable' => true));
     $nodes = array();
     $posts = \Timber::get_posts(array('numberposts' => -1, 'orderby' => array('type', 'modified'), 'post_type' => $post_types, 'order' => 'DESC', 'post_status' => 'publish'));
     foreach ($posts as &$post) {
         $nodes[] = array('loc' => $post->link, 'lastmod' => get_post_modified_time('c', false, $post), 'changefreq' => $this->get_post_change_frequency($post), 'priority' => $this->get_priority($post));
     }
     $taxonomies = get_taxonomies(array('public' => true, 'publicly_queryable' => true));
     $terms = \Timber::get_terms(array('taxonomy' => $taxonomies, 'hide_empty' => false));
     foreach ($terms as &$term) {
         $lastest_post = $term->get_post(array('numberposts' => 1));
         $nodes[] = array('loc' => get_term_link($term), 'lastmod' => get_post_modified_time('c', false, $lastest_post), 'changefreq' => $this->change_frequency, 'priority' => $this->get_priority($term));
     }
     $data = array('nodes' => $nodes);
     $sitemap = \Timber::compile('sitemap-xml.twig', $data);
     $path = $this->path();
     if ($fp = fopen($path, 'w')) {
         fwrite($fp, $sitemap);
         fclose($fp);
     }
 }
Exemplo n.º 3
0
 function testGetWithQueryString()
 {
     $other_term = $this->factory->term->create(array('name' => 'Bogus Term'));
     $term_id = $this->factory->term->create(array('name' => 'My Term'));
     $terms = Timber::get_terms('term_id=' . $term_id);
     $this->assertEquals($term_id, $terms[0]->ID);
     $terms = Timber::get_terms('post_tag');
     $this->assertEquals(2, count($terms));
     $terms = Timber::get_terms();
     $this->assertEquals(3, count($terms));
     $terms = Timber::get_terms('categories');
     $this->assertEquals(1, count($terms));
     $terms = Timber::get_terms(array('tag'));
     $this->assertEquals(2, count($terms));
     $query = array('taxonomies' => array('category'));
     $terms = Timber::get_terms($query);
     $this->assertEquals('Uncategorized', $terms[0]->name);
     $query = array('tax' => array('category'));
     $terms = Timber::get_terms($query);
     $this->assertEquals('Uncategorized', $terms[0]->name);
     $query = array('taxs' => array('category'));
     $terms = Timber::get_terms($query);
     $this->assertEquals('Uncategorized', $terms[0]->name);
     $query = array('taxonomy' => array('category'));
     $terms = Timber::get_terms($query);
     $this->assertEquals('Uncategorized', $terms[0]->name);
     $next_term = $this->factory->term->create(array('name' => 'Another Term'));
     $terms = Timber::get_terms('post_tag', 'term_id=' . $next_term);
     $this->assertEquals('Another Term', $terms[0]->name);
     $terms = Timber::get_terms(array($next_term, $term_id));
     $this->assertEquals(2, count($terms));
     $this->assertEquals('My Term', $terms[1]->name);
 }
 function testSubclass()
 {
     $term_ids = array();
     $class_name = 'TimberTermSubclass';
     require_once 'php/timber-term-subclass.php';
     $term_ids[] = $this->factory->term->create();
     $term_ids[] = $this->factory->term->create();
     $term_ids[] = $this->factory->term->create();
     $term_ids[] = $this->factory->term->create();
     $terms = Timber::get_terms($term_ids, $class_name);
     $this->assertEquals($class_name, get_class($terms[0]));
     $terms = false;
     $terms = Timber::get_terms($term_ids, null, $class_name);
     $this->assertEquals($class_name, get_class($terms[0]));
     $terms = false;
     $terms = Timber::get_terms($term_ids, array(), $class_name);
     $this->assertEquals($class_name, get_class($terms[0]));
 }
 /**
  * Modify the Timber global context
  * @param  [type] $context [description]
  * @return [type]          [description]
  */
 function maera_res_context($context)
 {
     $context['currency'] = get_theme_mod('currency', '$');
     $context['facebook_link'] = get_theme_mod('facebook_link', 'http://facebook.com/');
     $context['twitter_link'] = get_theme_mod('twitter_link', 'http://twitter.com/');
     $context['googleplus_link'] = get_theme_mod('googleplus_link', 'http://plus.google.com/');
     $context['youtube_link'] = get_theme_mod('youtube_link', 'http://youtube.com');
     $context['menu_sections'] = Timber::get_terms('restaurant_item_menu_section');
     $context['sidebar']['section_1'] = Timber::get_widgets('section_1');
     $context['sidebar']['section_2'] = Timber::get_widgets('section_2');
     $context['sidebar']['section_3'] = Timber::get_widgets('section_3');
     $context['sidebar']['section_4'] = Timber::get_widgets('section_4');
     $context['sidebar']['section_5'] = Timber::get_widgets('section_5');
     $context['sidebar']['footer'] = Timber::get_widgets('footer');
     if (is_post_type_archive('restaurant_item') && rp_is_restaurant()) {
         $query_args = array('post_type' => 'restaurant_item', 'posts_per_page' => 999, 'order' => get_theme_mod('restaurant_order', 'ASC'), 'order_by' => get_theme_mod('restaurant_order_by', 'ID'));
         $context['menu_item'] = Timber::query_post();
         $context['menu_items'] = Timber::get_posts($query_args);
     }
     return $context;
 }
Exemplo n.º 6
0
<?php

global $s;
$page = get_query_var('paged');
if ($page && $page >= 2) {
    // If we're on a pagination page, we'll add a "Page [page]" to the title, so
    // that SEO services don't complain about duplicate titles
    add_filter('wpseo_title', function ($title) use($page) {
        return $title . " | Page {$page}";
    });
}
Timber::render('templates/blog/search-results.twig', array_merge(Timber::get_context(), array('pagination' => Timber::get_pagination(), 'searchTerm' => $s, 'categories' => Timber::get_terms('category'), 'tags' => Timber::get_terms('tag'), 'results' => Timber::get_posts(array('post_type' => 'post', 's' => $s)))));
<?php

/*
 * Template Name: Issues Archive
 */
$data = Timber::get_context();
$post = new TimberPost();
$issues = Timber::get_terms('issue');
$data['issues'] = $issues;
$data['post'] = $post;
Timber::render('issue-archive.twig', $data);
Exemplo n.º 8
0
<?php

$context = Timber::get_context();
$context = array_merge($context, array('categories' => Timber::get_terms('category'), 'tags' => Timber::get_terms('tag'), 'post_prev' => $context['post']->prev(), 'post_next' => $context['post']->next(), 'relatedPosts' => $context['post']->getRelated(3)));
Timber::render('templates/blog/post.twig', $context);
Exemplo n.º 9
0
//Template initialization
$post = new TimberPost();
$context_holder['post'] = $post;
$parent_data = get_page_parent_title($post);
$context_holder['sidebar_elements'] = array('static/suggeriment.twig', 'baixades.twig', 'links.twig');
$context_holder['links'] = $post->get_field('link');
$context_holder['credits'] = $post->get_field('credit');
$context_holder['parent_title'] = $parent_data['title'];
$context_holder['page_hierarchy'] = wp_list_subpages($parent_data['id']);
//Stats data
$json_path = ABSPATH . "../aparells.json";
$context_holder['stats_aparells'] = json_decode(file_get_contents($json_path));
//Filters population
$context_holder['categories']['sistemesoperatius'] = Timber::get_terms('so_aparell');
$context_holder['categories']['tipus'] = Timber::get_terms('tipus_aparell');
$context_holder['categories']['fabricants'] = Timber::get_terms('fabricant');
//Search and filters
$search = get_query_var('cerca');
$sistema_operatiu = get_query_var('sistema_operatiu');
$tipus_aparell = get_query_var('tipus_aparell');
$fabricant = get_query_var('fabricant');
//Generate $args query
if (!empty($search) || !empty($sistema_operatiu) || !empty($tipus_aparell) || !empty($fabricant)) {
    $query_aparell['s'] = $search;
    $query_aparell['so_aparell'] = $sistema_operatiu;
    $query_aparell['tipus_aparell'] = $tipus_aparell;
    $query_aparell['fabricant'] = $fabricant;
    $args = get_post_query_args('aparell', SearchQueryType::Aparell, $query_aparell);
    $title = 'Aparells - ';
    !empty($search) ? $title .= 'cerca: ' . $search . ' - ' : '';
    !empty($tipus_aparell) ? $title .= 'tipus: ' . get_term_name_by_slug($tipus_aparell, 'tipus_aparell') . ' - ' : '';
Exemplo n.º 10
0
$context['lang_class'] = get_field('language', 'options');
$context['lang_name'] = get_field('language_name', 'options');
$context['ga'] = get_field('google_analytics_code', 'options');
$context['canon'] = get_field('canonical_link', 'options');
$context['usp_title'] = get_field('usp_title', 'options');
$context['menu_item_1'] = get_field('main_menu_item_1', 'options');
$context['menu_item_2'] = get_field('main_menu_item_2', 'options');
$context['menu_item_3'] = get_field('main_menu_item_3', 'options');
$context['footer_text'] = get_field('footer_text', 'options');
$context['intro'] = new TimberPost(39);
// Replace id with proper id for Intro Page.
$context['local'] = new TimberPost(199);
$context['about'] = new TimberPost(35);
$context['trynow'] = new TimberPost(47);
$context['newsletter'] = new TimberPost(104);
$context['usps'] = Timber::get_posts('post_type=usps&post_status=publish&orderby=menu_order&order=ASC');
$context['usps_categories'] = Timber::get_terms('post_tag', array('hide_empty' => false));
$context['testimonials'] = Timber::get_posts('post_type=testimonials&post_status=publish&orderby=menu_order&order=ASC');
$context['support'] = Timber::get_posts('post_type=support&post_status=publish&orderby=menu_order&order=ASC');
$context['menu_eu'] = new TimberMenu('eur_menu');
$context['menu_usa'] = new TimberMenu('usa_menu');
$context['menu_aus'] = new TimberMenu('aus_menu');
$context['menu_afr'] = new TimberMenu('afr_menu');
$context['menu_asi'] = new TimberMenu('asi_menu');
$context['menu_mid'] = new TimberMenu('mid_menu');
$context['menu_other'] = new TimberMenu('other_menu');
$templates = array('index.twig');
if (is_home()) {
    array_unshift($templates, 'home.twig');
}
Timber::render($templates, $context);
Exemplo n.º 11
0
<?php

$page = get_query_var('paged');
if ($page && $page >= 2) {
    // If we're on a pagination page, we'll add a "Page [page]" to the title, so
    // that SEO services don't complain about duplicate titles
    add_filter('wpseo_title', function ($title) use($page) {
        return $title . " | Page {$page}";
    });
}
Timber::render('templates/blog.twig', array_merge(Timber::get_context(), array('page' => new TimberPost('blog'), 'categories' => Timber::get_terms('category'), 'tags' => Timber::get_terms('tag'), 'pagination' => Timber::get_pagination())));
<?php

/**
 * Template Name: Reason Categories
 *
 * Description: An archive listing a few posts from each term in the Recipes Type taxonomy
 *
 */
$context = Timber::get_context();
$post = new TimberPost();
$context['post'] = $post;
// Get the terms from the recipe_type post
$context['types'] = Timber::get_terms('reason_type');
Timber::render(array('page-reasoncategories.twig', 'page.twig'), $context);
Exemplo n.º 13
0
    $data['base'] = 'base-blank.twig';
}
$data['wp_title'] = 'Upstatement - Blog';
$page = 0;
if ($wp_query->query['offset']) {
    $page = $wp_query->query['offset'] / 6 + 1;
}
$data['blog_cron'] = Timber::get_posts();
$sticky = get_option('sticky_posts');
$sticky = TimberHelper::array_truncate($sticky, 4);
if ($page == 0) {
    $featured_query = array('post_type' => 'post', 'numberposts' => 4, 'post__in' => $sticky);
    $data['blog_featured'] = Timber::get_posts($featured_query);
}
$next_query = array('post_type' => 'post', 'numberposts' => 1, 'post__not_in' => $sticky, 'offset' => ($page + 1) * 6);
$data['blog_next'] = Timber::get_posts($next_query);
$data['tags'] = Timber::get_terms('tax=tags&orderby=count&number=20');
shuffle($data['tags']);
$data['tags'] = TimberHelper::array_truncate($data['tags'], 10);
$next_page = $page + 1;
if ($page == 0) {
    $next_page = 2;
}
if (count($data['blog_next'])) {
    $data['next_button_url'] = '/blog/page/' . $next_page;
}
if ($api) {
    Timber::render('mods/archive-blog-loop.twig', $data);
} else {
    Timber::render('archive-blog.twig', $data);
}
Exemplo n.º 14
0
<?php

/**
 * Template Name: Food Categories
 *
 * Description: An archive listing a few posts from each term in the Recipes Type taxonomy
 *
 */
$context = Timber::get_context();
$post = new TimberPost();
$context['post'] = $post;
// Get the terms from the recipe_type post
$context['types'] = Timber::get_terms('food_type');
Timber::render(array('page-foodcategories.twig', 'page.twig'), $context);
Exemplo n.º 15
0
<?php

/*
Template Name: Products
*/
$context = Timber::get_context();
$post = new TimberPost();
$context['post'] = $post;
$categories = Timber::get_terms('product-categories', array('parent' => 0));
$context['categories'] = $categories;
Timber::render(array('page-products.twig', 'page.twig'), $context);
Exemplo n.º 16
0
//Template initialization
$templates = array('archive-programa.twig');
$post_type = get_query_var('post_type');
$post = retrieve_page_data($post_type);
$post ? $context_holder['links'] = $post->get_field('link') : '';
$context_holder['post'] = $post;
$context_holder['content_title'] = 'Programes i aplicacions';
$context_holder['post_type'] = $post_type;
$context_holder['conditions_text'] = get_option('sc_text_programes');
$context_holder['sidebar_top'] = Timber::get_widgets('sidebar_top');
$context_holder['sidebar_bottom'] = Timber::get_widgets('sidebar_bottom');
$context_holder['sidebar_elements'] = array('static/ajudeu.twig', 'static/dubte_forum.twig', 'baixades.twig', 'links.twig');
//Filters population
$context_holder['categories']['sistemes_operatius'] = Timber::get_terms('sistema-operatiu-programa');
$context_holder['categories']['categories_programes'] = Timber::get_terms('categoria-programa');
$context_holder['categories']['llicencies'] = Timber::get_terms('llicencia');
//Search and filters
$search = urldecode(get_query_var('cerca'));
$sistema_operatiu = get_query_var('sistema_operatiu');
$categoria_programa = get_query_var('categoria_programa');
//Generate $args query
$flag_search = false;
$description = 'Programari / Software en català / valencià';
if (!empty($search) || !empty($categoria_programa) || !empty($sistema_operatiu)) {
    $flag_search = true;
    $query['s'] = $search;
    $query['categoria-programa'] = $categoria_programa;
    $query['sistema-operatiu-programa'] = $sistema_operatiu;
    $args = get_post_query_args('programa', SearchQueryType::Programa, $query);
    //Selected values
    $context_holder['cerca'] = $search;
Exemplo n.º 17
0
wp_enqueue_script('sc-js-noticies', get_template_directory_uri() . '/static/js/noticies.js', array('sc-js-main'), WP_SOFTCATALA_VERSION, true);
wp_enqueue_script('sc-js-novetats', get_template_directory_uri() . '/static/js/novetats.js', array('sc-js-main'), WP_SOFTCATALA_VERSION, true);
wp_localize_script('sc-js-novetats', 'scajax', array('ajax_url' => admin_url('admin-ajax.php')));
//Template initialization
$templates = array('index.twig');
is_home() ? array_unshift($templates, 'home.twig') : '';
$post = Timber::query_post(get_option('page_for_posts'));
$context_holder['post'] = $post;
$context_holder['content_title'] = 'Notícies';
$context_holder['links'] = $post->get_field('link');
$context_holder['sidebar_top'] = Timber::get_widgets('sidebar_top');
$context_holder['sidebar_elements'] = array('baixades.twig', 'links.twig');
$context_holder['sidebar_bottom'] = Timber::get_widgets('sidebar_bottom');
//Filters population
$context_holder['categories']['temes'] = Timber::get_terms('category', array('parent' => get_category_id('temes')));
$context_holder['categories']['tipus'] = Timber::get_terms('category', array('parent' => get_category_id('tipus')));
//Search and filters
$search = stripslashes(get_query_var('cerca'));
$tipus = get_query_var('tipus');
$tema = get_query_var('tema');
if (!empty($search) || !empty($tipus) || !empty($tema)) {
    $context_holder['cerca'] = $search;
    $context_holder['selected_tipus'] = $tipus;
    $context_holder['selected_tema'] = $tema;
    $context_holder['title'] = $search;
    $query['s'] = $search;
    $query['categoria'] = array();
    if ($tema) {
        $tema_cat = get_category_by_slug($tema);
        $query['categoria'][] = $tema_cat->term_id;
    }
Exemplo n.º 18
0
<?php

/**
 * Template Name: About Page
 * Description: Page & Team members
 *
 * @package		WordPress
 * @subpackage	Ludens
 * @since 		Ludens 0.1
 */
if (!class_exists('Timber')) {
    echo 'Timber not activated. Make sure you activate the plugin in <a href="/wp-admin/plugins.php#timber">/wp-admin/plugins.php</a>';
    return;
}
$data = Timber::get_context();
$data['page'] = new TimberPost();
// Team
$data['team_members'] = Timber::get_posts('post_type=team&post_status=publish&orderby=menu_order&order=ASC&posts_per_page=-1');
$data['team_categories'] = Timber::get_terms('team-cat');
$holder = array();
$taxonomy = Timber::get_terms('team-cat');
foreach ($taxonomy as $term) {
    ${"args_" . $term->slug} = array('post_type' => 'team', 'orderby' => 'menu_order', 'post_status' => 'publish', 'posts_per_page' => -1, 'tax_query' => array(array('taxonomy' => 'team-cat', 'terms' => $term->term_id)));
    $holder[$term->slug] = Timber::get_posts(${"args_" . $term->slug});
}
$data['holder'] = $holder;
// Quote's
$data['quote'] = Timber::get_post('post_type=quotes&post_status=publish&orderby=rand');
$templates = array('page-about.twig');
Timber::render($templates, $data);
Exemplo n.º 19
0
 function testGetTerms()
 {
     $posts = $this->factory->post->create_many(15, array('post_type' => 'post'));
     $tags = array();
     foreach ($posts as $post) {
         $tag = rand_str();
         wp_set_object_terms($post, $tag, 'post_tag');
         $tags[] = $tag;
     }
     sort($tags);
     $terms = Timber::get_terms('tag');
     $this->assertEquals('TimberTerm', get_class($terms[0]));
     $results = array();
     foreach ($terms as $term) {
         $results[] = $term->name;
     }
     sort($results);
     $this->assertTrue(arrays_are_similar($results, $tags));
     //lets add one more occurance in..
 }
function add_to_context($data)
{
    $data['menu'] = new TimberMenu();
    $data['categories'] = Timber::get_terms('category', 'show_count=0&title_li=&hide_empty=0&exclude=1');
    return $data;
}
<?php

/**
 * Template Name: Recipe Categories
 *
 * Description: An archive listing a few posts from each term in the Recipes Type taxonomy
 *
 */
$context = Timber::get_context();
$post = new TimberPost();
$context['post'] = $post;
// Get the terms from the recipe_type post
$context['types'] = Timber::get_terms('recipe_type');
Timber::render(array('page-recipe_categories.twig', 'page.twig'), $context);
Exemplo n.º 22
0
$data = Timber::get_context();
global $wp_query;
$api = false;
if (isset($_GET['api'])) {
    $api = $_GET['api'];
}
$data['base'] = 'base.twig';
if ($api) {
    $data['base'] = 'base-blank.twig';
}
$page = 0;
if ($wp_query->query_vars['paged']) {
    $page = $wp_query->query_vars['paged'];
}
$term = new TimberTerm();
$data['title'] = "Archives for " . $term->name;
$data['blog_cron'] = Timber::get_posts();
$data['tags'] = Timber::get_terms(array('tax' => 'tags', 'orderby' => 'count'));
shuffle($data['tags']);
$data['tags'] = TimberHelper::array_truncate($data['tags'], 10);
$next_page = $page + 1;
if ($page == 0) {
    $next_page = 2;
}
if ($api) {
    Timber::render('archive-blog-loop.twig', $data);
} else {
    $data['sidebar'] = Timber::get_sidebar('sidebar.php');
    Timber::render('archive-blog.twig', $data);
}
//JS and Styles related to the page
wp_enqueue_script('sc-js-esdeveniments', get_template_directory_uri() . '/static/js/esdeveniments.js', array('sc-js-main'), WP_SOFTCATALA_VERSION, true);
wp_enqueue_script('sc-js-novetats', get_template_directory_uri() . '/static/js/novetats.js', array('sc-js-main'), WP_SOFTCATALA_VERSION, true);
wp_localize_script('sc-js-novetats', 'scajax', array('ajax_url' => admin_url('admin-ajax.php')));
//Template initialization
$templates = array('archive-esdeveniment.twig');
$post = Timber::query_post(get_option('page_for_posts'));
$context_holder['post'] = $post;
$context_holder['content_title'] = 'Esdeveniments';
$context_holder['links'] = $post->get_field('link');
$context_holder['sidebar_top'] = Timber::get_widgets('sidebar_top');
$context_holder['sidebar_elements'] = array('baixades.twig', 'links.twig');
$context_holder['sidebar_bottom'] = Timber::get_widgets('sidebar_bottom');
//Filters population
$context_holder['cat_link'] = get_category_link(get_query_var('esdeveniment_cat'));
$context_holder['categories']['temes'] = Timber::get_terms('esdeveniment_cat');
$context_holder['filters'] = get_the_event_filters();
//Search and filters
$search = get_query_var('cerca');
$tema = get_query_var('tema');
$filter = get_query_var('data');
$filterdate = get_final_time($filter);
//Generate $args query
if (!empty($search) || !empty($tema) || !empty($filter)) {
    $search_args = get_post_query_args('esdeveniment', SearchQueryType::Search, $search);
    $args = wp_parse_args($search_args, $wp_query->query);
    //search + active args
    $date_filter_args = get_post_query_args('esdeveniment', SearchQueryType::FilteredDate, $filterdate);
    $args = wp_parse_args($date_filter_args, $args);
    //all filters applied
    $date_filter_args = get_post_query_args('esdeveniment', SearchQueryType::FilteredTema, $tema);
Exemplo n.º 24
0
<?php

/*
Template Name: Produkte
*/
$context = Timber::get_context();
$post = new TimberPost();
$context['post'] = $post;
$categories = Timber::get_terms('produkt-kategorie', array('parent' => 0));
$context['categories'] = $categories;
Timber::render(array('page-produkte.twig', 'page.twig'), $context);