%PDF- %PDF-
Direktori : /var/www/knwn/wp-content/themes/kn-wn/ |
Current File : //var/www/knwn/wp-content/themes/kn-wn/front-page.php |
<?php /** * The main template file * This is the most generic template file in a WordPress theme * and one of the two required files for a theme (the other being style.css). * It is used to display a page when nothing more specific matches a query. * E.g., it puts together the home page when no home.php file exists * * Methods for TimberHelper can be found in the /lib sub-directory * * @package WordPress * @subpackage Timber * @since Timber 0.1 */ $context = Timber::context(); $context['post'] = new TimberPost(); $context['posts'] = new Timber\PostQuery(); $context['found_assets'] = Timber::get_posts(array( 'numberposts' => -1, 'post_type' => 'assets', 'orderby' => 'menu_order', 'order' => 'ASC' )); $context['assets'] = Timber::get_posts(array( 'numberposts' => get_field('homepage_assets_quantity', 'options'), 'post_type' => 'assets', 'orderby' => 'menu_order', 'order' => 'ASC' )); $context['news'] = Timber::get_posts(array( 'numberposts' => 4, 'post_type' => 'post', 'orderby' => 'date', 'order' => 'DESC' )); $context['positions'] = Timber::get_posts(array( 'numberposts' => -1, 'post_type' => 'joinus', 'orderby' => 'menu_order', 'order' => 'ASC' )); $context['tax_filter']['target_group'] = Timber::get_terms('target_group'); $context['tax_filter']['asset_locations'] = Timber::get_terms('asset_locations'); $context['tax_filter']['status'] = [ [ 'label' => 'LIVE', 'value' => 'live' ], [ 'label' => 'SOON LIVE', 'value' => 'soon' ], ]; $templates = array( 'front-page.twig' ); Timber::render( $templates, $context );