From 2cc35d864d6ccbcd1d9733f1792ebac40da43742 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 24 Jul 2025 16:47:14 +0300 Subject: [PATCH] =?UTF-8?q?Andrei=20|=20=D0=B2=D0=BE=D1=81=D1=81=D1=82?= =?UTF-8?q?=D0=B0=D0=BD=D0=BE=D0=B2=D0=B8=D0=BB=20=D0=BD=D0=B5=D0=BE=D0=B1?= =?UTF-8?q?=D1=85=D0=BE=D0=B4=D0=B8=D0=BC=D1=83=D1=8E=20=D1=84=D1=83=D0=BD?= =?UTF-8?q?=D0=BA=D1=86=D0=B8=D1=8E=20get=5Fpage=5Ftype=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20pixel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../global-functions/multisite-functions.php | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) 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'; + } +}