feat(theme): implement multi-language support and enhanced customizer

Introduce comprehensive localization capabilities and expanded theme
customization options for the ifnex theme.

- Add Polylang-compatible language switching logic and UI components
- Implement LTR/RTL direction handling based on active language
- Add new Customizer sections for logo management and language settings
- Add localized content support for Hero section and site metadata
- Refactor template files (header, footer, single, front-page) to use
  translation functions and dynamic content
- Add support for custom logo images via WordPress Customizer
- Implement new archive template and improved single post layout
- Update CSS to handle English (LTR) mode and language-specific styling
This commit is contained in:
Kazem Alghasi 2026-08-09 02:25:01 +03:30
parent 56244f14fa
commit 1f70fe5ee0
8 changed files with 1387 additions and 259 deletions

View File

@ -0,0 +1,119 @@
<?php get_header(); ?>
<?php
$blog_title = ifnex_t(
ifnex_get_option('blog_title', 'اخبار و مقالات'),
ifnex_get_option('blog_title_en', 'News & Articles')
);
$blog_subtitle = ifnex_t(
'آخرین اخبار، مقالات و راهنماهای لجستیک بین‌المللی',
'Latest news, articles and international logistics guides'
);
?>
<!-- Blog Header -->
<section class="blog-hero">
<div class="blog-hero-bg"></div>
<div class="container">
<div class="blog-hero-content">
<span class="section-label"><?php echo ifnex_t('بلاگ IFNEX', 'IFNEX Blog'); ?></span>
<h1 class="blog-hero-title"><?php echo esc_html($blog_title); ?></h1>
<p class="blog-hero-subtitle"><?php echo esc_html($blog_subtitle); ?></p>
</div>
</div>
</section>
<!-- Blog Posts Grid -->
<section class="blog-section">
<div class="container">
<?php if (have_posts()) : ?>
<div class="blog-grid">
<?php while (have_posts()) : the_post(); ?>
<article <?php post_class('blog-card'); ?>>
<?php if (has_post_thumbnail()) : ?>
<a href="<?php the_permalink(); ?>" class="blog-card-image">
<?php the_post_thumbnail('medium_large', ['alt' => get_the_title()]); ?>
</a>
<?php else : ?>
<a href="<?php the_permalink(); ?>" class="blog-card-image blog-card-image-placeholder">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" width="48" height="48">
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"/>
<circle cx="8.5" cy="8.5" r="1.5"/>
<polyline points="21 15 16 10 5 21"/>
</svg>
</a>
<?php endif; ?>
<div class="blog-card-content">
<div class="blog-card-meta">
<span class="blog-card-date">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14">
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"/>
<line x1="16" y1="2" x2="16" y2="6"/>
<line x1="8" y1="2" x2="8" y2="6"/>
<line x1="3" y1="10" x2="21" y2="10"/>
</svg>
<?php echo get_the_date(); ?>
</span>
<?php
$categories = get_the_category();
if (!empty($categories)) : ?>
<span class="blog-card-category"><?php echo esc_html($categories[0]->name); ?></span>
<?php endif; ?>
</div>
<h2 class="blog-card-title">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</h2>
<p class="blog-card-excerpt">
<?php echo wp_trim_words(get_the_excerpt(), 20, '...'); ?>
</p>
<a href="<?php the_permalink(); ?>" class="blog-card-link">
<?php echo ifnex_t('ادامه مطلب', 'Read more'); ?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14">
<line x1="19" y1="12" x2="5" y2="12"/>
<polyline points="12 19 5 12 12 5"/>
</svg>
</a>
</div>
</article>
<?php endwhile; ?>
</div>
<!-- Pagination -->
<div class="blog-pagination">
<?php
the_posts_pagination([
'mid_size' => 2,
'prev_text' => ifnex_t('قبلی', 'Previous'),
'next_text' => ifnex_t('بعدی', 'Next'),
'class' => 'pagination-links',
]);
?>
</div>
<?php else : ?>
<div class="blog-empty">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" width="80" height="80">
<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>
<polyline points="14 2 14 8 20 8"/>
<line x1="16" y1="13" x2="8" y2="13"/>
<line x1="16" y1="17" x2="8" y2="17"/>
<polyline points="10 9 9 9 8 9"/>
</svg>
<h2><?php echo ifnex_t('هنوز پستی منتشر نشده', 'No posts yet'); ?></h2>
<p><?php echo ifnex_t('به زودی اخبار و مقالات جدید منتشر خواهد شد.', 'New articles will be published soon.'); ?></p>
<a href="<?php echo esc_url(home_url('/')); ?>" class="btn btn-primary">
<?php echo ifnex_t('بازگشت به صفحه اصلی', 'Back to home'); ?>
</a>
</div>
<?php endif; ?>
</div>
</section>
<?php get_footer(); ?>

View File

@ -1,3 +1,5 @@
</main><!-- /.site-main -->
<!-- Footer -->
<footer class="site-footer">
<div class="container">
@ -5,25 +7,18 @@
<!-- Brand -->
<div class="footer-brand">
<a href="<?php echo esc_url(home_url('/')); ?>" class="logo">
<div class="logo-icon">
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z" fill="none" stroke="white" stroke-width="1.5"/>
<polyline points="3.27 6.96 12 12.01 20.73 6.96" fill="none" stroke="white" stroke-width="1.5"/>
<line x1="12" y1="22.08" x2="12" y2="12" stroke="white" stroke-width="1.5"/>
</svg>
</div>
<div class="logo-text">
<span class="logo-name">IFNEX<span>Global Logistics</span></span>
<span class="logo-tagline">حمل و نقل بین‌المللی</span>
</div>
</a>
<p class="footer-desc"><?php echo esc_html(ifnex_get_option('footer_desc', 'IFNEX ارائه‌دهنده خدمات لجستیک بین‌المللی با بیش از ۱۰ سال تجربه در ارسال مرسولات تجاری و شخصی به سراسر جهان.')); ?></p>
<?php echo ifnex_get_logo_html('footer'); ?>
<p class="footer-desc">
<?php echo esc_html(ifnex_get_option('footer_desc', ifnex_t(
'IFNEX ارائه‌دهنده خدمات لجستیک بین‌المللی با بیش از ۱۰ سال تجربه در ارسال مرسولات تجاری و شخصی به سراسر جهان.',
'IFNEX provides international logistics services with over 10 years of experience in shipping commercial and personal packages worldwide.'
))); ?>
</p>
</div>
<!-- Services Links -->
<div>
<h3 class="footer-col-title">خدمات</h3>
<h3 class="footer-col-title"><?php echo ifnex_t('خدمات', 'Services'); ?></h3>
<?php
wp_nav_menu([
'theme_location' => 'footer_services',
@ -36,7 +31,7 @@
<!-- Support Links -->
<div>
<h3 class="footer-col-title">پشتیبانی</h3>
<h3 class="footer-col-title"><?php echo ifnex_t('پشتیبانی', 'Support'); ?></h3>
<?php
wp_nav_menu([
'theme_location' => 'footer_support',
@ -49,11 +44,11 @@
<!-- Contact + Newsletter -->
<div>
<h3 class="footer-col-title">تماس با ما</h3>
<h3 class="footer-col-title"><?php echo ifnex_t('تماس با ما', 'Contact'); ?></h3>
<div class="footer-contact-list">
<div class="footer-contact-item">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/><circle cx="12" cy="10" r="3"/></svg>
<span><?php echo esc_html(ifnex_get_option('address', 'تهران، خیابان ولیعصر، پلاک ۱۲۳')); ?></span>
<span><?php echo esc_html(ifnex_get_option('address', 'تهران، ایران')); ?></span>
</div>
<div class="footer-contact-item">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 22 16.92z"/></svg>
@ -64,30 +59,22 @@
<span><?php echo esc_html(ifnex_get_option('email', 'info@ifnex.com')); ?></span>
</div>
</div>
<div class="footer-newsletter">
<span style="font-size:0.82rem;color:rgba(255,255,255,.55);">دریافت اخبار و تخفیفات:</span>
<form class="newsletter-form">
<input type="email" class="newsletter-input" placeholder="ایمیل شما">
<button type="submit" class="newsletter-btn">ثبت</button>
</form>
</div>
</div>
</div>
<!-- Footer Bottom -->
<div class="footer-bottom">
<span>© <?php echo date('Y'); ?> <a href="<?php echo esc_url(home_url('/')); ?>">IFNEX Logistics</a> — تمامی حقوق محفوظ است</span>
<span>طراحی شده با برای کسب‌وکارهای ایرانی</span>
<span>© <?php echo date('Y'); ?> <a href="<?php echo esc_url(home_url('/')); ?>">IFNEX Logistics</a> — <?php echo ifnex_t('تمامی حقوق محفوظ است', 'All rights reserved'); ?></span>
<span><?php echo ifnex_t('طراحی شده با ❤ برای کسب‌وکارهای ایرانی', 'Designed with ❤ for Iranian businesses'); ?></span>
</div>
</div>
</footer>
<!-- Scroll Top Button -->
<button class="scroll-top" id="scroll-top" aria-label="بازگشت به بالا">
<button class="scroll-top" id="scroll-top" aria-label="<?php echo ifnex_is_english() ? 'Back to top' : 'بازگشت به بالا'; ?>">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="18 15 12 9 6 15"/></svg>
</button>
</main><!-- /.site-main -->
<?php wp_footer(); ?>
</body>
</html>

View File

@ -1,5 +1,58 @@
<?php get_header(); ?>
<?php
// ═══ تنظیمات بر اساس زبان ═══
$is_en = ifnex_is_english();
// Hero
$hero_title = $is_en ? ifnex_get_option('hero_title_en', 'Global Shipping Worldwide') : ifnex_get_option('hero_title', 'ارسال مرسوله به سراسر جهان');
$hero_subtitle = $is_en ? ifnex_get_option('hero_subtitle_en', 'Fast, secure and reliable — from Iran to anywhere in the world') : ifnex_get_option('hero_subtitle', 'سریع، امن و قابل اعتماد — از ایران به هر نقطه از دنیا');
// CTA
$cta_title = $is_en ? ifnex_get_option('cta_title_en', 'Ready to Ship Your Package?') : ifnex_get_option('cta_title', 'آماده ارسال مرسوله هستید؟');
$cta_desc = $is_en ? ifnex_get_option('cta_desc_en', 'Contact us today or create a free account') : ifnex_get_option('cta_desc', 'همین امروز با ما تماس بگیرید یا حساب کاربری رایگان بسازید');
// Contact
$address = $is_en ? ifnex_get_option('address_en', 'Tehran, Valiasr St., No. 123') : ifnex_get_option('address', 'تهران، خیابان ولیعصر، پلاک ۱۲۳');
// Services Data
$services = $is_en ? [
['title' => 'International Shipping (Export)', 'desc' => 'Ship commercial and personal packages to over 150 countries worldwide with the fastest air and ground routes.', 'icon' => 'globe', 'link' => '#'],
['title' => 'Domestic Delivery (Import)', 'desc' => 'Receive packages from around the world and get fast delivery in Iran with precise tracking and full insurance.', 'icon' => 'download', 'link' => '#'],
['title' => 'Online Ordering', 'desc' => 'Place shipping orders online, pay securely, and track your shipment in real-time through your dedicated dashboard.', 'icon' => 'cart', 'link' => '#'],
['title' => 'Package Tracking', 'desc' => 'Track your packages instantly with AWB number — see every step from pickup to delivery.', 'icon' => 'tracking', 'link' => '#tracking'],
] : [
['title' => 'ارسال بین‌المللی (صادرات)', 'desc' => 'ارسال مرسولات تجاری و شخصی به بیش از ۱۵۰ کشور جهان با سریع‌ترین مسیرهای هوایی و زمینی.', 'icon' => 'globe', 'link' => '#'],
['title' => 'ارسال داخلی (واردات)', 'desc' => 'دریافت مرسولات از سراسر دنیا و تحویل سریع در ایران با سیستم ردیابی دقیق و بیمه کامل.', 'icon' => 'download', 'link' => '#'],
['title' => 'سفارش آنلاین', 'desc' => 'ثبت سفارش ارسال به صورت آنلاین، پرداخت امن، و پیگیری لحظه‌ای از طریق پنل کاربری اختصاصی.', 'icon' => 'cart', 'link' => '#'],
['title' => 'ردیابی مرسوله', 'desc' => 'ردیابی آنی مرسولات با شماره AWB — از لحظه تحویل تا رسیدن به مقصد، هر گام را ببینید.', 'icon' => 'tracking', 'link' => '#tracking'],
];
// Steps Data
$steps = $is_en ? [
['num' => '1', 'title' => 'Free Registration', 'desc' => 'Create your account in less than a minute and access your dashboard.', 'icon' => 'user'],
['num' => '2', 'title' => 'Place Order', 'desc' => 'Enter sender, receiver and package details and choose the best service.', 'icon' => 'edit'],
['num' => '3', 'title' => 'Online Payment', 'desc' => 'Pay shipping costs via secure gateway or IFNEX wallet and receive your receipt.', 'icon' => 'card'],
['num' => '4', 'title' => 'Live Tracking', 'desc' => 'Track your package route at any moment with your dedicated AWB number.', 'icon' => 'map'],
] : [
['num' => '۱', 'title' => 'ثبت‌نام رایگان', 'desc' => 'حساب کاربری خود را در کمتر از یک دقیقه بسازید و به پنل مدیریت دسترسی پیدا کنید.', 'icon' => 'user'],
['num' => '۲', 'title' => 'ثبت سفارش', 'desc' => 'اطلاعات فرستنده، گیرنده و مشخصات بسته را وارد کنید و بهترین سرویس را انتخاب نمایید.', 'icon' => 'edit'],
['num' => '۳', 'title' => 'پرداخت آنلاین', 'desc' => 'هزینه ارسال را از طریق درگاه امن یا کیف پول IFNEX پرداخت کنید و رسید دریافت نمایید.', 'icon' => 'card'],
['num' => '۴', 'title' => 'ردیابی آنی', 'desc' => 'با شماره AWB اختصاصی، مسیر مرسوله خود را در هر لحظه پیگیری کنید.', 'icon' => 'map'],
];
// Testimonials Data
$testimonials = $is_en ? [
['text' => 'With IFNEX, shipping our goods to Europe became much easier. The online panel is excellent and real-time tracking really helps.', 'name' => 'Mohammad Rezaei', 'role' => 'Export Manager, Niloofar Trading Co.', 'color' => '#f59e0b', 'initial' => 'M'],
['text' => 'IFNEX support is outstanding. Every time I had a question, I got a quick answer. Prices are competitive too.', 'name' => 'Sara Ahmadi', 'role' => 'Entrepreneur, Online Store', 'color' => '#059669', 'initial' => 'S'],
['text' => 'Integrating IFNEX Bridge with WordPress was very easy. Tracking and wallet systems are automatically displayed on my site.', 'name' => 'Ali Karimi', 'role' => 'WordPress Developer', 'color' => '#2563eb', 'initial' => 'A'],
] : [
['text' => 'با IFNEX ارسال بین‌المللی کالاهایمان به اروپا خیلی ساده‌تر شد. پنل آنلاین عالی است و پیگیری لحظه‌ای واقعاً کمک می‌کند.', 'name' => 'محمد رضایی', 'role' => 'مدیر صادرات، شرکت تجاری نیلوفر', 'color' => '#f59e0b', 'initial' => 'م'],
['text' => 'پشتیبانی IFNEX فوق‌العاده است. هر بار که سوال داشتم سریع جواب گرفتم. قیمت‌ها هم رقابتی هستند.', 'name' => 'سارا احمدی', 'role' => 'کارآفرین، فروشگاه اینترنتی', 'color' => '#059669', 'initial' => 'س'],
['text' => 'ادغام IFNEX Bridge با وردپرس خیلی راحت بود. سیستم ردیابی و کیف پول به طور خودکار در سایتم نمایش داده می‌شود.', 'name' => 'علی کریمی', 'role' => 'توسعه‌دهنده وردپرس', 'color' => '#2563eb', 'initial' => 'ع'],
];
?>
<!-- ═══════════════════════════════════════════════════
HERO SECTION
════════════════════════════════════════════════════ -->
@ -15,67 +68,81 @@
<div class="hero-text hero-text-anim">
<div class="hero-badge">
<span class="hero-badge-dot"></span>
آنلاین و فعال · خدمات ۲۴/۷
<?php echo $is_en ? 'Online & Active · 24/7 Service' : 'آنلاین و فعال · خدمات ۲۴/۷'; ?>
</div>
<h1 class="hero-heading">
ارسال مرسوله به سراسر جهان
<?php echo esc_html($hero_title); ?>
<span>Fast, Secure &amp; Reliable Global Shipping</span>
</h1>
<p class="hero-subheading">سریع، امن و قابل اعتماد از ایران به هر نقطه از دنیا</p>
<p class="hero-subheading"><?php echo esc_html($hero_subtitle); ?></p>
<div class="hero-buttons">
<a href="#tracking" class="btn btn-white btn-lg">ردیابی مرسوله</a>
<a href="#" class="btn btn-outline-white btn-lg">شروع ارسال</a>
<a href="#tracking" class="btn btn-white btn-lg">
<?php echo $is_en ? 'Track Package' : 'ردیابی مرسوله'; ?>
</a>
<a href="#" class="btn btn-outline-white btn-lg">
<?php echo $is_en ? 'Start Shipping' : 'شروع ارسال'; ?>
</a>
</div>
<div class="hero-trust">
<div class="trust-item">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="20 6 9 17 4 12"/></svg>
بیش از ۵۰۰ کسب‌وکار فعال
<?php echo $is_en ? '500+ Active Businesses' : 'بیش از ۵۰۰ کسب‌وکار فعال'; ?>
</div>
<div class="trust-item">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="20 6 9 17 4 12"/></svg>
پشتیبانی ۲۴ ساعته
<?php echo $is_en ? '24/7 Support' : 'پشتیبانی ۲۴ ساعته'; ?>
</div>
<div class="trust-item">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="20 6 9 17 4 12"/></svg>
بیمه کامل مرسولات
<?php echo $is_en ? 'Full Package Insurance' : 'بیمه کامل مرسولات'; ?>
</div>
</div>
</div>
<!-- Tracking Card -->
<div class="hero-card hero-card-anim" id="tracking">
<h2 class="hero-card-title">ردیابی مرسوله</h2>
<p class="hero-card-subtitle">شماره AWB یا بارنامه خود را وارد کنید</p>
<h2 class="hero-card-title">
<?php echo $is_en ? 'Track Your Package' : 'ردیابی مرسوله'; ?>
</h2>
<p class="hero-card-subtitle">
<?php echo $is_en ? 'Enter your AWB or tracking number' : 'شماره AWB یا بارنامه خود را وارد کنید'; ?>
</p>
<div class="tracking-form">
<div class="tracking-input-wrap">
<input type="text" class="tracking-input" placeholder="مثال: IFN-2026-12345" dir="ltr">
<input type="text" class="tracking-input" placeholder="<?php echo $is_en ? 'e.g., IFN-2026-12345' : 'مثال: IFN-2026-12345'; ?>" dir="ltr">
<div class="tracking-input-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>
</div>
</div>
<button class="btn btn-primary tracking-btn">ردیابی مرسوله</button>
<button class="btn btn-primary tracking-btn">
<?php echo $is_en ? 'Track Package' : 'ردیابی مرسوله'; ?>
</button>
</div>
<div class="divider-row">یا</div>
<div class="divider-row"><?php echo $is_en ? 'or' : 'یا'; ?></div>
<a href="#" class="btn btn-secondary" style="justify-content:center;">ثبت سفارش جدید</a>
<a href="#" class="btn btn-secondary" style="justify-content:center;">محاسبه هزینه ارسال</a>
<a href="#" class="btn btn-secondary" style="justify-content:center;">
<?php echo $is_en ? 'New Order' : 'ثبت سفارش جدید'; ?>
</a>
<a href="#" class="btn btn-secondary" style="justify-content:center;">
<?php echo $is_en ? 'Calculate Shipping Cost' : 'محاسبه هزینه ارسال'; ?>
</a>
<div class="hero-card-stats">
<div class="h-stat">
<span class="h-stat-num">+۱۵۰</span>
<span class="h-stat-label">کشور مقصد</span>
<span class="h-stat-num">+<?php echo ifnex_get_option('stat_countries', '۱۵۰'); ?></span>
<span class="h-stat-label"><?php echo $is_en ? 'Countries' : 'کشور مقصد'; ?></span>
</div>
<div class="h-stat">
<span class="h-stat-num">+۵۰۰</span>
<span class="h-stat-label">مشتری فعال</span>
<span class="h-stat-num">+<?php echo ifnex_get_option('stat_clients', '۵۰۰'); ?></span>
<span class="h-stat-label"><?php echo $is_en ? 'Active Clients' : 'مشتری فعال'; ?></span>
</div>
<div class="h-stat">
<span class="h-stat-num">۹۸٪</span>
<span class="h-stat-label">رضایتمندی</span>
<span class="h-stat-num"><?php echo ifnex_get_option('stat_satisfaction', '۹۸٪'); ?></span>
<span class="h-stat-label"><?php echo $is_en ? 'Satisfaction' : 'رضایتمندی'; ?></span>
</div>
</div>
</div>
@ -96,64 +163,38 @@
<section class="services" id="services">
<div class="container">
<div class="section-head center reveal">
<span class="section-label">خدمات ما</span>
<h2 class="section-title">راه‌حل‌های جامع <span>لجستیک</span></h2>
<p class="section-desc">از ارسال بین‌المللی تا ردیابی لحظه‌ای همه چیز در یک پلتفرم یکپارچه</p>
<span class="section-label"><?php echo $is_en ? 'Our Services' : 'خدمات ما'; ?></span>
<h2 class="section-title">
<?php echo $is_en ? 'Comprehensive <span>Logistics</span> Solutions' : 'راه‌حل‌های جامع <span>لجستیک</span>'; ?>
</h2>
<p class="section-desc">
<?php echo $is_en ? 'From international shipping to real-time tracking — everything in one integrated platform' : 'از ارسال بین‌المللی تا ردیابی لحظه‌ای — همه چیز در یک پلتفرم یکپارچه'; ?>
</p>
<span class="section-line"></span>
</div>
<div class="services-grid">
<!-- Service 1 -->
<div class="service-card reveal reveal-d1">
<?php foreach ($services as $i => $service) : ?>
<div class="service-card reveal reveal-d<?php echo $i + 1; ?>">
<div class="service-icon">
<?php if ($service['icon'] === 'globe') : ?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>
</div>
<h3 class="service-title">ارسال بین‌المللی (صادرات)</h3>
<p class="service-desc">ارسال مرسولات تجاری و شخصی به بیش از ۱۵۰ کشور جهان با سریع‌ترین مسیرهای هوایی و زمینی.</p>
<a href="#" class="service-link">
بیشتر بدانید
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="19" y1="12" x2="5" y2="12"/><polyline points="12 19 5 12 12 5"/></svg>
</a>
</div>
<!-- Service 2 -->
<div class="service-card reveal reveal-d2">
<div class="service-icon">
<?php elseif ($service['icon'] === 'download') : ?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
</div>
<h3 class="service-title">ارسال داخلی (واردات)</h3>
<p class="service-desc">دریافت مرسولات از سراسر دنیا و تحویل سریع در ایران با سیستم ردیابی دقیق و بیمه کامل.</p>
<a href="#" class="service-link">
بیشتر بدانید
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="19" y1="12" x2="5" y2="12"/><polyline points="12 19 5 12 12 5"/></svg>
</a>
</div>
<!-- Service 3 -->
<div class="service-card reveal reveal-d3">
<div class="service-icon">
<?php elseif ($service['icon'] === 'cart') : ?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="9" cy="21" r="1"/><circle cx="20" cy="21" r="1"/><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"/></svg>
</div>
<h3 class="service-title">سفارش آنلاین</h3>
<p class="service-desc">ثبت سفارش ارسال به صورت آنلاین، پرداخت امن، و پیگیری لحظه‌ای از طریق پنل کاربری اختصاصی.</p>
<a href="#" class="service-link">
بیشتر بدانید
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="19" y1="12" x2="5" y2="12"/><polyline points="12 19 5 12 12 5"/></svg>
</a>
</div>
<!-- Service 4 -->
<div class="service-card reveal reveal-d4">
<div class="service-icon">
<?php else : ?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"/></svg>
<?php endif; ?>
</div>
<h3 class="service-title">ردیابی مرسوله</h3>
<p class="service-desc">ردیابی آنی مرسولات با شماره AWB از لحظه تحویل تا رسیدن به مقصد، هر گام را ببینید.</p>
<a href="#tracking" class="service-link">
ردیابی کنید
<h3 class="service-title"><?php echo esc_html($service['title']); ?></h3>
<p class="service-desc"><?php echo esc_html($service['desc']); ?></p>
<a href="<?php echo esc_url($service['link']); ?>" class="service-link">
<?php echo $is_en ? 'Learn more' : 'بیشتر بدانید'; ?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="19" y1="12" x2="5" y2="12"/><polyline points="12 19 5 12 12 5"/></svg>
</a>
</div>
<?php endforeach; ?>
</div>
</div>
</section>
@ -164,48 +205,35 @@
<section class="how-it-works" id="how-it-works">
<div class="container">
<div class="section-head center reveal">
<span class="section-label">نحوه کار</span>
<h2 class="section-title">در چهار گام ساده <span>ارسال کنید</span></h2>
<p class="section-desc">فرآیند ارسال مرسوله با IFNEX سریع، شفاف و کاملاً آنلاین است</p>
<span class="section-label"><?php echo $is_en ? 'How It Works' : 'نحوه کار'; ?></span>
<h2 class="section-title">
<?php echo $is_en ? 'Ship in Four <span>Simple Steps</span>' : 'در چهار گام ساده <span>ارسال کنید</span>'; ?>
</h2>
<p class="section-desc">
<?php echo $is_en ? 'The shipping process with IFNEX is fast, transparent and fully online' : 'فرآیند ارسال مرسوله با IFNEX سریع، شفاف و کاملاً آنلاین است'; ?>
</p>
<span class="section-line"></span>
</div>
<div class="steps-grid">
<div class="step-item reveal reveal-d1">
<?php foreach ($steps as $i => $step) : ?>
<div class="step-item reveal reveal-d<?php echo $i + 1; ?>">
<div class="step-circle">
<span class="step-num">۱</span>
<span class="step-num"><?php echo esc_html($step['num']); ?></span>
<?php if ($step['icon'] === 'user') : ?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>
</div>
<h3 class="step-title">ثبت‌نام رایگان</h3>
<p class="step-desc">حساب کاربری خود را در کمتر از یک دقیقه بسازید و به پنل مدیریت دسترسی پیدا کنید.</p>
</div>
<div class="step-item reveal reveal-d2">
<div class="step-circle">
<span class="step-num">۲</span>
<?php elseif ($step['icon'] === 'edit') : ?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg>
</div>
<h3 class="step-title">ثبت سفارش</h3>
<p class="step-desc">اطلاعات فرستنده، گیرنده و مشخصات بسته را وارد کنید و بهترین سرویس را انتخاب نمایید.</p>
</div>
<div class="step-item reveal reveal-d3">
<div class="step-circle">
<span class="step-num">۳</span>
<?php elseif ($step['icon'] === 'card') : ?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="1" y="4" width="22" height="16" rx="2" ry="2"/><line x1="1" y1="10" x2="23" y2="10"/></svg>
</div>
<h3 class="step-title">پرداخت آنلاین</h3>
<p class="step-desc">هزینه ارسال را از طریق درگاه امن یا کیف پول IFNEX پرداخت کنید و رسید دریافت نمایید.</p>
</div>
<div class="step-item reveal reveal-d4">
<div class="step-circle">
<span class="step-num">۴</span>
<?php else : ?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="3 11 22 2 13 21 11 13 3 11"/></svg>
<?php endif; ?>
</div>
<h3 class="step-title">ردیابی آنی</h3>
<p class="step-desc">با شماره AWB اختصاصی، مسیر مرسوله خود را در هر لحظه پیگیری کنید.</p>
<h3 class="step-title"><?php echo esc_html($step['title']); ?></h3>
<p class="step-desc"><?php echo esc_html($step['desc']); ?></p>
</div>
<?php endforeach; ?>
</div>
</div>
</section>
@ -217,24 +245,24 @@
<div class="container">
<div class="stats-grid">
<div class="stat-item reveal">
<div class="stat-number"><span class="stat-suffix">+</span>۱۰</div>
<div class="stat-label">سال تجربه</div>
<div class="stat-sub">Years of Experience</div>
<div class="stat-number"><span class="stat-suffix">+</span><?php echo ifnex_get_option('stat_years', '۱۰'); ?></div>
<div class="stat-label"><?php echo $is_en ? 'Years of Experience' : 'سال تجربه'; ?></div>
<div class="stat-sub"><?php echo $is_en ? 'Since 2016' : 'از سال ۱۳۹۵'; ?></div>
</div>
<div class="stat-item reveal reveal-d1">
<div class="stat-number"><span class="stat-suffix">+</span>۱۵۰</div>
<div class="stat-label">کشور مقصد</div>
<div class="stat-sub">Countries Served</div>
<div class="stat-number"><span class="stat-suffix">+</span><?php echo ifnex_get_option('stat_countries', '۱۵۰'); ?></div>
<div class="stat-label"><?php echo $is_en ? 'Countries Served' : 'کشور مقصد'; ?></div>
<div class="stat-sub"><?php echo $is_en ? 'Worldwide Coverage' : 'پوشش جهانی'; ?></div>
</div>
<div class="stat-item reveal reveal-d2">
<div class="stat-number"><span class="stat-suffix">+</span>۱۰,۰۰۰</div>
<div class="stat-label">مرسوله تحویل‌شده</div>
<div class="stat-sub">Packages Delivered</div>
<div class="stat-number"><span class="stat-suffix">+</span><?php echo ifnex_get_option('stat_packages', '۱۰,۰۰۰'); ?></div>
<div class="stat-label"><?php echo $is_en ? 'Packages Delivered' : 'مرسوله تحویل‌شده'; ?></div>
<div class="stat-sub"><?php echo $is_en ? 'And Counting' : 'و ادامه دارد'; ?></div>
</div>
<div class="stat-item reveal reveal-d3">
<div class="stat-number">۹۸<span class="stat-suffix">٪</span></div>
<div class="stat-label">رضایت مشتریان</div>
<div class="stat-sub">Customer Satisfaction</div>
<div class="stat-number"><?php echo ifnex_get_option('stat_satisfaction', '۹۸'); ?><span class="stat-suffix">%</span></div>
<div class="stat-label"><?php echo $is_en ? 'Customer Satisfaction' : 'رضایت مشتریان'; ?></div>
<div class="stat-sub"><?php echo $is_en ? 'Based on Reviews' : 'بر اساس نظرات'; ?></div>
</div>
</div>
</div>
@ -246,71 +274,41 @@
<section class="testimonials">
<div class="container">
<div class="section-head center reveal">
<span class="section-label">نظر مشتریان</span>
<h2 class="section-title">آنچه مشتریان ما <span>می‌گویند</span></h2>
<p class="section-desc">بیش از ۵۰۰ کسب‌وکار به IFNEX اعتماد کرده‌اند</p>
<span class="section-label"><?php echo $is_en ? 'Testimonials' : 'نظر مشتریان'; ?></span>
<h2 class="section-title">
<?php echo $is_en ? 'What Our Clients <span>Say</span>' : 'آنچه مشتریان ما <span>می‌گویند</span>'; ?>
</h2>
<p class="section-desc">
<?php echo $is_en ? 'Over 500 businesses trust IFNEX' : 'بیش از ۵۰۰ کسب‌وکار به IFNEX اعتماد کرده‌اند'; ?>
</p>
<span class="section-line"></span>
</div>
<div class="testimonials-grid">
<div class="testimonial-card reveal reveal-d1">
<?php foreach ($testimonials as $i => $t) : ?>
<div class="testimonial-card reveal reveal-d<?php echo $i + 1; ?>">
<div class="testimonial-stars">
<?php for ($s = 0; $s < 5; $s++) : ?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
<?php endfor; ?>
</div>
<p class="testimonial-text">"با IFNEX ارسال بین‌المللی کالاهایمان به اروپا خیلی ساده‌تر شد. پنل آنلاین عالی است و پیگیری لحظه‌ای واقعاً کمک می‌کند."</p>
<p class="testimonial-text">"<?php echo esc_html($t['text']); ?>"</p>
<div class="testimonial-author">
<div class="author-avatar" style="background:#f59e0b;">م</div>
<div class="author-avatar" style="background:<?php echo $t['color']; ?>;"><?php echo esc_html($t['initial']); ?></div>
<div>
<div class="author-name">محمد رضایی</div>
<div class="author-role">مدیر صادرات، شرکت تجاری نیلوفر</div>
</div>
</div>
</div>
<div class="testimonial-card reveal reveal-d2">
<div class="testimonial-stars">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
</div>
<p class="testimonial-text">"پشتیبانی IFNEX فوق‌العاده است. هر بار که سوال داشتم سریع جواب گرفتم. قیمت‌ها هم رقابتی هستند."</p>
<div class="testimonial-author">
<div class="author-avatar" style="background:#059669;">س</div>
<div>
<div class="author-name">سارا احمدی</div>
<div class="author-role">کارآفرین، فروشگاه اینترنتی</div>
</div>
</div>
</div>
<div class="testimonial-card reveal reveal-d3">
<div class="testimonial-stars">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
</div>
<p class="testimonial-text">"ادغام IFNEX Bridge با وردپرس خیلی راحت بود. سیستم ردیابی و کیف پول به طور خودکار در سایتم نمایش داده می‌شود."</p>
<div class="testimonial-author">
<div class="author-avatar" style="background:#2563eb;">ع</div>
<div>
<div class="author-name">علی کریمی</div>
<div class="author-role">توسعه‌دهنده وردپرس</div>
<div class="author-name"><?php echo esc_html($t['name']); ?></div>
<div class="author-role"><?php echo esc_html($t['role']); ?></div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<!-- Client Logos -->
<div class="clients-strip reveal">
<div class="clients-label">مورد اعتماد کسب‌وکارهای برتر</div>
<div class="clients-label">
<?php echo $is_en ? 'Trusted by Leading Businesses' : 'مورد اعتماد کسب‌وکارهای برتر'; ?>
</div>
<div class="clients-logos">
<div class="client-logo"><span class="client-logo-text">TradeCo</span></div>
<div class="client-logo"><span class="client-logo-text">NiloofarEx</span></div>
@ -329,25 +327,29 @@
<div class="container">
<div class="cta-inner">
<div>
<h2 class="cta-heading">آماده ارسال مرسوله هستید؟</h2>
<p class="cta-desc">همین امروز با ما تماس بگیرید یا حساب کاربری رایگان بسازید</p>
<h2 class="cta-heading"><?php echo esc_html($cta_title); ?></h2>
<p class="cta-desc"><?php echo esc_html($cta_desc); ?></p>
<div class="cta-buttons">
<a href="#" class="btn btn-white btn-lg">شروع رایگان</a>
<a href="tel:+982100000000" class="btn btn-outline-white btn-lg">تماس با ما</a>
<a href="#" class="btn btn-white btn-lg">
<?php echo $is_en ? 'Get Started Free' : 'شروع رایگان'; ?>
</a>
<a href="tel:<?php echo esc_attr(str_replace(' ', '', ifnex_get_option('phone', '+982100000000'))); ?>" class="btn btn-outline-white btn-lg">
<?php echo $is_en ? 'Contact Us' : 'تماس با ما'; ?>
</a>
</div>
</div>
<div class="cta-contact">
<div class="cta-contact-item">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.127.96.361 1.903.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0 1 22 16.92z"/></svg>
+98 21 0000 0000
<?php echo esc_html(ifnex_get_option('phone', '+98 21 0000 0000')); ?>
</div>
<div class="cta-contact-item">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/><polyline points="22,6 12,13 2,6"/></svg>
info@ifnex.com
<?php echo esc_html(ifnex_get_option('email', 'info@ifnex.com')); ?>
</div>
<div class="cta-contact-item">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"/><circle cx="12" cy="10" r="3"/></svg>
تهران، ایران
<?php echo esc_html($address); ?>
</div>
</div>
</div>

View File

@ -1,8 +1,4 @@
<?php
/**
* IFNEX Logistics Theme
*/
defined('ABSPATH') || exit;
// ─── تابع کمکی ─────────────────────────────────────────
@ -14,18 +10,23 @@ function ifnex_get_option($key, $default = '') {
function ifnex_theme_setup() {
add_theme_support('title-tag');
add_theme_support('post-thumbnails');
add_theme_support('custom-logo', [
'height' => 44, 'width' => 44,
'height' => 50, 'width' => 180,
'flex-height' => true, 'flex-width' => true,
]);
add_theme_support('html5', ['search-form', 'comment-form', 'gallery', 'caption']);
add_theme_support('responsive-embeds');
add_theme_support('automatic-feed-links');
register_nav_menus([
'primary' => __('منوی اصلی', 'ifnex'),
'footer_services' => __('منوی فوتر — خدمات', 'ifnex'),
'footer_support' => __('منوی فوتر — پشتیبانی', 'ifnex'),
]);
load_theme_textdomain('ifnex', get_template_directory() . '/languages');
}
add_action('after_setup_theme', 'ifnex_theme_setup');
@ -39,41 +40,204 @@ foreach ($ifnex_includes as $file) {
// ─── Enqueue Assets ────────────────────────────────────
function ifnex_enqueue_assets() {
wp_enqueue_style('vazirmatn', 'https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap', [], null);
wp_enqueue_style('ifnex-main', get_stylesheet_uri(), ['vazirmatn'], '1.0.1'); // نسخه افزایش یافت برای کش
wp_enqueue_script('ifnex-main', get_template_directory_uri() . '/assets/js/main.js', [], '1.0.0', true);
wp_enqueue_style('ifnex-main', get_stylesheet_uri(), ['vazirmatn'], '1.0.3');
wp_enqueue_script('ifnex-main', get_template_directory_uri() . '/assets/js/main.js', [], '1.0.1', true);
wp_localize_script('ifnex-main', 'ifnexConfig', [
'ajaxUrl' => admin_url('admin-ajax.php'),
'apiUrl' => get_option('ifnex_api_url', 'http://localhost:8000/api/v1'),
'homeUrl' => home_url('/'),
'currentLang' => ifnex_get_current_lang(),
]);
}
add_action('wp_enqueue_scripts', 'ifnex_enqueue_assets');
// ─── Helper Function برای منوی اصلی (ساده‌تر و تمیزتر از Walker) ──
// ─── تشخیص زبان (سازگار با Polylang) ─────────────────
function ifnex_get_current_lang() {
if (function_exists('pll_current_language')) {
return pll_current_language(); // Polylang
}
return isset($_GET['lang']) && $_GET['lang'] === 'en' ? 'en' : 'fa';
}
function ifnex_is_english() {
return ifnex_get_current_lang() === 'en';
}
function ifnex_text_direction() {
return ifnex_is_english() ? 'ltr' : 'rtl';
}
// ─── سوئیچر زبان (سازگار با Polylang) ───────────────
function ifnex_language_switcher() {
if (function_exists('pll_the_languages')) {
// Polylang فعال است — از سوئیچر خودکار استفاده کن
$languages = pll_the_languages(['raw' => 1]);
$output = '<div class="lang-switcher">';
foreach ($languages as $lang) {
$is_active = $lang['current_lang'] ? 'active' : '';
$label = strtoupper($lang['slug']);
$output .= sprintf(
'<a href="%s" class="lang-btn %s" title="%s">%s</a>',
esc_url($lang['url']),
esc_attr($is_active),
esc_attr($lang['name']),
esc_html($label)
);
if ($lang !== end($languages)) {
$output .= '<span class="lang-divider">|</span>';
}
}
$output .= '</div>';
return $output;
}
// Fallback: روش query parameter
$fa_url = ifnex_get_switch_url('fa');
$en_url = ifnex_get_switch_url('en');
$current = ifnex_get_current_lang();
return '<div class="lang-switcher">
<a href="' . esc_url($fa_url) . '" class="lang-btn ' . ($current === 'fa' ? 'active' : '') . '">FA</a>
<span class="lang-divider">|</span>
<a href="' . esc_url($en_url) . '" class="lang-btn ' . ($current === 'en' ? 'active' : '') . '">EN</a>
</div>';
}
// ─── سوئیچر زبان موبایل (سازگار با Polylang) ─────────
function ifnex_language_switcher_mobile() {
if (function_exists('pll_the_languages')) {
// Polylang فعال است
$languages = pll_the_languages(['raw' => 1]);
$output = '<div class="lang-switcher-mobile">';
foreach ($languages as $lang) {
$is_active = $lang['current_lang'] ? 'active' : '';
$flag = $lang['slug'] === 'fa' ? '🇮🇷' : '🇬🇧';
$label = $lang['slug'] === 'fa' ? 'فارسی' : 'English';
$output .= sprintf(
'<a href="%s" class="lang-btn %s">%s %s</a>',
esc_url($lang['url']),
esc_attr($is_active),
esc_html($flag),
esc_html($label)
);
}
$output .= '</div>';
return $output;
}
// Fallback: روش query parameter
$current = ifnex_get_current_lang();
return '<div class="lang-switcher-mobile">
<a href="' . esc_url(ifnex_get_switch_url('fa')) . '" class="lang-btn ' . ($current === 'fa' ? 'active' : '') . '">🇮🇷 فارسی</a>
<a href="' . esc_url(ifnex_get_switch_url('en')) . '" class="lang-btn ' . ($current === 'en' ? 'active' : '') . '">🇬🇧 English</a>
</div>';
}
function ifnex_get_switch_url($target_lang) {
$current_url = home_url(add_query_arg(null, null));
$parsed = parse_url($current_url);
$query = [];
if (isset($parsed['query'])) {
parse_str($parsed['query'], $query);
}
if ($target_lang === 'fa') {
unset($query['lang']);
} else {
$query['lang'] = 'en';
}
$new_query = !empty($query) ? '?' . http_build_query($query) : '';
return ($parsed['path'] ?? '/') . $new_query;
}
// ─── تابع ترجمه (سازگار با Polylang) ──────────────────
function ifnex_t($fa_text, $en_text = null) {
if (ifnex_is_english() && $en_text) {
return $en_text;
}
return $fa_text;
}
// ─── لوگو با fallback ─────────────────────────────────
function ifnex_get_logo_html($context = 'header') {
$logo_id = ifnex_get_option('logo_image_' . $context . '_id', 0);
if ($logo_id) {
$custom_logo = wp_get_attachment_image($logo_id, 'full', false, [
'class' => 'logo-image',
'alt' => get_bloginfo('name'),
]);
if ($custom_logo) {
return '<a href="' . esc_url(home_url('/')) . '" class="logo" aria-label="' . esc_attr(get_bloginfo('name')) . '">
<div class="logo-img-wrap">' . $custom_logo . '</div>
<div class="logo-text">
<span class="logo-name">' . esc_html(get_bloginfo('name')) . '</span>
<span class="logo-tagline">' . esc_html(ifnex_get_option('tagline', 'حمل و نقل بین‌المللی')) . '</span>
</div>
</a>';
}
}
return '<a href="' . esc_url(home_url('/')) . '" class="logo" aria-label="' . esc_attr(get_bloginfo('name')) . '">
<div class="logo-icon">
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z" fill="none" stroke="white" stroke-width="1.5"/>
<polyline points="3.27 6.96 12 12.01 20.73 6.96" fill="none" stroke="white" stroke-width="1.5"/>
<line x1="12" y1="22.08" x2="12" y2="12" stroke="white" stroke-width="1.5"/>
</svg>
</div>
<div class="logo-text">
<span class="logo-name">' . esc_html(get_bloginfo('name')) . '</span>
<span class="logo-tagline">' . esc_html(ifnex_get_option('tagline', 'حمل و نقل بین‌المللی')) . '</span>
</div>
</a>';
}
// ─── Helper برای منو ──────────────────────────────────
function ifnex_render_primary_menu() {
// Polylang به صورت خودکار منوی زبان صحیح را نمایش می‌دهد
wp_nav_menu([
'theme_location' => 'primary',
'container' => false,
'menu_class' => 'nav-list',
'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
'link_before' => '',
'link_after' => '',
'fallback_cb' => false,
]);
}
// ─── حذف کلاس‌های پیش‌فرض وردپرس از منو ──────────────
add_filter('nav_menu_css_class', function($classes) {
return array_filter($classes, function($class) {
return in_array($class, ['current-menu-item', 'menu-item-has-children']);
});
});
// ─── حذف آیدی‌های پیش‌فرض از آیتم‌های منو ────────────
add_filter('nav_menu_item_id', '__return_null');
// ─── حذف موارد اضافی وردپرس (سرعت) ──────────────────
// ─── body class بر اساس زبان ──────────────────────────
function ifnex_html_class($classes) {
if (ifnex_is_english()) {
$classes[] = 'lang-en';
$classes[] = 'ltr';
} else {
$classes[] = 'lang-fa';
$classes[] = 'rtl';
}
return $classes;
}
add_filter('body_class', 'ifnex_html_class');
// ─── حذف موارد اضافی ─────────────────────────────────
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'rsd_link');

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html <?php language_attributes(); ?> dir="rtl">
<html <?php language_attributes(); ?> dir="<?php echo ifnex_text_direction(); ?>" lang="<?php echo ifnex_is_english() ? 'en' : 'fa'; ?>">
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@ -14,31 +14,27 @@
<div class="container">
<div class="header-inner">
<!-- Logo -->
<a href="<?php echo esc_url(home_url('/')); ?>" class="logo" aria-label="IFNEX">
<div class="logo-icon">
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z" fill="none" stroke="white" stroke-width="1.5"/>
<polyline points="3.27 6.96 12 12.01 20.73 6.96" fill="none" stroke="white" stroke-width="1.5"/>
<line x1="12" y1="22.08" x2="12" y2="12" stroke="white" stroke-width="1.5"/>
</svg>
</div>
<div class="logo-text">
<span class="logo-name">IFNEX</span>
<span class="logo-tagline"><?php echo esc_html(ifnex_get_option('tagline', 'حمل و نقل بین‌المللی')); ?></span>
</div>
</a>
<!-- Logo (قابل تنظیم از Customizer) -->
<?php echo ifnex_get_logo_html('header'); ?>
<!-- Navigation -->
<nav class="main-nav" aria-label="منوی اصلی">
<nav class="main-nav" aria-label="<?php echo ifnex_is_english() ? 'Main menu' : 'منوی اصلی'; ?>">
<?php ifnex_render_primary_menu(); ?>
</nav>
<!-- Actions -->
<!-- Actions + Language Switcher -->
<div class="header-actions">
<a href="<?php echo esc_url(ifnex_get_option('login_url', '#')); ?>" class="btn btn-secondary">ورود مشتریان</a>
<a href="<?php echo esc_url(ifnex_get_option('order_url', '#')); ?>" class="btn btn-primary">سفارش جدید</a>
<button class="hamburger" id="hamburger" aria-label="منو" aria-expanded="false">
<!-- Language Switcher (سازگار با Polylang) -->
<?php echo ifnex_language_switcher(); ?>
<a href="<?php echo esc_url(ifnex_get_option('login_url', '#')); ?>" class="btn btn-secondary">
<?php echo ifnex_t('ورود مشتریان', 'Client Login'); ?>
</a>
<a href="<?php echo esc_url(ifnex_get_option('order_url', '#')); ?>" class="btn btn-primary">
<?php echo ifnex_t('سفارش جدید', 'New Order'); ?>
</a>
<button class="hamburger" id="hamburger" aria-label="<?php echo ifnex_is_english() ? 'Menu' : 'منو'; ?>" aria-expanded="false">
<span></span><span></span><span></span>
</button>
</div>
@ -48,12 +44,20 @@
<!-- Mobile Drawer -->
<div class="mobile-drawer" id="mobile-drawer" aria-hidden="true">
<nav class="mobile-nav" aria-label="منوی موبایل">
<nav class="mobile-nav" aria-label="<?php echo ifnex_is_english() ? 'Mobile menu' : 'منوی موبایل'; ?>">
<?php ifnex_render_primary_menu(); ?>
</nav>
<div class="mobile-drawer-actions">
<a href="<?php echo esc_url(ifnex_get_option('login_url', '#')); ?>" class="btn btn-secondary">ورود مشتریان</a>
<a href="<?php echo esc_url(ifnex_get_option('order_url', '#')); ?>" class="btn btn-primary">سفارش جدید</a>
<!-- Language Switcher Mobile (سازگار با Polylang) -->
<?php echo ifnex_language_switcher_mobile(); ?>
<a href="<?php echo esc_url(ifnex_get_option('login_url', '#')); ?>" class="btn btn-secondary">
<?php echo ifnex_t('ورود مشتریان', 'Client Login'); ?>
</a>
<a href="<?php echo esc_url(ifnex_get_option('order_url', '#')); ?>" class="btn btn-primary">
<?php echo ifnex_t('سفارش جدید', 'New Order'); ?>
</a>
</div>
</div>

View File

@ -1,12 +1,60 @@
<?php
/**
* IFNEX Customizer Settings
*/
defined('ABSPATH') || exit;
function ifnex_customize_register($wp_customize) {
// ─── بخش لوگو ───
$wp_customize->add_section('ifnex_logo', [
'title' => '🖼️ لوگو',
'priority' => 25,
]);
// لوگوی هدر
$wp_customize->add_setting('ifnex_logo_image_header', ['sanitize_callback' => 'esc_url_raw']);
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'ifnex_logo_image_header', [
'label' => 'لوگوی هدر (تصویر)',
'section' => 'ifnex_logo',
'description' => 'تصویر PNG یا SVG با پس‌زمینه شفاف توصیه می‌شود. اگر خالی بگذارید، لوگوی SVG پیش‌فرض نمایش داده می‌شود.',
]));
$wp_customize->add_setting('ifnex_logo_image_header_id', ['sanitize_callback' => 'absint']);
$wp_customize->add_control(new WP_Customize_Media_Control($wp_customize, 'ifnex_logo_image_header_id_ctrl', [
'label' => 'انتخاب لوگوی هدر از کتابخانه',
'section' => 'ifnex_logo',
'settings' => 'ifnex_logo_image_header_id',
'mime_type' => 'image',
]));
// لوگوی فوتر
$wp_customize->add_setting('ifnex_logo_image_footer', ['sanitize_callback' => 'esc_url_raw']);
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'ifnex_logo_image_footer', [
'label' => 'لوگوی فوتر (تصویر)',
'section' => 'ifnex_logo',
'description' => 'اختیاری. اگر خالی باشد، از لوگوی هدر استفاده می‌شود.',
]));
$wp_customize->add_setting('ifnex_logo_image_footer_id', ['sanitize_callback' => 'absint']);
$wp_customize->add_control(new WP_Customize_Media_Control($wp_customize, 'ifnex_logo_image_footer_id_ctrl', [
'label' => 'انتخاب لوگوی فوتر از کتابخانه',
'section' => 'ifnex_logo',
'settings' => 'ifnex_logo_image_footer_id',
'mime_type' => 'image',
]));
// ─── بخش تنظیمات زبان ───
$wp_customize->add_section('ifnex_language', [
'title' => '🌐 زبان و ترجمه',
'priority' => 26,
]);
$wp_customize->add_setting('ifnex_enable_english', ['default' => true, 'sanitize_callback' => 'rest_sanitize_boolean']);
$wp_customize->add_control('ifnex_enable_english', [
'label' => 'فعال‌سازی زبان انگلیسی',
'section' => 'ifnex_language',
'type' => 'checkbox',
'description' => 'اگر فعال باشد، دکمه سوئیچ زبان در هدر نمایش داده می‌شود',
]);
// ─── بخش Hero ───
$wp_customize->add_section('ifnex_hero', [
'title' => '🏠 بخش Hero (بالای صفحه)',
@ -16,9 +64,15 @@ function ifnex_customize_register($wp_customize) {
$wp_customize->add_setting('ifnex_hero_title', ['default' => 'ارسال مرسوله به سراسر جهان', 'sanitize_callback' => 'sanitize_text_field']);
$wp_customize->add_control('ifnex_hero_title', ['label' => 'عنوان اصلی', 'section' => 'ifnex_hero', 'type' => 'text']);
$wp_customize->add_setting('ifnex_hero_title_en', ['default' => 'Global Shipping Worldwide', 'sanitize_callback' => 'sanitize_text_field']);
$wp_customize->add_control('ifnex_hero_title_en', ['label' => 'عنوان اصلی (انگلیسی)', 'section' => 'ifnex_hero', 'type' => 'text']);
$wp_customize->add_setting('ifnex_hero_subtitle', ['default' => 'سریع، امن و قابل اعتماد — از ایران به هر نقطه از دنیا', 'sanitize_callback' => 'sanitize_textarea_field']);
$wp_customize->add_control('ifnex_hero_subtitle', ['label' => 'زیرعنوان', 'section' => 'ifnex_hero', 'type' => 'textarea']);
$wp_customize->add_setting('ifnex_hero_subtitle_en', ['default' => 'Fast, secure and reliable — from Iran to anywhere in the world', 'sanitize_callback' => 'sanitize_textarea_field']);
$wp_customize->add_control('ifnex_hero_subtitle_en', ['label' => 'زیرعنوان (انگلیسی)', 'section' => 'ifnex_hero', 'type' => 'textarea']);
// ─── بخش آمار ───
$wp_customize->add_section('ifnex_stats', [
'title' => '📊 آمار و ارقام',
@ -53,6 +107,9 @@ function ifnex_customize_register($wp_customize) {
$wp_customize->add_setting('ifnex_address', ['default' => 'تهران، خیابان ولیعصر، پلاک ۱۲۳', 'sanitize_callback' => 'sanitize_textarea_field']);
$wp_customize->add_control('ifnex_address', ['label' => 'آدرس', 'section' => 'ifnex_contact', 'type' => 'textarea']);
$wp_customize->add_setting('ifnex_address_en', ['default' => 'Tehran, Valiasr St., No. 123', 'sanitize_callback' => 'sanitize_textarea_field']);
$wp_customize->add_control('ifnex_address_en', ['label' => 'آدرس (انگلیسی)', 'section' => 'ifnex_contact', 'type' => 'textarea']);
// ─── بخش لینک‌ها ───
$wp_customize->add_section('ifnex_links', [
'title' => '🔗 لینک‌های مهم',
@ -65,19 +122,19 @@ function ifnex_customize_register($wp_customize) {
$wp_customize->add_setting('ifnex_order_url', ['default' => '#', 'sanitize_callback' => 'esc_url_raw']);
$wp_customize->add_control('ifnex_order_url', ['label' => 'URL سفارش جدید', 'section' => 'ifnex_links', 'type' => 'url']);
// ─── بخش CTA ───
$wp_customize->add_section('ifnex_cta', [
'title' => '📢 بخش CTA',
'priority' => 34,
// ─── بخش بلاگ ───
$wp_customize->add_section('ifnex_blog', [
'title' => '📝 تنظیمات بلاگ',
'priority' => 36,
]);
$wp_customize->add_setting('ifnex_cta_title', ['default' => 'آماده ارسال مرسوله هستید؟', 'sanitize_callback' => 'sanitize_text_field']);
$wp_customize->add_control('ifnex_cta_title', ['label' => 'عنوان CTA', 'section' => 'ifnex_cta', 'type' => 'text']);
$wp_customize->add_setting('ifnex_blog_title', ['default' => 'اخبار و مقالات', 'sanitize_callback' => 'sanitize_text_field']);
$wp_customize->add_control('ifnex_blog_title', ['label' => 'عنوان صفحه بلاگ', 'section' => 'ifnex_blog', 'type' => 'text']);
$wp_customize->add_setting('ifnex_cta_desc', ['default' => 'همین امروز با ما تماس بگیرید یا حساب کاربری رایگان بسازید', 'sanitize_callback' => 'sanitize_textarea_field']);
$wp_customize->add_control('ifnex_cta_desc', ['label' => 'توضیح CTA', 'section' => 'ifnex_cta', 'type' => 'textarea']);
$wp_customize->add_setting('ifnex_blog_title_en', ['default' => 'News & Articles', 'sanitize_callback' => 'sanitize_text_field']);
$wp_customize->add_control('ifnex_blog_title_en', ['label' => 'عنوان صفحه بلاگ (انگلیسی)', 'section' => 'ifnex_blog', 'type' => 'text']);
// ─── بخش فوتر ───
// ─── فوتر ───
$wp_customize->add_section('ifnex_footer', [
'title' => '📋 فوتر',
'priority' => 35,
@ -88,5 +145,37 @@ function ifnex_customize_register($wp_customize) {
$wp_customize->add_setting('ifnex_tagline', ['default' => 'حمل و نقل بین‌المللی', 'sanitize_callback' => 'sanitize_text_field']);
$wp_customize->add_control('ifnex_tagline', ['label' => 'تگلاین (زیر لوگو)', 'section' => 'ifnex_footer', 'type' => 'text']);
// ─── فیلدهای انگلیسی برای Hero ───
$wp_customize->add_setting('ifnex_hero_title_en', ['default' => 'Global Shipping Worldwide', 'sanitize_callback' => 'sanitize_text_field']);
$wp_customize->add_control('ifnex_hero_title_en', ['label' => 'عنوان اصلی Hero (انگلیسی)', 'section' => 'ifnex_hero', 'type' => 'text']);
$wp_customize->add_setting('ifnex_hero_subtitle_en', ['default' => 'Fast, secure and reliable — from Iran to anywhere in the world', 'sanitize_callback' => 'sanitize_textarea_field']);
$wp_customize->add_control('ifnex_hero_subtitle_en', ['label' => 'زیرعنوان Hero (انگلیسی)', 'section' => 'ifnex_hero', 'type' => 'textarea']);
// ─── فیلدهای انگلیسی برای CTA ───
$wp_customize->add_section('ifnex_cta', [
'title' => '📢 بخش CTA',
'priority' => 34,
]);
$wp_customize->add_setting('ifnex_cta_title', ['default' => 'آماده ارسال مرسوله هستید؟', 'sanitize_callback' => 'sanitize_text_field']);
$wp_customize->add_control('ifnex_cta_title', ['label' => 'عنوان CTA', 'section' => 'ifnex_cta', 'type' => 'text']);
$wp_customize->add_setting('ifnex_cta_title_en', ['default' => 'Ready to Ship Your Package?', 'sanitize_callback' => 'sanitize_text_field']);
$wp_customize->add_control('ifnex_cta_title_en', ['label' => 'عنوان CTA (انگلیسی)', 'section' => 'ifnex_cta', 'type' => 'text']);
$wp_customize->add_setting('ifnex_cta_desc', ['default' => 'همین امروز با ما تماس بگیرید یا حساب کاربری رایگان بسازید', 'sanitize_callback' => 'sanitize_textarea_field']);
$wp_customize->add_control('ifnex_cta_desc', ['label' => 'توضیح CTA', 'section' => 'ifnex_cta', 'type' => 'textarea']);
$wp_customize->add_setting('ifnex_cta_desc_en', ['default' => 'Contact us today or create a free account', 'sanitize_callback' => 'sanitize_textarea_field']);
$wp_customize->add_control('ifnex_cta_desc_en', ['label' => 'توضیح CTA (انگلیسی)', 'section' => 'ifnex_cta', 'type' => 'textarea']);
// ─── آمار (اعداد فارسی/انگلیسی) ───
// توجه: اگر می‌خواهید اعداد انگلیسی برای زبان انگلیسی نمایش داده شود،
// فیلدهای جداگانه بسازید. فعلاً از همان فیلدهای قبلی استفاده می‌شود.
}
add_action('customize_register', 'ifnex_customize_register');

View File

@ -1,20 +1,124 @@
<?php get_header(); ?>
<main class="container" style="padding: 120px 24px 80px; max-width: 800px;">
<?php while (have_posts()) : the_post(); ?>
<article>
<h1><?php the_title(); ?></h1>
<div style="color:var(--gray-500);font-size:0.85rem;margin-bottom:24px;">
<?php echo get_the_date(); ?> · <?php the_author(); ?>
</div>
<?php if (has_post_thumbnail()) : ?>
<div style="margin-bottom:24px;border-radius:var(--radius-md);overflow:hidden;">
<?php the_post_thumbnail('large'); ?>
<?php while (have_posts()) : the_post(); ?>
<article <?php post_class('single-article'); ?>>
<!-- Article Header -->
<header class="single-header">
<div class="container">
<div class="single-breadcrumb">
<a href="<?php echo esc_url(home_url('/')); ?>"><?php echo ifnex_t('خانه', 'Home'); ?></a>
<span></span>
<?php
$blog_url = get_option('page_for_posts') ? get_permalink(get_option('page_for_posts')) : home_url('/blog');
?>
<a href="<?php echo esc_url($blog_url); ?>"><?php echo ifnex_t('بلاگ', 'Blog'); ?></a>
<span></span>
<span class="current"><?php the_title(); ?></span>
</div>
<?php endif; ?>
<div><?php the_content(); ?></div>
</article>
<?php endwhile; ?>
</main>
<?php
$categories = get_the_category();
if (!empty($categories)) : ?>
<div class="single-categories">
<?php foreach ($categories as $cat) : ?>
<a href="<?php echo esc_url(get_category_link($cat)); ?>" class="single-category"><?php echo esc_html($cat->name); ?></a>
<?php endforeach; ?>
</div>
<?php endif; ?>
<h1 class="single-title"><?php the_title(); ?></h1>
<div class="single-meta">
<span class="single-author">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16">
<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/>
<circle cx="12" cy="7" r="4"/>
</svg>
<?php the_author(); ?>
</span>
<span class="single-date">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16">
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"/>
<line x1="16" y1="2" x2="16" y2="6"/>
<line x1="8" y1="2" x2="8" y2="6"/>
<line x1="3" y1="10" x2="21" y2="10"/>
</svg>
<?php echo get_the_date(); ?>
</span>
<span class="single-reading-time">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16">
<circle cx="12" cy="12" r="10"/>
<polyline points="12 6 12 12 16 14"/>
</svg>
<?php
$word_count = str_word_count(strip_tags(get_the_content()));
$reading_time = max(1, ceil($word_count / 200));
echo sprintf(ifnex_t('%d دقیقه مطالعه', '%d min read'), $reading_time);
?>
</span>
</div>
</div>
</header>
<!-- Featured Image -->
<?php if (has_post_thumbnail()) : ?>
<div class="single-featured">
<div class="container">
<?php the_post_thumbnail('large', ['class' => 'single-featured-img']); ?>
</div>
</div>
<?php endif; ?>
<!-- Content -->
<div class="single-content">
<div class="container">
<div class="single-body">
<?php the_content(); ?>
</div>
<!-- Tags -->
<?php
$tags = get_the_tags();
if (!empty($tags)) : ?>
<div class="single-tags">
<span class="single-tags-label"><?php echo ifnex_t('برچسب‌ها:', 'Tags:'); ?></span>
<?php foreach ($tags as $tag) : ?>
<a href="<?php echo esc_url(get_tag_link($tag)); ?>" class="single-tag">#<?php echo esc_html($tag->name); ?></a>
<?php endforeach; ?>
</div>
<?php endif; ?>
<!-- Share -->
<div class="single-share">
<span class="single-share-label"><?php echo ifnex_t('اشتراک‌گذاری:', 'Share:'); ?></span>
<a href="https://twitter.com/intent/tweet?url=<?php echo urlencode(get_permalink()); ?>&text=<?php echo urlencode(get_the_title()); ?>" target="_blank" class="share-btn">Twitter</a>
<a href="https://www.linkedin.com/sharing/share-offsite/?url=<?php echo urlencode(get_permalink()); ?>" target="_blank" class="share-btn">LinkedIn</a>
<a href="https://wa.me/?text=<?php echo urlencode(get_the_title() . ' ' . get_permalink()); ?>" target="_blank" class="share-btn">WhatsApp</a>
</div>
<!-- Navigation -->
<nav class="single-nav">
<div class="single-nav-prev">
<?php
$prev = get_previous_post();
if ($prev) : ?>
<span class="single-nav-label"><?php echo ifnex_t('پست قبلی', 'Previous'); ?></span>
<a href="<?php echo esc_url(get_permalink($prev)); ?>"><?php echo esc_html($prev->post_title); ?></a>
<?php endif; ?>
</div>
<div class="single-nav-next">
<?php
$next = get_next_post();
if ($next) : ?>
<span class="single-nav-label"><?php echo ifnex_t('پست بعدی', 'Next'); ?></span>
<a href="<?php echo esc_url(get_permalink($next)); ?>"><?php echo esc_html($next->post_title); ?></a>
<?php endif; ?>
</div>
</nav>
</div>
</div>
</article>
<?php endwhile; ?>
<?php get_footer(); ?>

View File

@ -786,6 +786,665 @@ button { cursor: pointer; font-family: inherit; border: none; background: none;
color: var(--white) !important;
}
/*
LOGO IMAGE SUPPORT
*/
.logo-img-wrap {
display: flex;
align-items: center;
justify-content: center;
max-height: 50px;
flex-shrink: 0;
}
.logo-img-wrap img {
max-height: 50px;
max-width: 180px;
width: auto;
height: auto;
object-fit: contain;
}
.site-footer .logo-img-wrap {
max-height: 60px;
}
.site-footer .logo-img-wrap img {
max-height: 60px;
max-width: 200px;
}
/*
LANGUAGE SWITCHER
*/
.lang-switcher {
display: flex;
align-items: center;
gap: 4px;
background: var(--gray-100);
padding: 4px;
border-radius: var(--radius-sm);
margin-left: 8px;
}
.lang-divider {
color: var(--gray-300);
font-size: 0.85rem;
user-select: none;
}
.lang-btn {
padding: 6px 12px;
border-radius: 4px;
font-size: 0.8rem;
font-weight: 700;
color: var(--gray-600);
transition: all var(--transition);
text-decoration: none;
letter-spacing: 0.5px;
}
.lang-btn:hover {
color: var(--primary-dark);
}
.lang-btn.active {
background: var(--primary);
color: var(--white);
box-shadow: 0 2px 6px rgba(245,158,11,.3);
}
.lang-switcher-mobile {
display: flex;
gap: 8px;
margin-bottom: 12px;
}
.lang-switcher-mobile .lang-btn {
flex: 1;
text-align: center;
padding: 12px;
background: var(--gray-100);
border: 1px solid var(--gray-200);
border-radius: var(--radius-md);
}
.lang-switcher-mobile .lang-btn.active {
background: var(--primary-light);
border-color: var(--primary);
color: var(--primary-dark);
}
/*
ENGLISH MODE (LTR ADJUSTMENTS)
*/
html.lang-en body {
font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}
html.lang-en .nav-list a,
html.lang-en .btn,
html.lang-en .footer-links a,
html.lang-en .service-link svg {
transform: none;
}
html.lang-en .service-link svg,
html.lang-en .footer-links a::before {
transform: scaleX(-1);
}
/*
BLOG HERO
*/
.blog-hero {
position: relative;
padding: 140px 0 80px;
background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
overflow: hidden;
text-align: center;
}
.blog-hero::before {
content: '';
position: absolute;
inset: 0;
background: radial-gradient(circle at 30% 50%, rgba(245,158,11,.15) 0%, transparent 60%);
}
.blog-hero-content {
position: relative;
z-index: 1;
}
.blog-hero-title {
font-size: clamp(2rem, 4vw, 3rem);
font-weight: 900;
color: var(--white);
margin: 12px 0;
letter-spacing: -1px;
}
.blog-hero-subtitle {
font-size: 1.1rem;
color: rgba(255,255,255,.7);
max-width: 600px;
margin: 0 auto;
}
/*
BLOG GRID
*/
.blog-section {
padding: 80px 0;
background: var(--gray-100);
}
.blog-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 32px;
}
.blog-card {
background: var(--white);
border-radius: var(--radius-md);
overflow: hidden;
box-shadow: var(--shadow-sm);
border: 1px solid var(--gray-200);
transition: transform var(--transition), box-shadow var(--transition);
display: flex;
flex-direction: column;
}
.blog-card:hover {
transform: translateY(-6px);
box-shadow: var(--shadow-lg);
}
.blog-card-image {
display: block;
aspect-ratio: 16/10;
overflow: hidden;
background: var(--gray-100);
}
.blog-card-image img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform var(--transition);
}
.blog-card:hover .blog-card-image img {
transform: scale(1.05);
}
.blog-card-image-placeholder {
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
color: var(--gray-400);
}
.blog-card-content {
padding: 24px;
display: flex;
flex-direction: column;
flex: 1;
}
.blog-card-meta {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 12px;
font-size: 0.8rem;
color: var(--gray-500);
flex-wrap: wrap;
}
.blog-card-date {
display: flex;
align-items: center;
gap: 4px;
}
.blog-card-category {
background: var(--primary-light);
color: var(--primary-dark);
padding: 3px 10px;
border-radius: 100px;
font-weight: 600;
font-size: 0.75rem;
}
.blog-card-title {
font-size: 1.15rem;
font-weight: 700;
color: var(--gray-900);
line-height: 1.4;
margin-bottom: 10px;
}
.blog-card-title a {
color: inherit;
text-decoration: none;
transition: color var(--transition);
}
.blog-card-title a:hover {
color: var(--primary-dark);
}
.blog-card-excerpt {
font-size: 0.88rem;
color: var(--gray-600);
line-height: 1.65;
margin-bottom: 18px;
flex: 1;
}
.blog-card-link {
display: inline-flex;
align-items: center;
gap: 6px;
font-size: 0.85rem;
font-weight: 600;
color: var(--primary-dark);
text-decoration: none;
transition: gap var(--transition);
}
.blog-card-link:hover {
gap: 10px;
}
html.lang-en .blog-card-link svg {
transform: scaleX(-1);
}
/*
BLOG PAGINATION
*/
.blog-pagination {
margin-top: 56px;
display: flex;
justify-content: center;
}
.pagination-links {
display: flex;
gap: 8px;
list-style: none;
}
.pagination-links .page-numbers {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 40px;
height: 40px;
padding: 0 12px;
background: var(--white);
border: 1px solid var(--gray-200);
border-radius: var(--radius-sm);
font-size: 0.9rem;
font-weight: 600;
color: var(--gray-700);
text-decoration: none;
transition: all var(--transition);
}
.pagination-links .page-numbers:hover {
border-color: var(--primary);
color: var(--primary-dark);
background: var(--primary-light);
}
.pagination-links .page-numbers.current {
background: var(--primary);
border-color: var(--primary);
color: var(--white);
box-shadow: var(--shadow-amber);
}
/*
BLOG EMPTY STATE
*/
.blog-empty {
text-align: center;
padding: 80px 24px;
color: var(--gray-400);
}
.blog-empty svg {
margin-bottom: 20px;
color: var(--gray-300);
}
.blog-empty h2 {
font-size: 1.5rem;
color: var(--gray-700);
margin-bottom: 10px;
}
.blog-empty p {
color: var(--gray-500);
margin-bottom: 24px;
}
/*
SINGLE POST
*/
.single-header {
padding: 120px 0 40px;
background: var(--gray-100);
border-bottom: 1px solid var(--gray-200);
}
.single-breadcrumb {
display: flex;
align-items: center;
gap: 8px;
font-size: 0.85rem;
color: var(--gray-500);
margin-bottom: 20px;
flex-wrap: wrap;
}
.single-breadcrumb a {
color: var(--gray-600);
text-decoration: none;
transition: color var(--transition);
}
.single-breadcrumb a:hover {
color: var(--primary-dark);
}
.single-breadcrumb .current {
color: var(--gray-400);
}
.single-categories {
display: flex;
gap: 8px;
margin-bottom: 16px;
flex-wrap: wrap;
}
.single-category {
background: var(--primary-light);
color: var(--primary-dark);
padding: 5px 14px;
border-radius: 100px;
font-size: 0.8rem;
font-weight: 600;
text-decoration: none;
transition: all var(--transition);
}
.single-category:hover {
background: var(--primary);
color: var(--white);
}
.single-title {
font-size: clamp(1.8rem, 4vw, 2.8rem);
font-weight: 900;
color: var(--gray-900);
line-height: 1.25;
margin-bottom: 20px;
letter-spacing: -0.5px;
}
.single-meta {
display: flex;
align-items: center;
gap: 20px;
font-size: 0.9rem;
color: var(--gray-600);
flex-wrap: wrap;
}
.single-meta > span {
display: flex;
align-items: center;
gap: 6px;
}
.single-meta svg {
color: var(--primary);
}
.single-featured {
padding: 40px 0;
background: var(--white);
}
.single-featured-img {
width: 100%;
height: auto;
border-radius: var(--radius-lg);
box-shadow: var(--shadow-md);
}
.single-content {
padding: 48px 0 80px;
background: var(--white);
}
.single-body {
max-width: 760px;
margin: 0 auto;
font-size: 1.05rem;
line-height: 1.8;
color: var(--gray-800);
}
.single-body h2 {
font-size: 1.6rem;
font-weight: 800;
margin: 32px 0 16px;
color: var(--gray-900);
}
.single-body h3 {
font-size: 1.3rem;
font-weight: 700;
margin: 24px 0 12px;
color: var(--gray-900);
}
.single-body p {
margin-bottom: 18px;
}
.single-body ul, .single-body ol {
margin: 16px 0 16px 24px;
padding: 0;
}
html.lang-en .single-body ul,
html.lang-en .single-body ol {
margin: 16px 24px 16px 0;
}
.single-body li {
margin-bottom: 8px;
list-style: disc;
}
.single-body ol li {
list-style: decimal;
}
.single-body blockquote {
border-right: 4px solid var(--primary);
padding: 16px 24px;
background: var(--primary-light);
margin: 24px 0;
border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
font-style: italic;
color: var(--gray-700);
}
html.lang-en .single-body blockquote {
border-right: none;
border-left: 4px solid var(--primary);
border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.single-body img {
border-radius: var(--radius-md);
margin: 24px 0;
}
.single-body a {
color: var(--primary-dark);
text-decoration: underline;
text-underline-offset: 3px;
}
.single-body a:hover {
color: var(--primary);
}
/* Single: Tags & Share */
.single-tags, .single-share {
max-width: 760px;
margin: 40px auto 0;
padding: 24px 0;
border-top: 1px solid var(--gray-200);
display: flex;
align-items: center;
gap: 12px;
flex-wrap: wrap;
}
.single-tags-label, .single-share-label {
font-size: 0.9rem;
font-weight: 600;
color: var(--gray-700);
}
.single-tag {
display: inline-block;
background: var(--gray-100);
color: var(--gray-700);
padding: 4px 12px;
border-radius: 100px;
font-size: 0.82rem;
text-decoration: none;
transition: all var(--transition);
}
.single-tag:hover {
background: var(--primary-light);
color: var(--primary-dark);
}
.share-btn {
display: inline-block;
padding: 6px 14px;
background: var(--gray-100);
color: var(--gray-700);
border-radius: 100px;
font-size: 0.82rem;
font-weight: 600;
text-decoration: none;
transition: all var(--transition);
}
.share-btn:hover {
background: var(--primary);
color: var(--white);
}
/* Single: Navigation */
.single-nav {
max-width: 760px;
margin: 40px auto 0;
padding: 32px 0;
border-top: 1px solid var(--gray-200);
display: grid;
grid-template-columns: 1fr 1fr;
gap: 32px;
}
.single-nav-prev {
text-align: right;
}
html.lang-en .single-nav-prev {
text-align: left;
}
.single-nav-next {
text-align: left;
}
html.lang-en .single-nav-next {
text-align: right;
}
.single-nav-label {
display: block;
font-size: 0.8rem;
color: var(--gray-500);
margin-bottom: 6px;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.single-nav a {
font-size: 0.95rem;
font-weight: 600;
color: var(--gray-900);
text-decoration: none;
transition: color var(--transition);
display: inline-block;
}
.single-nav a:hover {
color: var(--primary-dark);
}
/*
ADMIN BAR OFFSET (WordPress Fix)
*/
.admin-bar .site-header { top: 32px; }
.admin-bar .mobile-drawer { top: 104px; }
.admin-bar .blog-hero { padding-top: 172px; }
.admin-bar .single-header { padding-top: 152px; }
@media screen and (max-width: 782px) {
.admin-bar .site-header { top: 46px; }
.admin-bar .mobile-drawer { top: 118px; }
.admin-bar .blog-hero { padding-top: 186px; }
.admin-bar .single-header { padding-top: 166px; }
}
/*
RESPONSIVE ADDITIONS
*/
@media (max-width: 1024px) {
.blog-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}
@media (max-width: 768px) {
.lang-switcher { display: none; }
.blog-grid { grid-template-columns: 1fr; }
.blog-hero { padding: 120px 0 60px; }
.blog-section { padding: 48px 0; }
.single-header { padding: 100px 0 32px; }
.single-nav { grid-template-columns: 1fr; gap: 20px; }
.single-title { font-size: 1.8rem; }
.single-meta { font-size: 0.8rem; gap: 12px; }
}
/* ─── Responsive ──────────────────────────────────── */
@media (max-width: 1024px) {
.services-grid { grid-template-columns: repeat(2, 1fr); }