<?php



add_filter('timber/context', function($context) {

    $categories = get_categories();
    $current_category = get_queried_object();

    if (isset($current_category) && !is_wp_error($current_category) && !empty($current_category->name)) {
        $category_name = $current_category->name;
    } else {
        $category_name = null;
    }

    $context['category_list'] = $categories;
    $context['current_category'] = $category_name;
    return $context;
});


