'p_reviews', 'numberposts' => -1, 'meta_key' => 'food_enable', 'meta_value' => true, 'meta_compare' => '=' )); $reviews_treats_query = get_posts(array( 'post_type' => 'p_reviews', 'numberposts' => -1, 'meta_key' => 'treats_enable', 'meta_value' => true, 'meta_compare' => '=' )); $context = Timber::context(); if (function_exists('get_field')) { //products $context['reviews_treats_query'] = $reviews_treats_query; $context['reviews_food_query'] = $reviews_food_query; // main $context['main_slider'] = get_field('main_slider'); // about $context['main_about_title'] = get_field('main_about-title'); $context['main_about_image'] = get_field('main_about-image'); $context['main_about_text'] = get_field('main_about-text'); $context['main_about_banner_bg'] = get_field('main_about-banner-bg'); $context['main_about_banner_title'] = get_field('main_about-banner-title'); $context['main_about_banner_descr'] = get_field('main_about-banner-descr'); // why $context['main_why_title'] = get_field('main_why-title'); $context['main_why_items'] = get_field('main_why-items'); $context['main_why_text'] = get_field('main_why-text'); $context['main_why_logos'] = get_field('main_why-logos'); // ingredients $context['main_ingredients_title'] = get_field('main_ingredients-title'); $context['main_ingredients_slider'] = get_field('main_ingredients-slider'); // specialists $context['main_specialists_title'] = get_field('main_specialists-title'); $context['main_specialists_items'] = get_field('main_specialists-items'); // cosmopetx $context['other_post'] = Timber::get_post(383); // Загружаем пост с ID 383 //quiz $context['q_title'] = get_field('q_title'); $context['reviews_title'] = get_field('reviews_title'); $context['q_1'] = get_field('q_1', 383); $context['q_2'] = get_field('q_2', 383); $context['q_3'] = get_field('q_3', 383); $context['q_4'] = get_field('q_4', 383); $context['q_5'] = get_field('q_5', 383); // $array_food = array(); foreach (get_field('featured_food') as $item) { $array_food[] = Timber::get_post($item['product']); } $array_treats = array(); foreach (get_field('featured_treats') as $item) { $array_treats[] = Timber::get_post($item['product']); } $context['food_list'] = $array_food; $context['treats_list'] = $array_treats; } try { Timber::render('_pages/new-front-page.twig', $context); // Рендерим отдельный Twig-шаблон } catch (Exception $e) { error_log('Ошибка рендеринга: ' . $e->getMessage()); echo 'Произошла ошибка при рендеринге шаблона. Проверь логи: ' . $e->getMessage(); } ?>