diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..1a5f6c9 --- /dev/null +++ b/robots.txt @@ -0,0 +1,79 @@ +User-agent: * +Disallow: /cgi-bin +Disallow: /? +Disallow: /wp- +Disallow: /wp/ +Disallow: *?s= +Disallow: *&s= +Disallow: /search/ +Disallow: /author/ +Disallow: /users/ +Disallow: */trackback +Disallow: */feed +Disallow: */rss +Disallow: */embed +Disallow: */wlwmanifest.xml +Disallow: /xmlrpc.php +Allow: */uploads +Sitemap: https://cosmopet.ru/sitemap_index.xml + +User-agent: GoogleBot +Disallow: /cgi-bin +Disallow: /? +Disallow: /wp- +Disallow: /wp/ +Disallow: *?s= +Disallow: *&s= +Disallow: /search/ +Disallow: /author/ +Disallow: /users/ +Disallow: */trackback +Disallow: */feed +Disallow: */rss +Disallow: */embed +Disallow: */wlwmanifest.xml +Disallow: /xmlrpc.php +Disallow: *utm*= +Disallow: *etext*= +Disallow: *?add-to-cart* +Disallow: *?per_page* +Disallow: *?per_row* +Disallow: *openstat= +Allow: */uploads +Allow: /*/*.js +Allow: /*/*.css +Allow: /wp-*.png +Allow: /wp-*.jpg +Allow: /wp-*.jpeg +Allow: /wp-*.gif +Allow: /wp-admin/admin-ajax.php +Sitemap: https://cosmopet.ru/sitemap_index.xml + +User-agent: Yandex +Disallow: /cgi-bin +Disallow: /? +Disallow: /wp- +Disallow: /wp/ +Disallow: *?s= +Disallow: *&s= +Disallow: /search/ +Disallow: /author/ +Disallow: /users/ +Disallow: */trackback +Disallow: */feed +Disallow: */rss +Disallow: */embed +Disallow: */wlwmanifest.xml +Disallow: /xmlrpc.php +Allow: */uploads +Allow: /*/*.js +Allow: /*/*.css +Allow: /wp-*.png +Allow: /wp-*.jpg +Allow: /wp-*.jpeg +Allow: /wp-*.gif +Allow: /wp-admin/admin-ajax.php +Sitemap: https://cosmopet.ru/sitemap_index.xml + +Clean-Param: utm_source&utm_medium&utm_campaign&etext&add-to-cart&per_page&per_row&from&attribute_pa_weight&attribute_pa_ves-upakovki +Clean-Param: openstat \ No newline at end of file diff --git a/wp-content/themes/cosmopet/functions.php b/wp-content/themes/cosmopet/functions.php index f2efb6b..a67ebb0 100644 --- a/wp-content/themes/cosmopet/functions.php +++ b/wp-content/themes/cosmopet/functions.php @@ -424,7 +424,7 @@ requireShortcodes(get_template_directory() . '/modules'); require_once('modules/blog/module-ajax-controller.php'); require_once('modules/forms/module-ajax-controller.php'); require_once('modules/shop/module-ajax-controller.php'); - +require_once('modules/profile/module-ajax-controller.php'); add_action('wp', 'my_custom_checkout_code'); @@ -1195,3 +1195,40 @@ function remove_woocommerce_styles_on_checkout() { } } +// Отключаем канонические ссылки и hreflang от Yoast SEO +add_filter('wpseo_canonical', '__return_false'); +add_filter('wpseo_opengraph_url', '__return_false'); // Отключаем OG URL +add_filter('wpseo_add_x_default_hreflang', '__return_false'); // Отключаем hreflang от Yoast +add_filter('wpseo_disable_adjacent_rel_links', '__return_true'); // Отключаем соседние rel-ссылки + +// Добавляем каноническую ссылку +add_action('wp_head', 'custom_canonical_url', 5); +function custom_canonical_url() { + // Защищаем от дублирования + static $canonical_added = false; + if ($canonical_added) { + return; + } + $canonical_added = true; + + $current_url = home_url(add_query_arg('', $_SERVER['REQUEST_URI'])); + echo '' . "\n"; +} + +// Добавляем hreflang теги для cosmopet.shop +add_action('wp_head', 'custom_hreflang_shop', 6); +function custom_hreflang_shop() { + // Защищаем от дублирования + static $hreflang_added = false; + if ($hreflang_added) { + return; + } + $hreflang_added = true; + + $current_path = add_query_arg('', $_SERVER['REQUEST_URI']); + $ru_domain = 'https://cosmopet-test-ru.cp.good-production.xyz'; + $en_domain = 'https://cosmopet-test-ae.cp.good-production.xyz'; + + echo '' . "\n"; + echo '' . "\n"; +} \ No newline at end of file diff --git a/wp-content/themes/cosmopet/global-functions/core-functions.php b/wp-content/themes/cosmopet/global-functions/core-functions.php index a4abe2d..2638d0c 100644 --- a/wp-content/themes/cosmopet/global-functions/core-functions.php +++ b/wp-content/themes/cosmopet/global-functions/core-functions.php @@ -1,2 +1,174 @@ array( + 'name' => 'Питомцы', // Основное название типа записи + 'singular_name' => 'Питомец', // отдельное название записи типа Book + 'add_new' => 'Добавить нового', + 'add_new_item' => 'Добавить нового питомца', + 'edit_item' => 'Редактировать питомца', + 'new_item' => 'Новый питомец', + 'view_item' => 'Посмотреть питомца', + 'search_items' => 'Найти питомца', + 'not_found' => 'Питомцев не найдено', + 'not_found_in_trash' => 'В корзине книг не найдено', + 'parent_item_colon' => '', + 'menu_name' => 'Питомцы' + + ), + 'public' => false, + 'show_ui' => true, + 'supports' => array('title','editor') +) ); +} + +function get_pet_card($item){ +?> + +
:
+ +:
+ +:
+ +:
+ +:
+ +:
- -:
- -:
- -:
- -:
- -{{ function('get_the_title', pet_id) }}
+{{ __('Breed', 'woodmart') }}:
+{{ function('get_field', 'breed', pet_id) }}
+{{ __('Weight', 'woodmart') }}:
+{{ w }}
+{{ __('Age', 'woodmart') }}:
+{{ old }}
+{{ __('Birhtday', 'woodmart') }}:
++ {{ function('get_field', 'day', pet_id) }}.{{ zero }}{{ month }}.{{ function('get_field', 'year', pet_id) }} +
+{{ __('Activity', 'woodmart') }}:
+{{ act }}
+{{ __('Sterilized', 'woodmart') }}
+{{ __('Edit pet', 'woodmart') }} {{ post.post_title }}
+ + +{{ function('pll_e', 'Summary') }}:
-{{ order.total }}
+{{ order.get_total() }}
{{ item.name }}
{{ item.quantity }}
-{{ item.total }}
+{{ item.total }} {{ function('get_woocommerce_currency_symbol', code) }}
{{ function('pll_e', 'Weight') }}:
-{{ pet.weight_text }}
-{{ function('pll_e', 'Age') }}:
-{{ pet.old_text }}
-{{ function('pll_e', 'Activity') }}:
-{{ pet.activity_text }}
-{{ function('pll_e', 'Edit pet') }} {{ pet.title }}
+Добавить питомца
-