diff --git a/wp-content/themes/cosmopet/modules/static-pages/new-front-page copy/template-new-front-page.php b/wp-content/themes/cosmopet/modules/static-pages/new-front-page copy/template-new-front-page.php new file mode 100644 index 0000000..5b2108f --- /dev/null +++ b/wp-content/themes/cosmopet/modules/static-pages/new-front-page copy/template-new-front-page.php @@ -0,0 +1,129 @@ + '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); + + // + + $context['food_list'] = get_field('featured_food'); + $context['treats_list'] = get_field('featured_treats'); +} + +try { + Timber::render('_pages/new-front-page.twig', $context); // Рендерим отдельный Twig-шаблон +} catch (Exception $e) { + error_log('Ошибка рендеринга: ' . $e->getMessage()); + echo 'Произошла ошибка при рендеринге шаблона. Проверь логи: ' . $e->getMessage(); +} +?> \ No newline at end of file diff --git a/wp-content/themes/cosmopet/views/_pages/about.twig b/wp-content/themes/cosmopet/views/_pages/about.twig index e0a8047..7e8fb54 100644 --- a/wp-content/themes/cosmopet/views/_pages/about.twig +++ b/wp-content/themes/cosmopet/views/_pages/about.twig @@ -22,7 +22,7 @@
Due to the unique structure of the entoprotein, it is unlikely to cause allergies. Additionally, since animals have not encountered this type of protein during evolution, it does not trigger allergic reactions in pets.
+{{adv_text}}
{{ item.text }}
{% endfor %} - {% if site_region == 'ru' %} -COSMOPET PRODUCTION IS BASED ON A UNIQUE TECHNOLOGICAL PROCESS WHICH HAS NO ANALOGUES IN THE WORLD.
- {% endif %}