0 ) ? get_permalink( wc_get_page_id( 'shop' ) ) : home_url( '/shop' ); // تشخیص صفحه جاری برای active state ناوبری موبایل $current_url = home_url( add_query_arg( null, null ) ); $is_home = is_front_page() && is_home(); $is_shop_page = ( function_exists( 'is_shop' ) && is_shop() ) || ( function_exists( 'is_product_category' ) && is_product_category() ); $is_cart_or_checkout = ( function_exists( 'is_cart' ) && is_cart() ) || ( function_exists( 'is_checkout' ) && is_checkout() ); $is_account = ( function_exists( 'is_account_page' ) && is_account_page() ); // خواندن تنظیمات تم $footer_phone = get_option( 'motayeb_contact_phone', '021-12345678' ); $footer_email = get_option( 'motayeb_contact_email', get_option( 'admin_email' ) ); $footer_address = get_option( 'motayeb_contact_address', 'تهران، ایران' ); $footer_instagram = get_option( 'motayeb_social_instagram', '' ); $footer_telegram = get_option( 'motayeb_social_telegram', '' ); $footer_twitter = get_option( 'motayeb_social_twitter', '' ); $samandehi_url = get_option( 'motayeb_samandehi_url', '' ); $enamad_url = get_option( 'motayeb_enamad_url', '' ); // لینک‌های خدمات مشتریان از صفحات وردپرس $faq_page_id = get_option( 'motayeb_page_faq', 0 ); $return_page_id = get_option( 'motayeb_page_return', 0 ); $shipping_page_id = get_option( 'motayeb_page_shipping', 0 ); $privacy_page_id = get_option( 'motayeb_page_privacy', 0 ); $terms_page_id = get_option( 'motayeb_page_terms', 0 ); $about_page_id = get_option( 'motayeb_page_about', 0 ); $contact_page_id = get_option( 'motayeb_page_contact', 0 ); // تبدیل ID صفحه به URL (با fallback) function motayeb_page_url( $page_id, $fallback = '#' ) { if ( $page_id && get_post( $page_id ) ) { return get_permalink( $page_id ); } return $fallback; } // دسته‌بندی‌های فوتر با cache $footer_cats_cache_key = 'motayeb_footer_categories'; $footer_cats = get_transient( $footer_cats_cache_key ); if ( false === $footer_cats ) { $footer_cats = get_terms( array( 'taxonomy' => 'product_cat', 'hide_empty' => false, 'parent' => 0, 'number' => 5, 'orderby' => 'count', 'order' => 'DESC', ) ); if ( ! is_wp_error( $footer_cats ) ) { set_transient( $footer_cats_cache_key, $footer_cats, DAY_IN_SECONDS ); } } ?>
'https://schema.org', '@type' => 'WPFooter', 'url' => home_url( '/' ), 'name' => get_bloginfo( 'name' ), 'description' => get_bloginfo( 'description' ), 'publisher' => array( '@type' => 'Organization', 'name' => get_bloginfo( 'name' ), 'url' => home_url( '/' ), ), ); if ( $footer_email ) { $footer_schema['publisher']['email'] = $footer_email; } if ( $footer_phone ) { $footer_schema['publisher']['telephone'] = $footer_phone; } if ( $footer_address ) { $footer_schema['publisher']['address'] = array( '@type' => 'PostalAddress', 'streetAddress' => $footer_address, 'addressCountry'=> 'IR', ); } echo ''; ?>