← Back
Editing: footer_infos.php
<?php // [barvent] product ichiga kirganda cat raqamini page ID siga bog'lagan holda page ichidage fieldlarni olish uchun ID raqamlar. $categories = get_the_category(); $category_id = !empty($categories) ? $categories[0]->cat_ID : 0; $footeri = [ 48 => 80, 50 => 80, 52 => 84, 54 => 84, 56 => 95, 58 => 95, 60 => 97, 62 => 97, 148 => 93, 150 => 93, ]; if (isset($footeri[$category_id])) { $address = get_field('address_' . $GLOBALS['TIL'], 49); } else { if (mb_stripos($_SERVER['REQUEST_URI'], '/asda') !== false || mb_stripos($_SERVER['REQUEST_URI'], '/products') !== false || mb_stripos($_SERVER['REQUEST_URI'], '/en/products') !== false || mb_stripos($_SERVER['REQUEST_URI'], '/barvent/informatsiya') !== false || mb_stripos($_SERVER['REQUEST_URI'], '/en/barvent/information') !== false || in_array($category_id, [38,40])) { $address = get_field('address_asda_' . $GLOBALS['TIL'], 49); } else { $address = get_field('address_' . $GLOBALS['TIL'], 49); } } if (isset($footeri[$category_id])) { $location = get_field('location-barvent', 49); } else { if (mb_stripos($_SERVER['REQUEST_URI'], '/asda') !== false || mb_stripos($_SERVER['REQUEST_URI'], '/products') !== false || mb_stripos($_SERVER['REQUEST_URI'], '/en/products') !== false || mb_stripos($_SERVER['REQUEST_URI'], '/barvent/informatsiya') !== false || mb_stripos($_SERVER['REQUEST_URI'], '/en/barvent/information') !== false || in_array($category_id, [38,40])) { $location = get_field('location-asda', 49); } else { $location = get_field('location-barvent', 49); } } if (isset($footeri[$category_id]) && get_field('email', $footeri[$category_id])) { $email = get_field('email', $footeri[$category_id]); } else { if (in_array($category_id, [15, 17])) { $email = get_field('email_asda', 49); } else { $email = get_field('email', 49); } }
Save File
Cancel