diff --git a/wp-content/themes/cosmopet/templates/about/template-about.php b/wp-content/themes/cosmopet/modules/static-pages/about/template-about.php similarity index 92% rename from wp-content/themes/cosmopet/templates/about/template-about.php rename to wp-content/themes/cosmopet/modules/static-pages/about/template-about.php index cfd3778..15e5d29 100644 --- a/wp-content/themes/cosmopet/templates/about/template-about.php +++ b/wp-content/themes/cosmopet/modules/static-pages/about/template-about.php @@ -34,6 +34,6 @@ $context['e_title'] = get_field('e-title'); $context['e_points'] = get_field('e-points'); $context['faq'] = get_field('faq'); -Timber::render('templates/about/about.twig', $context); +Timber::render('_pages/about.twig', $context); ?> diff --git a/wp-content/themes/cosmopet/templates/front-page/template-front-page.php b/wp-content/themes/cosmopet/modules/static-pages/front-page/template-front-page.php similarity index 95% rename from wp-content/themes/cosmopet/templates/front-page/template-front-page.php rename to wp-content/themes/cosmopet/modules/static-pages/front-page/template-front-page.php index 2d76143..faba9e7 100644 --- a/wp-content/themes/cosmopet/templates/front-page/template-front-page.php +++ b/wp-content/themes/cosmopet/modules/static-pages/front-page/template-front-page.php @@ -7,7 +7,7 @@ diff --git a/wp-content/themes/cosmopet/templates/production/template-prod-page.php b/wp-content/themes/cosmopet/modules/static-pages/production/template-prod-page.php similarity index 88% rename from wp-content/themes/cosmopet/templates/production/template-prod-page.php rename to wp-content/themes/cosmopet/modules/static-pages/production/template-prod-page.php index f5980cb..67a4370 100644 --- a/wp-content/themes/cosmopet/templates/production/template-prod-page.php +++ b/wp-content/themes/cosmopet/modules/static-pages/production/template-prod-page.php @@ -23,6 +23,6 @@ $context['desc'] = get_field('desc'); $context['steps_1'] = get_field('steps_1'); $context['steps_2'] = get_field('steps_2'); -Timber::render('templates/production/production.twig', $context); +Timber::render('_pages/production.twig', $context); ?> diff --git a/wp-content/themes/cosmopet/templates/where_to_buy/template_wtb.php b/wp-content/themes/cosmopet/modules/static-pages/where_to_buy/template_wtb.php similarity index 96% rename from wp-content/themes/cosmopet/templates/where_to_buy/template_wtb.php rename to wp-content/themes/cosmopet/modules/static-pages/where_to_buy/template_wtb.php index 2fe3ee0..7bed31f 100644 --- a/wp-content/themes/cosmopet/templates/where_to_buy/template_wtb.php +++ b/wp-content/themes/cosmopet/modules/static-pages/where_to_buy/template_wtb.php @@ -132,5 +132,5 @@ $context['partners_logos'] = $partners_logos_formatted; add_filter('wpcf7_autop_or_not', '__return_false'); // Рендеринг шаблона -Timber::render('templates/where_to_buy/wtb.twig', $context); +Timber::render('_pages/wtb.twig', $context); ?> \ No newline at end of file diff --git a/wp-content/themes/cosmopet/temp-functions/modules-logic.php b/wp-content/themes/cosmopet/temp-functions/modules-logic.php index a22d09a..57e3cbe 100644 --- a/wp-content/themes/cosmopet/temp-functions/modules-logic.php +++ b/wp-content/themes/cosmopet/temp-functions/modules-logic.php @@ -217,7 +217,7 @@ function include_module($module_name) { */ add_filter('theme_page_templates', function ($templates) { // Путь к папке с шаблонами - $custom_templates_dir = get_template_directory() . '/templates/'; + $custom_templates_dir = get_template_directory() . '/modules/static-pages/'; // Ищем ВСЕ PHP-файлы в /templates/ и подпапках $all_templates = new RecursiveIteratorIterator( @@ -237,7 +237,7 @@ add_filter('theme_page_templates', function ($templates) { $template_name = str_replace(['/', '.php'], [' - ', ''], $relative_path); // Добавляем в список шаблонов - $templates['templates/' . $relative_path] = $template_name; + $templates['/modules/static-pages/' . $relative_path] = $template_name; } return $templates; diff --git a/wp-content/themes/cosmopet/templates/about/about.twig b/wp-content/themes/cosmopet/templates/_pages/about.twig similarity index 100% rename from wp-content/themes/cosmopet/templates/about/about.twig rename to wp-content/themes/cosmopet/templates/_pages/about.twig diff --git a/wp-content/themes/cosmopet/templates/front-page/front-page.twig b/wp-content/themes/cosmopet/templates/_pages/front-page.twig similarity index 100% rename from wp-content/themes/cosmopet/templates/front-page/front-page.twig rename to wp-content/themes/cosmopet/templates/_pages/front-page.twig diff --git a/wp-content/themes/cosmopet/templates/production/production.twig b/wp-content/themes/cosmopet/templates/_pages/production.twig similarity index 100% rename from wp-content/themes/cosmopet/templates/production/production.twig rename to wp-content/themes/cosmopet/templates/_pages/production.twig diff --git a/wp-content/themes/cosmopet/templates/where_to_buy/wtb.twig b/wp-content/themes/cosmopet/templates/_pages/wtb.twig similarity index 100% rename from wp-content/themes/cosmopet/templates/where_to_buy/wtb.twig rename to wp-content/themes/cosmopet/templates/_pages/wtb.twig diff --git a/wp-content/themes/cosmopet/templates/archive-product/archive-product-ajaxload.twig b/wp-content/themes/cosmopet/templates/archive-product/archive-product-ajaxload.twig new file mode 100644 index 0000000..7b476ec --- /dev/null +++ b/wp-content/themes/cosmopet/templates/archive-product/archive-product-ajaxload.twig @@ -0,0 +1,9 @@ +{% for post in posts %} + {% include 'archive-product/archive-product-tease.twig' with {post: post} %} +{% endfor %} + +{% if not ended %} + +{% endif %} \ No newline at end of file diff --git a/wp-content/themes/cosmopet/templates/archive-product/archive-product-tease.twig b/wp-content/themes/cosmopet/templates/archive-product/archive-product-tease.twig new file mode 100644 index 0000000..8bb76ab --- /dev/null +++ b/wp-content/themes/cosmopet/templates/archive-product/archive-product-tease.twig @@ -0,0 +1,121 @@ +{% if post.id is defined and post.id %} + {% set cur_product = fn('wc_get_product', post.id) %} + {% set attrs = post.product.get_attributes() %} + {% set cur_weight = function('get_product_info', post.id, 'weight') %} + +
{{ post._price() }} {{ fn('get_woocommerce_currency_symbol') }}
+