diff --git a/wp-content/themes/cosmopet/global-functions/multisite-functions.php b/wp-content/themes/cosmopet/global-functions/multisite-functions.php index bdc58f0..8140955 100644 --- a/wp-content/themes/cosmopet/global-functions/multisite-functions.php +++ b/wp-content/themes/cosmopet/global-functions/multisite-functions.php @@ -400,4 +400,25 @@ add_action('wp_head', function() { // Рендерим шаблон \Timber\Timber::render('templates/head-pixel-functions.twig', $context); } -}); \ No newline at end of file +}); + + +function get_page_type() { + if (is_home() || is_front_page()) { + return 'home'; + } elseif (is_shop()) { + return 'shop'; + } elseif (is_product_category()) { + return 'category'; + } elseif (is_product_tag()) { + return 'tag'; + } elseif (is_search()) { + return 'search'; + } elseif (is_cart()) { + return 'cart'; + } elseif (is_account_page()) { + return 'account'; + } else { + return 'other'; + } +}