commit f408faac54ffa540dcee86921aa56fa4eab745ac Author: Kazem Alghasi Date: Sat Aug 15 22:11:08 2026 +0330 build(theme): scaffold initial theme directory structure and assets Initialize the base WordPress theme files, including core template hierarchy (index, page, single, archive, 404), WooCommerce template overrides, and essential asset directories. diff --git a/404.php b/404.php new file mode 100644 index 0000000..d79d19f --- /dev/null +++ b/404.php @@ -0,0 +1,25 @@ + +
+

404 - صفحه مورد نظر یافت نشد

+

متأسفانه صفحه‌ای که به دنبال آن بودید یافت نشد. لطفاً چک کنید که آدرس درست باشد یا به صفحه اصلی بروید.

+
+ +
+ +
+ '; + +get_footer(); +?> \ No newline at end of file diff --git a/archive-product.php b/archive-product.php new file mode 100644 index 0000000..cec86e4 --- /dev/null +++ b/archive-product.php @@ -0,0 +1,192 @@ +name) ? $current_term->name : 'فروشگاه'; +?> + +
+ +
+
+

+

+ خانه + + +

+
+
+ +
+
+ + + + + +
+ + +
+ + + + + + + +
+ $value ) { + if ( $key !== 'orderby' ) { + echo ''; + } + }?> + +
+
+ + + +
+ +
+ + +
+ +
+ + + +
+ +

محصولی یافت نشد

+

متأسفانه محصولی با این مشخصات پیدا نشد.

+ + + مشاهده همه محصولات + +
+ + +
+
+
+
+ + + + + \ No newline at end of file diff --git a/archive.php b/archive.php new file mode 100644 index 0000000..7008e5f --- /dev/null +++ b/archive.php @@ -0,0 +1,108 @@ + + +
+ +
+
+

+ ' . get_search_query() . '' ); } + else { _e( 'مجله سلامت مطیب', 'motayeb' ); } ?> +

+

+ خانه + + مجله +

+
+
+ +
+ +
+ + + +
+ + +
+ 2, + 'prev_text' => '', + 'next_text' => '', + ) ); + ?> +
+ + + +
+ +

مقاله‌ای یافت نشد

+

متأسفانه موردی با این مشخصات پیدا نشد.

+ + بازگشت به خانه + +
+ +
+
+ + \ No newline at end of file diff --git a/assets/css/main.css b/assets/css/main.css new file mode 100644 index 0000000..6a743c6 --- /dev/null +++ b/assets/css/main.css @@ -0,0 +1,1224 @@ +/* ========================================= + Motayeb Theme - Clean & Final Styles + ========================================= */ + +/* فونت پیش‌فرض */ +* { font-family: 'Vazirmatn', sans-serif; } +.font-inter { font-family: 'Inter', sans-serif; } + +/* اسکرولبار سفارشی */ +::-webkit-scrollbar { width: 6px; height: 6px; } +::-webkit-scrollbar-track { background: #F5F0E8; } +::-webkit-scrollbar-thumb { background: #D4A574; border-radius: 3px; } +::-webkit-scrollbar-thumb:hover { background: #C08B52; } +.dark ::-webkit-scrollbar-track { background: #1A1D23; } +.dark ::-webkit-scrollbar-thumb { background: #2D5F3F; border-radius: 3px; } +.dark ::-webkit-scrollbar-thumb:hover { background: #6fb88a; } + +/* پترن لانه زنبوری */ +.honeycomb-bg { + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%23D4A574' stroke-width='0.5' opacity='0.1'/%3E%3Cpath d='M28 0L28 34L0 50L0 84L28 100L56 84L56 50L28 34' fill='none' stroke='%23D4A574' stroke-width='0.5' opacity='0.1'/%3E%3C/svg%3E"); +} + +/* ابزارهای عمومی */ +.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } +.search-overlay { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); } +.cart-badge { animation: pulseSoft 2s ease-in-out infinite; } +input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; background: #2D5F3F; border-radius: 50%; cursor: pointer; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.2); } +.dark input[type="range"]::-webkit-slider-thumb { background: #6fb88a; border-color: #22262E; } + +/* انیمیشن‌ها */ +@keyframes pulseSoft { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } } +@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } } +.animate-float { animation: float 3s ease-in-out infinite; } + +@media (max-width: 767px) { .bottom-nav { padding-bottom: env(safe-area-inset-bottom, 0); } } + + +/* ========================================= + منوهای وردپرس + ========================================= */ +header nav ul, header .flex.items-center.gap-8 ul { + list-style: none !important; padding: 0 !important; margin: 0 !important; + display: flex !important; align-items: center !important; gap: 2rem !important; +} +header nav ul li a, header .flex.items-center.gap-8 ul li a { + font-size: 0.875rem !important; font-weight: 500 !important; color: #8B5A3C !important; + transition: color 0.2s ease !important; position: relative !important; + display: inline-block !important; padding: 0 !important; margin: 0 !important; + background: none !important; border: none !important; line-height: 1.5 !important; +} +header nav ul li a::after, header .flex.items-center.gap-8 ul li a::after { + content: '' !important; display: block !important; width: 0 !important; height: 2px !important; + background: #2D5F3F !important; transition: width 0.3s ease !important; + position: absolute !important; bottom: -4px !important; right: 0 !important; +} +header nav ul li a:hover, header .flex.items-center.gap-8 ul li a:hover { color: #2D5F3F !important; } +header nav ul li a:hover::after, header .flex.items-center.gap-8 ul li a:hover::after { width: 100% !important; } +.dark header nav ul li a, .dark header .flex.items-center.gap-8 ul li a { color: #E8E6E3 !important; } +.dark header nav ul li a:hover, .dark header .flex.items-center.gap-8 ul li a:hover { color: #6fb88a !important; } +.dark header nav ul li a::after, .dark header .flex.items-center.gap-8 ul li a::after { background: #6fb88a !important; } + +/* منوی موبایل */ +#mobile-menu nav ul { flex-direction: column !important; gap: 0 !important; } +#mobile-menu nav ul li { width: 100%; } +#mobile-menu nav ul li a { + display: flex !important; align-items: center !important; gap: 0.75rem !important; + padding: 0.75rem 1rem !important; border-radius: 0.75rem !important; font-size: 0.9rem !important; + color: #8B5A3C !important; width: 100% !important; +} +#mobile-menu nav ul li a::after { display: none !important; } +#mobile-menu nav ul li a:hover { background-color: rgba(45, 95, 63, 0.06) !important; color: #2D5F3F !important; } +.dark #mobile-menu nav ul li a { color: #E8E6E3 !important; } +.dark #mobile-menu nav ul li a:hover { background-color: rgba(45, 95, 63, 0.15) !important; color: #6fb88a !important; } +header nav ul ul, header .flex.items-center.gap-8 ul ul { display: none !important; } + + +/* ========================================= + محافظت‌های ریسپانسیو + ========================================= */ +img { max-width: 100% !important; height: auto !important; } +p, span, a, h1, h2, h3, h4, h5, h6, li { word-wrap: break-word !important; overflow-wrap: break-word !important; } + +@media (max-width: 767px) { + .text-4xl { font-size: 2rem !important; } + .text-3xl { font-size: 1.5rem !important; } + .text-2xl { font-size: 1.25rem !important; } + .py-16, .py-24 { padding-top: 3rem !important; padding-bottom: 3rem !important; } + .py-28 { padding-top: 4rem !important; padding-bottom: 4rem !important; } + .gap-12 { gap: 2rem !important; } + .gap-8 { gap: 1.5rem !important; } + .product-card .quick-actions { opacity: 1 !important; transform: translateY(0) !important; pointer-events: auto !important; position: static !important; margin-top: 0.5rem; } + .product-card:hover .product-img { transform: none !important; } + .animate-float { display: none !important; } +} +@media (min-width: 768px) and (max-width: 1023px) { + .text-6xl { font-size: 2.75rem !important; } + .text-7xl { font-size: 3.5rem !important; } +} + + +/* ========================================= + فروشگاه و آرشیو (archive-product) + ========================================= */ +/* کارت محصولات */ +.product-card { position: relative; overflow: hidden; } +.product-card .quick-actions { opacity: 0; transform: translateY(10px); pointer-events: none; transition: all 0.3s ease; z-index: 10; } +.product-card:hover .quick-actions { opacity: 1; transform: translateY(0); pointer-events: auto; } +.product-card:hover .product-img { transform: scale(1.08); } +.product-img { transition: transform 0.5s ease; } + +.product-card .button { + flex: 1; padding: 0.625rem 1rem; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(4px); + border-radius: 0.75rem; font-size: 0.75rem; font-weight: 700; color: #8B5A3C; + display: flex; align-items: center; justify-content: center; gap: 0.25rem; transition: all 0.2s; border: none; cursor: pointer; +} +.product-card .button:hover { background: #2D5F3F; color: #fff; } +.dark .product-card .button { background: rgba(34, 38, 46, 0.9); color: #E8E6E3; } +.dark .product-card .button:hover { background: #6fb88a; color: #1A1D23; } + +/* تگ تخفیف */ +.woocommerce span.onsale { position: absolute; top: 0.75rem; right: 0.75rem; background: #dc2626; color: #fff; padding: 0.25rem 0.625rem; border-radius: 9999px; font-size: 0.625rem; font-weight: 700; min-height: auto; min-width: auto; line-height: 1.5; margin: 0; z-index: 5; } +.woocommerce-ordering { display: none; } +.product-card .price del { opacity: 0.5; } + +/* گرید و صفحه بندی */ +ul.products { display: contents !important; } +ul.products li.product { width: 100% !important; margin: 0 !important; float: none !important; } + +.woocommerce-pagination ul.page-numbers { display: flex; align-items: center; gap: 0.5rem; list-style: none; padding: 0; margin: 0; } +.woocommerce-pagination ul.page-numbers li a, +.woocommerce-pagination ul.page-numbers li span { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 0.75rem; font-size: 0.875rem; font-weight: 500; border: 1px solid #EBE3D5; color: #8B5A3C; transition: all 0.2s; text-decoration: none; } +.woocommerce-pagination ul.page-numbers li a:hover { background: #F5F0E8; border-color: #2D5F3F; color: #2D5F3F; } +.woocommerce-pagination ul.page-numbers li span.current { background: #2D5F3F; border-color: #2D5F3F; color: #fff; } +.dark .woocommerce-pagination ul.page-numbers li a, +.dark .woocommerce-pagination ul.page-numbers li span { border-color: #2E333D; color: #E8E6E3; } +.dark .woocommerce-pagination ul.page-numbers li a:hover { background: #22262E; border-color: #6fb88a; color: #6fb88a; } +.dark .woocommerce-pagination ul.page-numbers li span.current { background: #6fb88a; border-color: #6fb88a; color: #1A1D23; } + + +/* ========================================= + محصول تکی (single-product) + ========================================= */ +/* مخفی کردن اجزای اضافه گالری وردپرس */ +.woocommerce-product-gallery .woocommerce-product-gallery__trigger, +.woocommerce-product-gallery__wrapper .flex-viewport, +.woocommerce-product-gallery .flex-control-thumbs, +.woocommerce-product-gallery .flex-direction-nav { display: none !important; } + +/* تامبنیل‌ها */ +.gallery-thumb { transition: border-color 0.2s ease; } +.gallery-thumb.active { border-color: #2D5F3F !important; } +.dark .gallery-thumb.active { border-color: #6fb88a !important; } + +/* تب‌های توضیحات */ +.woocommerce-tabs { max-width: 100%; } +.woocommerce-tabs ul.tabs { list-style: none !important; padding: 0 !important; margin: 0 0 2rem 0 !important; display: flex !important; gap: 2rem; border-bottom: 1px solid #EBE3D5 !important; overflow-x: auto; } +.dark .woocommerce-tabs ul.tabs { border-bottom-color: #2E333D !important; } +.woocommerce-tabs ul.tabs li { background: none !important; border: none !important; margin: 0 !important; padding: 0 !important; border-radius: 0 !important; } +.woocommerce-tabs ul.tabs li::before, .woocommerce-tabs ul.tabs li::after { display: none !important; content: none !important; border: none !important; } +.woocommerce-tabs ul.tabs li a { display: block !important; padding: 1rem 0 !important; font-size: 0.875rem !important; font-weight: 700 !important; color: #A99478 !important; border-bottom: 2px solid transparent !important; transition: all 0.2s !important; outline: none !important; text-decoration: none !important; box-shadow: none !important; border-radius: 0 !important; } +.woocommerce-tabs ul.tabs li.active a { color: #2D5F3F !important; border-bottom-color: #2D5F3F !important; } +.woocommerce-tabs ul.tabs li a:hover { color: #2D5F3F !important; } +.dark .woocommerce-tabs ul.tabs li a { color: #9CA3AF !important; } +.dark .woocommerce-tabs ul.tabs li.active a { color: #6fb88a !important; border-bottom-color: #6fb88a !important; } +.dark .woocommerce-tabs ul.tabs li a:hover { color: #6fb88a !important; } +.woocommerce-tabs .panel { margin-top: 0 !important; padding: 0 !important; } +.woocommerce-tabs .panel h2 { display: none !important; } +.woocommerce-tabs .panel p { color: #8B5A3C; line-height: 1.8; font-size: 0.9rem; } +.dark .woocommerce-tabs .panel p { color: #9CA3AF; } + +/* محصولات مرتبط */ +.related.products { margin-top: 2rem; } +.related.products > h2 { font-size: 1.5rem !important; font-weight: 800 !important; margin-bottom: 0 !important; padding: 0 !important; color: #8B5A3C !important; } +.dark .related.products > h2 { color: #E8E6E3 !important; } +.related.products ul.products { display: grid !important; grid-template-columns: repeat(2, 1fr); gap: 1rem; } +@media (min-width: 1024px) { .related.products ul.products { grid-template-columns: repeat(4, 1fr); gap: 1.5rem; } } +.related.products ul.products li.product { width: 100% !important; margin: 0 !important; float: none !important; } + + +/* ========================================= + نظرات و ستاره‌ها (سیستم سفارشی جدید) + ========================================= */ +/* مخفی کردن کامل ستاره‌های قدیمی و فیلدهای تکراری وردپرس */ +.woocommerce .star-rating, +#review_form .comment-form p.stars, +#review_form .comment-form p.comment-form-comment, +#review_form .comment-form p.comment-form-author, +#review_form .comment-form p.comment-form-email, +.woocommerce-Reviews #respond .comment-form p.stars { + display: none !important; +} + +/* افکت هاور برای ستاره‌های متنی جدید فرم */ +#custom-star-rating .star { transition: color 0.15s ease; cursor: pointer; } +#custom-star-rating .star.active { color: #D4A574 !important; } + +/* ========================================= + سبد خرید (Cart) + ========================================= */ + +/* مخفی کردن جدول زشت پیش‌فرض ووکامرس */ +.shop_table, .shop_table.responsive { + display: none !important; +} + +/* استایل اینپوت تعداد داخل سبد */ +.woocommerce cart-form .quantity, +.woocommerce .quantity { + border: none !important; + background: none !important; + width: auto !important; + height: auto !important; +} +.woocommerce .quantity .qty { + width: 3.5rem !important; + height: 2.5rem !important; + border: 1px solid #EBE3D5 !important; + border-radius: 0.5rem !important; + text-align: center !important; + font-size: 0.875rem !important; + font-weight: 700 !important; + color: #2D5F3F !important; + background: #FDFBF7 !important; +} +.dark .woocommerce .quantity .qty { + border-color: #2E333D !important; + background: #22262E !important; + color: #6fb88a !important; +} + +/* متغیرهای محصول (مثل سایز و رنگ) */ +.wc-item-meta { + margin-top: 0.25rem; + font-size: 0.75rem; + color: #A99478 !important; +} +.wc-item-meta p { + margin: 0 !important; + font-size: 0.75rem !important; + color: #A99478 !important; +} +.dark .wc-item-meta, .dark .wc-item-meta p { + color: #9CA3AF !important; +} + +/* استایل بخش خلاصه سفارش و کپن */ +.cart_totals { + background: transparent !important; + border: none !important; + padding: 0 !important; + width: 100% !important; + float: none !important; +} +.cart_totals h2 { + display: none !important; +} +.cart_totals table { + border: none !important; + margin: 0 0 1rem 0 !important; + border-collapse: collapse !important; + width: 100%; +} +.cart_totals table th, +.cart_totals table td { + border: none !important; + padding: 0.5rem 0 !important; + font-size: 0.875rem !important; + vertical-align: middle; +} +.cart_totals table th { + font-weight: 400 !important; + color: #A99478 !important; + text-align: left !important; /* راست‌چین بودن خودکار با dir=rtl انجام میشه */ + padding-left: 1rem !important; + width: 50%; +} +.dark .cart_totals table th { + color: #9CA3AF !important; +} +.cart_totals table td { + font-weight: 700 !important; + color: #2D5F3F !important; + text-align: right !important; +} +.dark .cart_totals table td { + color: #6fb88a !important; +} +/* خط جداکننده زیر جمع کل */ +.cart_totals table tr.order-total td, +.cart_totals table tr.order-total th { + border-top: 1px solid #EBE3D5 !important; + padding-top: 1rem !important; + margin-top: 0.5rem; + font-size: 1.1rem !important; +} +.dark .cart_totals table tr.order-total td, +.dark .cart_totals table tr.order-total th { + border-top-color: #2E333D !important; +} + +/* استایل فرم کد تخفیف */ +.woocommerce-cart .coupon { + margin-bottom: 1.5rem !important; + padding: 0 !important; + border: none !important; + background: none !important; +} +.woocommerce-cart .coupon .input-text { + width: 100% !important; + padding: 0.75rem 1rem !important; + border: 1px solid #EBE3D5 !important; + border-radius: 0.75rem !important; + background: #F5F0E8 !important; + font-family: 'Vazirmatn', sans-serif !important; + font-size: 0.875rem !important; + color: #8B5A3C !important; + outline: none; +} +.woocommerce-cart .coupon .input-text:focus { + border-color: #2D5F3F !important; +} +.dark .woocommerce-cart .coupon .input-text { + background: #1A1D23 !important; + border-color: #2E333D !important; + color: #E8E6E3 !important; +} +.woocommerce-cart .coupon button[name="apply_coupon"] { + width: 100%; + margin-top: 0.75rem; + padding: 0.75rem !important; + background: #F5F0E8 !important; + color: #8B5A3C !important; + border: none !important; + border-radius: 0.75rem !important; + font-family: 'Vazirmatn', sans-serif !important; + font-weight: 700 !important; + cursor: pointer; + transition: all 0.2s; +} +.woocommerce-cart .coupon button[name="apply_coupon"]:hover { + background: #EBE3D5 !important; + color: #2D5F3F !important; +} +.dark .woocommerce-cart .coupon button[name="apply_coupon"] { + background: #22262E !important; + color: #E8E6E3 !important; +} +.dark .woocommerce-cart .coupon button[name="apply_coupon"]:hover { + background: #2E333D !important; +} + +/* پیام‌های ووکامرس (مثل کد تخفیف اشتباه) */ +.woocommerce-message, .woocommerce-error, .woocommerce-info { + border: 1px solid #2D5F3F !important; + background: #e8f5ec !important; + color: #2D5F3F !important; + border-radius: 1rem !important; + padding: 1rem 1.25rem !important; + font-size: 0.875rem !important; + margin-bottom: 1.5rem !important; +} +.woocommerce-error { + border-color: #dc2626 !important; + background: #fef2f2 !important; + color: #dc2626 !important; +} +.dark .woocommerce-message { background: #13291c !important; border-color: #2D5F3F !important; color: #6fb88a !important; } +.dark .woocommerce-error { background: #1a1215 !important; border-color: #7f1d1d !important; color: #fca5a5 !important; } +.woocommerce-message::before, .woocommerce-error::before, .woocommerce-info::before { color: inherit !important; top: 1.1rem !important; } + +/* ========================================= + سبد خرید (روش بدون باگ - فقط CSS) + ========================================= */ + +/* مخفی کردن عناوین اضافه */ +.woocommerce-cart .shop_table th { + display: none !important; +} +.woocommerce-cart .shop_table .product-name a { + font-weight: 700 !important; + color: #8B5A3C !important; + font-size: 0.95rem !important; +} +.dark .woocommerce-cart .shop_table .product-name a { + color: #E8E6E3 !important; +} +.woocommerce-cart .shop_table .product-name a:hover { + color: #2D5F3F !important; +} +.dark .woocommerce-cart .shop_table .product-name a:hover { + color: #6fb88a !important; +} + +/* استایل کلی جدول */ +.woocommerce-cart .shop_table { + border: none !important; + border-collapse: separate !important; + border-spacing: 0 0 0.75rem 0 !important; + background: transparent !important; +} +.woocommerce-cart .shop_table tbody { + border: none !important; +} + +/* استایل هر ردیف محصول (تبدیل به کارت) */ +.woocommerce-cart .shop_table tr { + background: #fff !important; + border-radius: 1rem !important; + box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important; + border: 1px solid rgba(235, 227, 213, 0.5) !important; + transition: all 0.2s ease; +} +.woocommerce-cart .shop_table tr:hover { + box-shadow: 0 4px 12px rgba(0,0,0,0.06) !important; +} +.dark .woocommerce-cart .shop_table tr { + background: #22262E !important; + border-color: rgba(46, 51, 61, 0.5) !important; +} + +/* سلول‌ها */ +.woocommerce-cart .shop_table td { + border: none !important; + padding: 1rem !important; + vertical-align: middle !important; +} + +/* عکس محصول */ +.woocommerce-cart .shop_table .product-thumbnail { + width: 80px !important; +} +.woocommerce-cart .shop_table .product-thumbnail img { + width: 80px !important; + height: 80px !important; + object-fit: cover !important; + border-radius: 0.75rem !important; +} + +/* حذف متن "یکا" و متغیرها */ +.woocommerce-cart .shop_table .product-name .variation, +.woocommerce-cart .shop_table .product-name .wc-item-meta { + font-size: 0.75rem !important; + color: #A99478 !important; + margin-top: 0.25rem !important; +} +.dark .woocommerce-cart .shop_table .product-name .variation, +.dark .woocommerce-cart .shop_table .product-name .wc-item-meta { + color: #9CA3AF !important; +} + +/* اینپوت تعداد */ +.woocommerce-cart .quantity .qty { + width: 3.5rem !important; + height: 2.5rem !important; + border: 1px solid #EBE3D5 !important; + border-radius: 0.5rem !important; + text-align: center !important; + font-size: 0.875rem !important; + font-weight: 700 !important; + color: #2D5F3F !important; + background: #FDFBF7 !important; +} +.dark .woocommerce-cart .quantity .qty { + border-color: #2E333D !important; + background: #1A1D23 !important; + color: #6fb88a !important; +} + +/* قیمت محصول */ +.woocommerce-cart .shop_table .product-subtotal { + font-weight: 800 !important; + color: #2D5F3F !important; + font-size: 0.95rem !important; +} +.dark .woocommerce-cart .shop_table .product-subtotal { + color: #6fb88a !important; +} + +/* دکمه حذف */ +.woocommerce-cart .shop_table .product-remove a { + width: 2rem !important; + height: 2rem !important; + display: flex !important; + align-items: center; + justify-content: center; + border-radius: 0.5rem !important; + color: #A99478 !important; + background: transparent !important; + border: none !important; + font-size: 0 !important; + text-indent: -9999px; + transition: all 0.2s; +} +.woocommerce-cart .shop_table .product-remove a::before { + content: '✕' !important; + font-size: 0.875rem !important; + text-indent: 0 !important; + color: #A99478 !important; +} +.woocommerce-cart .shop_table .product-remove a:hover { + background: #fef2f2 !important; + color: #dc2626 !important; +} +.woocommerce-cart .shop_table .product-remove a:hover::before { + color: #dc2626 !important; +} + +/* دکمه به‌روزرسانی */ +.woocommerce-cart .actions input[name="update_cart"] { + background: #F5F0E8 !important; + color: #8B5A3C !important; + border: 2px solid #EBE3D5 !important; + border-radius: 0.75rem !important; + padding: 0.7rem 1.5rem !important; + font-family: 'Vazirmatn', sans-serif !important; + font-weight: 700 !important; + font-size: 0.875rem !important; + cursor: pointer; + transition: all 0.2s; +} +.woocommerce-cart .actions input[name="update_cart"]:hover { + border-color: #2D5F3F !important; + color: #2D5F3F !important; +} +.dark .woocommerce-cart .actions input[name="update_cart"] { + background: #22262E !important; + border-color: #2E333D !important; + color: #E8E6E3 !important; +} + +/* استایل کپن و خلاصه سفارش */ +.woocommerce-cart .cart_totals { + background: #fff !important; + border: 1px solid rgba(235, 227, 213, 0.5) !important; + border-radius: 1rem !important; + padding: 1.5rem !important; + width: 100% !important; + float: none !important; +} +.dark .woocommerce-cart .cart_totals { + background: #22262E !important; + border-color: rgba(46, 51, 61, 0.5) !important; +} +.woocommerce-cart .cart_totals h2 { + font-size: 1.1rem !important; + margin-bottom: 1rem !important; + color: #8B5A3C !important; +} +.dark .woocommerce-cart .cart_totals h2 { + color: #E8E6E3 !important; +} + +/* جداول داخل خلاصه */ +.woocommerce-cart .cart_totals table { + border: none !important; +} +.woocommerce-cart .cart_totals table th, +.woocommerce-cart .cart_totals table td { + border: none !important; + padding: 0.6rem 0 !important; + font-size: 0.875rem !important; +} +.woocommerce-cart .cart_totals table th { + font-weight: 400 !important; + color: #A99478 !important; + padding-left: 1rem !important; + width: 50%; +} +.dark .woocommerce-cart .cart_totals table th { + color: #9CA3AF !important; +} +.woocommerce-cart .cart_totals table td { + font-weight: 700 !important; + color: #2D5F3F !important; +} +.dark .woocommerce-cart .cart_totals table td { + color: #6fb88a !important; +} +.woocommerce-cart .cart_totals table tr.order-total td, +.woocommerce-cart .cart_totals table tr.order-total th { + border-top: 1px solid #EBE3D5 !important; + padding-top: 1rem !important; + font-size: 1.1rem !important; +} +.dark .woocommerce-cart .cart_totals table tr.order-total td, +.dark .woocommerce-cart .cart_totals table tr.order-total th { + border-top-color: #2E333D !important; +} + +/* فرم کد تخفیف */ +.woocommerce-cart .coupon .input-text { + width: 100% !important; + padding: 0.75rem 1rem !important; + border: 1px solid #EBE3D5 !important; + border-radius: 0.75rem !important; + background: #F5F0E8 !important; + font-family: 'Vazirmatn', sans-serif !important; + font-size: 0.875rem !important; + color: #8B5A3C !important; + outline: none; +} +.woocommerce-cart .coupon .input-text:focus { + border-color: #2D5F3F !important; +} +.dark .woocommerce-cart .coupon .input-text { + background: #1A1D23 !important; + border-color: #2E333D !important; + color: #E8E6E3 !important; +} +.woocommerce-cart .coupon button[name="apply_coupon"] { + width: 100%; + margin-top: 0.75rem; + padding: 0.75rem !important; + background: #F5F0E8 !important; + color: #8B5A3C !important; + border: none !important; + border-radius: 0.75rem !important; + font-family: 'Vazirmatn', sans-serif !important; + font-weight: 700 !important; + cursor: pointer; + transition: all 0.2s; +} +.woocommerce-cart .coupon button[name="apply_coupon"]:hover { + background: #EBE3D5 !important; + color: #2D5F3F !important; +} +.dark .woocommerce-cart .coupon button[name="apply_coupon"] { + background: #22262E !important; + color: #E8E6E3 !important; +} + +/* دکمه پرداخت (تسویه) */ +.woocommerce-cart .wc-proceed-to-checkout a.checkout-button { + display: block !important; + width: 100%; + padding: 1rem !important; + background: #2D5F3F !important; + color: #fff !important; + border-radius: 1rem !important; + font-size: 1rem !important; + font-family: 'Vazirmatn', sans-serif !important; + font-weight: 700 !important; + text-align: center !important; + box-shadow: 0 10px 15px -3px rgba(45, 95, 63, 0.25) !important; + transition: all 0.2s !important; +} +.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover { + background: #254d34 !important; + transform: translateY(-2px); +} +.dark .woocommerce-cart .wc-proceed-to-checkout a.checkout-button { + background: #6fb88a !important; + color: #1A1D23 !important; + box-shadow: 0 10px 15px -3px rgba(111, 184, 138, 0.25) !important; +} + +/* ریسپانسیو سبد خرید */ +@media (max-width: 768px) { + .woocommerce-cart .shop_table { + border-spacing: 0 0 0.5rem 0 !important; + } + .woocommerce-cart .shop_table .product-thumbnail { + width: 60px !important; + } + .woocommerce-cart .shop_table .product-thumbnail img { + width: 60px !important; + height: 60px !important; + } +} + +/* ========================================= + تسویه حساب (Checkout) - استایل کامل + ========================================= */ + +/* چیدمان ۲ ستونه فرم‌ها (نام و تلفن کنار هم) */ +.woocommerce-checkout #customer_details { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 1rem; +} +@media (max-width: 768px) { + .woocommerce-checkout #customer_details { + grid-template-columns: 1fr; + } +} + +/* تیترهای بخش‌ها (صورتحساب، ارسال، پرداخت) */ +.woocommerce-checkout .woocommerce-billing-fields > h3, +.woocommerce-checkout .woocommerce-shipping-fields > h3, +.woocommerce-checkout .woocommerce-additional-fields > h3, +.woocommerce-checkout #order_review_heading { + font-size: 1.15rem !important; + font-weight: 800 !important; + color: #2D5F3F !important; + margin-bottom: 1.25rem !important; + padding-bottom: 0.75rem !important; + border-bottom: 2px solid #EBE3D5 !important; +} +.dark .woocommerce-checkout .woocommerce-billing-fields > h3, +.dark .woocommerce-checkout .woocommerce-shipping-fields > h3, +.dark .woocommerce-checkout .woocommerce-additional-fields > h3, +.dark .woocommerce-checkout #order_review_heading { + color: #6fb88a !important; + border-bottom-color: #2E333D !important; +} + +/* سطرهای فرم */ +.woocommerce form .form-row { + display: grid !important; + gap: 1rem !important; + margin-bottom: 0.75rem !important; +} +.woocommerce form .form-row-first, +.woocommerce form .form-row-last { + width: 100% !important; + float: none !important; +} +.woocommerce form .form-row-wide { + width: 100% !important; + float: none !important; +} + +/* فیلدهای ورودی */ +.woocommerce-checkout .input-text, +.woocommerce-checkout select, +.woocommerce-checkout textarea { + width: 100% !important; + padding: 0.875rem 1rem !important; + border: 1px solid #EBE3D5 !important; + border-radius: 0.75rem !important; + background: #FDFBF7 !important; + font-family: 'Vazirmatn', sans-serif !important; + font-size: 0.875rem !important; + color: #8B5A3C !important; + outline: none; + transition: border-color 0.2s, box-shadow 0.2s; + box-sizing: border-box !important; + height: auto !important; +} +.woocommerce-checkout .input-text:focus, +.woocommerce-checkout select:focus, +.woocommerce-checkout textarea:focus { + border-color: #2D5F3F !important; + box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.1) !important; +} +.dark .woocommerce-checkout .input-text, +.dark .woocommerce-checkout select, +.dark .woocommerce-checkout textarea { + background: #1A1D23 !important; + border-color: #2E333D !important; + color: #E8E6E3 !important; +} +.dark .woocommerce-checkout .input-text:focus, +.dark .woocommerce-checkout select:focus, +.dark .woocommerce-checkout textarea:focus { + border-color: #6fb88a !important; + box-shadow: 0 0 0 3px rgba(111, 184, 138, 0.1) !important; +} + +/* لیبل‌ها (نام، تلفن، آدرس و...) */ +.woocommerce-checkout .form-row label { + font-size: 0.8rem !important; + font-weight: 600 !important; + color: #8B5A3C !important; + margin-bottom: 0.35rem !important; + display: block !important; +} +.dark .woocommerce-checkout .form-row label { + color: #9CA3AF !important; +} +.woocommerce-checkout .form-row .required { + color: #dc2626 !important; + text-decoration: none !important; +} + +/* باکس روش‌های پرداخت */ +.woocommerce-checkout #payment { + background: #fff !important; + border: 1px solid rgba(235, 227, 213, 0.5) !important; + border-radius: 1.25rem !important; + padding: 1.5rem !important; + margin-top: 2rem !important; +} +.dark .woocommerce-checkout #payment { + background: #22262E !important; + border-color: rgba(46, 51, 61, 0.5) !important; +} +.woocommerce-checkout #payment ul.payment_methods { + list-style: none !important; + padding: 0 0 1rem 0 !important; + margin: 0 0 1rem 0 !important; + border-bottom: 1px solid #EBE3D5 !important; +} +.dark .woocommerce-checkout #payment ul.payment_methods { + border-bottom-color: #2E333D !important; +} +.woocommerce-checkout #payment ul.payment_methods li { + padding: 0.75rem 1rem !important; + background: #FDFBF7 !important; + border: 1px solid #EBE3D5 !important; + border-radius: 0.75rem !important; + margin-bottom: 0.5rem !important; + transition: all 0.2s; +} +.dark .woocommerce-checkout #payment ul.payment_methods li { + background: #1A1D23 !important; + border-color: #2E333D !important; +} +.woocommerce-checkout #payment ul.payment_methods li:hover { + border-color: #2D5F3F !important; +} +.dark .woocommerce-checkout #payment ul.payment_methods li:hover { + border-color: #6fb88a !important; +} + +/* دکمه ثبت سفارش (سبز بزرگ) */ +.woocommerce-checkout #place_order { + display: block !important; + width: 100% !important; + padding: 1rem !important; + background: #2D5F3F !important; + color: #fff !important; + border-radius: 1rem !important; + font-family: 'Vazirmatn', sans-serif !important; + font-weight: 700 !important; + font-size: 1.05rem !important; + cursor: pointer; + transition: all 0.2s; + box-shadow: 0 10px 15px -3px rgba(45, 95, 63, 0.3) !important; + border: none !important; + margin-top: 1.5rem !important; +} +.woocommerce-checkout #place_order:hover { + background: #254d34 !important; + transform: translateY(-2px); + box-shadow: 0 15px 20px -5px rgba(45, 95, 63, 0.4) !important; +} +.dark .woocommerce-checkout #place_order { + background: #6fb88a !important; + color: #1A1D23 !important; + box-shadow: 0 10px 15px -3px rgba(111, 184, 138, 0.3) !important; +} +.dark .woocommerce-checkout #place_order:hover { + background: #4a9a6b !important; +} + +/* خلاصه سفارش سایدبار */ +.woocommerce-checkout-review-order { + background: #fff !important; + border: 1px solid rgba(235, 227, 213, 0.5) !important; + border-radius: 1.25rem !important; + padding: 1.5rem !important; +} +.dark .woocommerce-checkout-review-order { + background: #22262E !important; + border-color: rgba(46, 51, 61, 0.5) !important; +} +.woocommerce-checkout-review-order-table { + border: none !important; +} +.woocommerce-checkout-review-order-table th { + border-bottom: 1px solid #EBE3D5 !important; + padding: 0.75rem 0 !important; + font-weight: 400 !important; + color: #A99478 !important; + font-size: 0.875rem !important; +} +.dark .woocommerce-checkout-review-order-table th { + border-bottom-color: #2E333D !important; + color: #9CA3AF !important; +} +.woocommerce-checkout-review-order-table td { + border-bottom: 1px solid #F5F0E8 !important; + padding: 0.75rem 0 !important; + font-size: 0.875rem !important; +} +.dark .woocommerce-checkout-review-order-table td { + border-bottom-color: #2E333D !important; +} +.woocommerce-checkout-review-order-table .product-name { + color: #8B5A3C !important; + font-weight: 600 !important; +} +.dark .woocommerce-checkout-review-order-table .product-name { + color: #E8E6E3 !important; +} +.woocommerce-checkout-review-order-table .product-quantity { + color: #A99478 !important; +} +.woocommerce-checkout-review-order-table .product-total { + color: #2D5F3F !important; + font-weight: 700 !important; +} +.dark .woocommerce-checkout-review-order-table .product-total { + color: #6fb88a !important; +} +/* جمع کل */ +.woocommerce-checkout .order-total th, +.woocommerce-checkout .order-total td { + border-top: 2px solid #2D5F3F !important; + font-size: 1.1rem !important; + font-weight: 800 !important; + color: #2D5F3F !important; +} +.dark .woocommerce-checkout .order-total th, +.dark .woocommerce-checkout .order-total td { + border-top-color: #6fb88a !important; + color: #6fb88a !important; +} + +/* ========================================= + بلاگ و مقالات + ========================================= */ + +/* صفحه بندی وردپرس */ +nav.post-navigation, +.nav-links { + display: flex !important; + align-items: center; + gap: 0.5rem; +} +.nav-links .page-numbers { + display: flex !important; + align-items: center; + justify-content: center; + width: 40px; + height: 40px; + border-radius: 0.75rem; + font-size: 0.875rem; + font-weight: 500; + border: 1px solid #EBE3D5 !important; + color: #8B5A3C !important; + text-decoration: none !important; + transition: all 0.2s; +} +.nav-links .page-numbers.current { + background: #2D5F3F !important; + border-color: #2D5F3F !important; + color: #fff !important; +} +.nav-links .page-numbers:hover { + background: #F5F0E8; + border-color: #2D5F3F; + color: #2D5F3F; +} +.dark .nav-links .page-numbers { + border-color: #2E333D !important; + color: #E8E6E3 !important; +} +.dark .nav-links .page-numbers.current { + background: #6fb88a !important; + border-color: #6fb88a !important; + color: #1A1D23 !important; +} +.dark .nav-links .page-numbers:hover { + background: #22262E; + border-color: #6fb88a; + color: #6fb88a; +} + +/* فرم کامنت‌ها */ +.comment-respond { + margin-top: 3rem; +} +.comment-respond .comment-form input[type="text"], +.comment-respond .comment-form input[type="email"], +.comment-respond .comment-form input[type="url"], +.comment-respond .comment-form textarea { + width: 100% !important; + padding: 0.875rem 1rem !important; + border: 1px solid #EBE3D5 !important; + border-radius: 0.75rem !important; + background: #FDFBF7 !important; + font-family: 'Vazirmatn', sans-serif !important; + font-size: 0.875rem !important; + color: #8B5A3C !important; + outline: none; + transition: border-color 0.2s; +} +.comment-respond .comment-form input:focus, +.comment-respond .comment-form textarea:focus { + border-color: #2D5F3F !important; +} +.dark .comment-respond .comment-form input[type="text"], +.dark .comment-respond .comment-form input[type="email"], +.dark .comment-respond .comment-form input[type="url"], +.dark .comment-respond .comment-form textarea { + background: #1A1D23 !important; + border-color: #2E333D !important; + color: #E8E6E3 !important; +} +.comment-respond .form-submit input[type="submit"] { + background: #2D5F3F !important; + color: #fff !important; + border: none !important; + border-radius: 1rem !important; + padding: 0.875rem 2rem !important; + font-family: 'Vazirmatn', sans-serif !important; + font-weight: 700 !important; + cursor: pointer; + transition: background 0.2s; +} +.comment-respond .form-submit input[type="submit"]:hover { + background: #254d34 !important; +} +.dark .comment-respond .form-submit input[type="submit"] { + background: #6fb88a !important; + color: #1A1D23 !important; +} + +/* ========================================= + کامنت‌های بلاگ (استایل برای callback) + ========================================= */ + +/* شماره و عنوان */ +#comments .comments-title { + font-size: 1.25rem !important; + font-weight: 800 !important; + color: #2D5F3F !important; + margin-bottom: 2rem !important; + padding-bottom: 1rem !important; + border-bottom: 2px solid #EBE3D5 !important; +} +.dark #comments .comments-title { + color: #6fb88a !important; + border-bottom-color: #2E333D !important; +} + +/* لیست نظرات */ +#comments ol.comment-list { + list-style: none !important; + padding: 0 !important; + margin: 0 !important; +} +#comments ol.comment-list li { + background: #FDFBF7 !important; + border: 1px solid #EBE3D5 !important; + border-radius: 1rem !important; + padding: 1.25rem !important; + margin-bottom: 1rem !important; + transition: box-shadow 0.2s; +} +#comments ol.comment-list li:hover { + box-shadow: 0 4px 12px rgba(0,0,0,0.06); +} +.dark #comments ol.comment-list li { + background: #22262E !important; + border-color: #2E333D !important; +} +#comments ol.comment-list ul.children { + list-style: none !important; + padding-right: 2rem !important; + margin-top: 1rem !important; + border-right: 2px solid #EBE3D5 !important; +} +.dark #comments ol.comment-list ul.children { + border-right-color: #2E333D !important; +} +#comments ol.comment-list li ul.children li { + margin-top: 1rem !important; +} + +/* متا نویسنده */ +.motayeb-comment-meta { + font-size: 0.95rem !important; + font-weight: 700 !important; + color: #8B5A3F3C !important; + margin-bottom: 0.25rem !important; +} +.dark .motayeb-comment-meta { + color: #E8E6E3 !important; +} + +/* متادیتا */ +.motayeb-comment-date { + font-size: 0.75rem !important; + color: #A99478 !important; + margin-bottom: 1rem !important; + padding-bottom: 1rem !important; + border-bottom: 1px solid #EBE3D5 !important; +} +.dark .motayeb-comment-date { + color: #9CA3AF !important; + border-bottom-color: #2E333D !important; +} +#comments .comment-awaiting-moderation { + background: #FEF3C7 !important; + color: #92400E !important; + padding: 0.5rem 1rem !important; + border-radius: 0.5rem !important; + font-size: 0.8rem !important; + margin-bottom: 1rem !important; + display: inline-block; +} +.dark #comments .comment-awaiting-moderation { + background: #1a1810 !important; + color: #fbbf24 !important; +} + +/* متن نظر */ +.motayeb-comment-text p { + font-size: 0.875rem !important; + color: #8B5A3C !important; + line-height: 1.8 !important; + margin: 0 !important; +} +.dark .motayeb-comment-text p { + color: #9CA3AF !important; +} + +/* دکمه پاسخ */ +.motayeb-reply-btn { + font-family: 'Vazirmatn', sans-serif !important; + font-size: 0.8rem !important; + font-weight: 600 !important; + color: #2D5F3F !important; + display: inline-flex !important; + align-items: center !important; + gap: 0.35rem !important; + padding: 0.4rem 0.8rem !important; + border: 1px solid #EBE3D5 !important; + border-radius: 0.5rem !important; + text-decoration: none !important; + transition: all 0.2s !important; +} +.motayeb-reply-btn:hover { + background: #2D5F3F !important; + color: #fff !important; + border-color: #2D5F3F !important; +} +.dark .motayeb-reply-btn { + color: #6fb88a !important; + border-color: #2E333D !important; +} +.dark .motayeb-reply-btn:hover { + background: #6fb88a !important; + color: #1A1D23 !important; + border-color: #6fb88a !important; +} + +/* صفحه بندی نظرات */ +#comments .nav-links { + display: flex !important; + align-items: center; + gap: 0.5rem; + margin-top: 2rem !important; + padding-top: 2rem !important; + border-top: 1px solid #EBE3D5 !important; +} +.dark #comments .nav-links { + border-top-color: #2E333D !important; +} + +/* فرم ثبت نظر */ +#respond { + margin-top: 3rem !important; + padding-top: 2rem !important; + border-top: 1px solid #EBE3D5 !important; +} +#respond .comment-form input[type="text"], +#respond .comment-form input[type="email"], +#respond .comment-form input[type="url"], +#respond .comment-form textarea { + width: 100% !important; + padding: 0.875rem 1rem !important; + border: 1px solid #EBE3D5 !important; + border-radius: 0.75rem !important; + background: #FDFBF7 !important; + font-family: 'Vazirmatn', sans-serif !important; + font-size: 0.875rem !important; + color: #8B5A3C !important; + outline: none; + transition: border-color 0.2s !important; + box-sizing: border-box !important; +} +#respond .comment-form input:focus, +#respond .comment-form textarea:focus { + border-color: #2D5F3F !important; +} +.dark #respond .comment-form input[type="text"], +.dark #respond .comment-form input[type="email"], +.dark #respond .comment-form input[type="url"], +.dark #respond .comment-form textarea { + background: #1A1D23 !important; + border-color: #2E333D !important; + color: #E8E6E3 !important; +} +#respond .comment-form textarea { + resize: vertical !important; + min-height: 120px !important; +} +#respond .form-submit input[type="submit"] { + background: #2D5F5F !important; + color: #fff !important; + border: none !important; + border-radius: 1rem !important; + padding: 0.875rem 2rem !important; + font-family: 'Vazirmatn', sans-serif !important; + font-weight: 700 !important; + font-size: 0.95rem !important; + cursor: pointer; + transition: background 0.2s !important; + display: block !important; + width: 100% !important; +} +#respond .form-submit input[type="submit"]:hover { + background: #254d34 !important; +} +.dark #respond .form-submit input[type="submit"] { + background: #6fb88a !important; + color: #1A1D23 !important; +} +#respond .logged-in-as { + margin-bottom: 1.5rem !important; + padding: 1rem !important; + background: #F5F0E8 !important; + border-radius: 0.75rem !important; + font-size: 0.875rem !important; + color: #8B5A3C !important; +} +.dark #respond .logged-in-as { + background: #22262E !important; + color: #9CA3AF !important; +} \ No newline at end of file diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..c7365b8 --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1,319 @@ +/** + * Motayeb Theme - Main JavaScript + * مدیریت تعاملات، حالت تاریک، اسکرول و انیمیشن‌ها + */ + +document.addEventListener('DOMContentLoaded', function () { + + const html = document.documentElement; + const body = document.body; + const header = document.getElementById('header'); + + // ========================================== + // ۱. مدیریت حالت تاریک (Dark Mode) + // ========================================== + function initDarkMode() { + // بررسی تنظیمات ذخیره شده یا تنظیمات سیستم عامل + const savedTheme = localStorage.getItem('motayeb-theme'); + if (savedTheme === 'dark') { + html.classList.add('dark'); + } + + // اتصال رویداد به دکمه تغییر تم + const darkBtn = header ? header.querySelector('button[aria-label="حالت تاریک"]') : null; + if (darkBtn) { + darkBtn.addEventListener('click', function () { + html.classList.toggle('dark'); + const isDark = html.classList.contains('dark'); + localStorage.setItem('motayeb-theme', isDark ? 'dark' : 'light'); + }); + } + } + + // ========================================== + // ۲. سایه هدر هنگام اسکرول + // ========================================== + function initHeaderScroll() { + if (!header) return; + window.addEventListener('scroll', function () { + if (window.scrollY > 50) { + header.classList.add('shadow-lg'); + } else { + header.classList.remove('shadow-lg'); + } + }, { passive: true }); + } + + // ========================================== + // ۳. مدیریت پنل جستجو + // ========================================== + function initSearchOverlay() { + const overlay = document.getElementById('search-overlay'); + if (!overlay) return; + + const input = overlay.querySelector('.search-field'); + const openBtns = document.querySelectorAll('[aria-label="جستجو"]'); + + // باز کردن + openBtns.forEach(function (btn) { + btn.addEventListener('click', function () { + overlay.classList.remove('hidden'); + body.style.overflow = 'hidden'; // قفل اسکرول + setTimeout(function () { if (input) input.focus(); }, 150); + }); + }); + + // بستن با کلیک روی بک‌دراپ + overlay.addEventListener('click', function (e) { + if (e.target === overlay) { + closeSearch(); + } + }); + } + + function closeSearch() { + const overlay = document.getElementById('search-overlay'); + if (overlay) { + overlay.classList.add('hidden'); + body.style.overflow = ''; // آزاد کردن اسکرول + } + } + + // ========================================== + // ۴. مدیریت منوی موبایل + // ========================================== + function initMobileMenu() { + const menu = document.getElementById('mobile-menu'); + if (!menu) return; + + // پیدا کردن دکمه همبرگرری + const openBtn = header ? header.querySelector('button[aria-label="منوی موبایل"]') : null; + + // پیدا کردن دکمه ضربدر داخل منو و بک‌دراپ + const closeBtn = menu.querySelector('button'); + const backdrop = menu.querySelector('.absolute.inset-0'); + + if (openBtn) { + openBtn.addEventListener('click', function () { + menu.classList.remove('hidden'); + body.style.overflow = 'hidden'; + }); + } + + if (closeBtn) { + closeBtn.addEventListener('click', closeMobileMenu); + } + if (backdrop) { + backdrop.addEventListener('click', closeMobileMenu); + } + } + + function closeMobileMenu() { + const menu = document.getElementById('mobile-menu'); + if (menu) { + menu.classList.add('hidden'); + body.style.overflow = ''; + } + } + + // ========================================== + // ۵. میانبرهای کیبورد + // ========================================== + function initKeyboardShortcuts() { + document.addEventListener('keydown', function (e) { + // بستن با Escape + if (e.key === 'Escape') { + closeSearch(); + closeMobileMenu(); + } + // باز کردن جستجو با Ctrl+K + if ((e.metaKey || e.ctrlKey) && e.key === 'k') { + e.preventDefault(); + const overlay = document.getElementById('search-overlay'); + if (overlay) { + overlay.classList.toggle('hidden'); + if (!overlay.classList.contains('hidden')) { + body.style.overflow = 'hidden'; + setTimeout(function () { + const input = overlay.querySelector('.search-field'); + if (input) input.focus(); + }, 150); + } else { + body.style.overflow = ''; + } + } + } + }); + } + + // ========================================== + // ۶. اسکرول نرم برای لینک‌های # + // ========================================== + function initSmoothScroll() { + document.querySelectorAll('a[href^="#"]:not([href="#"])').forEach(function (anchor) { + anchor.addEventListener('click', function (e) { + const targetId = this.getAttribute('href'); + const targetElement = document.querySelector(targetId); + + if (targetElement) { + e.preventDefault(); + closeMobileMenu(); // بستن منو اگر باز بود + + const headerHeight = header ? header.offsetHeight : 0; + const elementPosition = targetElement.getBoundingClientRect().top + window.pageYOffset; + const offsetPosition = elementPosition - headerHeight - 20; + + window.scrollTo({ + top: offsetPosition, + behavior: 'smooth' + }); + } + }); + }); + } + + // ========================================== + // ۷. انیمیشن هنگام اسکرول (Scroll Reveal) + // ========================================== + function initScrollAnimations() { + const elements = document.querySelectorAll('.animate-slide-up, .animate-fade-in'); + if (elements.length === 0) return; + + // مخفی کردن اولیه + elements.forEach(function (el) { + el.style.opacity = '0'; + el.style.transform = 'translateY(30px)'; + el.style.transition = 'opacity 0.7s cubic-bezier(0.5, 0, 0, 1), transform 0.7s cubic-bezier(0.5, 0, 0, 1)'; + }); + + const observer = new IntersectionObserver(function (entries) { + entries.forEach(function (entry) { + if (entry.isIntersecting) { + entry.target.style.opacity = '1'; + entry.target.style.transform = 'translateY(0)'; + observer.unobserve(entry.target); // توقف مشاهده پس از اجرا + } + }); + }, { + threshold: 0.1, + rootMargin: '0px 0px -40px 0px' + }); + + elements.forEach(function (el) { + observer.observe(el); + }); + } + + // ========================================== + // ۸. سیستم توست (برای استفاده در ووکامرس بعداً) + // ========================================== + window.motayebToast = function (message, type) { + type = type || 'success'; + + // حذف توست قبلی اگر وجود داشت + const existingToast = document.querySelector('.motayeb-toast-notification'); + if (existingToast) existingToast.remove(); + + var toast = document.createElement('div'); + toast.className = 'motayeb-toast-notification fixed top-24 left-1/2 -translate-x-1/2 z-[100] px-6 py-3 rounded-2xl shadow-2xl text-sm font-semibold text-white flex items-center gap-2 transition-all duration-300'; + + // تنظیم رنگ و آیکون + if (type === 'success') { + toast.style.backgroundColor = '#2D5F3F'; + toast.innerHTML = ' ' + message; + } else if (type === 'error') { + toast.style.backgroundColor = '#dc2626'; + toast.innerHTML = ' ' + message; + } else { + toast.style.backgroundColor = '#8B5A3C'; + toast.innerHTML = ' ' + message; + } + + // حالت اولیه (مخفی بالای صفحه) + toast.style.opacity = '0'; + toast.style.transform = 'translate(-50%, -20px)'; + + body.appendChild(toast); + + // انیمیشن ورود + requestAnimationFrame(function () { + toast.style.opacity = '1'; + toast.style.transform = 'translate(-50%, 0)'; + }); + + // حذف خودکار + setTimeout(function () { + toast.style.opacity = '0'; + toast.style.transform = 'translate(-50%, -20px)'; + setTimeout(function () { toast.remove(); }, 300); + }, 3000); + }; + + + // ========================================== + // اجرای تمام توابع + // ========================================== + initDarkMode(); + initHeaderScroll(); + initSearchOverlay(); + initMobileMenu(); + initKeyboardShortcuts(); + initSmoothScroll(); + initScrollAnimations(); + + // ========================================== + // ۹. تعویض عکس در صفحه محصول + // ========================================== + window.changeProductImage = function (btn, imgUrl) { + // تغییر عکس اصلی + const mainImg = document.getElementById('main-product-image'); + if (mainImg) { + mainImg.src = imgUrl; + mainImg.setAttribute('data-large_image', imgUrl); + } + + // تغییر کلاس فعال تامبنیل‌ها + document.querySelectorAll('.gallery-thumb').forEach(function (thumb) { + thumb.classList.remove('active'); + thumb.style.borderColor = ''; + }); + btn.classList.add('active'); + }; + + // ========================================== + // ۱۰. ستاره‌های امتیازدهی سفارشی + // ========================================== + const starsContainer = document.getElementById('custom-star-rating'); + const ratingInput = document.getElementById('rating'); + if (starsContainer && ratingInput) { + const stars = starsContainer.querySelectorAll('.star'); + + stars.forEach(star => { + star.addEventListener('mouseenter', function() { + const val = this.dataset.value; + stars.forEach(s => { + s.style.color = s.dataset.value <= val ? '#D4A574' : ''; + }); + }); + + star.addEventListener('click', function() { + ratingInput.value = this.dataset.value; + stars.forEach(s => s.classList.remove('active')); + this.classList.add('active'); + // رنگ دادن به همه ستاره‌های تا اون عدد + const val = this.dataset.value; + stars.forEach(s => { + if(s.dataset.value <= val) s.classList.add('active'); + }); + }); + }); + + starsContainer.addEventListener('mouseleave', function() { + const currentVal = ratingInput.value; + stars.forEach(s => { + s.style.color = s.dataset.value <= currentVal ? '#D4A574' : ''; + }); + }); + } + +}); \ No newline at end of file diff --git a/author.php b/author.php new file mode 100644 index 0000000..5e45e97 --- /dev/null +++ b/author.php @@ -0,0 +1,47 @@ + +

پنل کاربری

+

خوش آمدید، ' . esc_html($current_user->display_name) . '

+
+

نام کاربری: ' . esc_html($current_user->user_login) . '

+

ایمیل: ' . esc_html($current_user->user_email) . '

+

نقش: ' . esc_html(implode(', ', $current_user->roles)) . '

+
+ + '; +} else { + // Display login form + echo '
+

ورود به حساب کاربری

+
+

+ +

+

+ +

+

+ + +

+
+

رمز عبور خود را فراموش کرده‌اید؟

+
'; +} + +get_footer(); +?> \ No newline at end of file diff --git a/comments.php b/comments.php new file mode 100644 index 0000000..7de320f --- /dev/null +++ b/comments.php @@ -0,0 +1,9 @@ + 'div', + 'avatar_size' => 48, + 'max_depth' => 3, +)); +?> \ No newline at end of file diff --git a/footer.php b/footer.php new file mode 100644 index 0000000..f9b4713 --- /dev/null +++ b/footer.php @@ -0,0 +1,95 @@ + + +
+ + + + + + \ No newline at end of file diff --git a/front-page.php b/front-page.php new file mode 100644 index 0000000..49ca91e --- /dev/null +++ b/front-page.php @@ -0,0 +1,319 @@ + + +
+ + +
+
+
+
+
+ + محصولات ۱۰۰٪ ارگانیک و طبیعی +
+ +

+ + طعم + واقعی +
+ طبیعت + + طعم + واقعی +
+ طبیعت + +

+ +

+ +

+ + + + + 0): ?> +
+ $stat): ?> +
+
+
+
+
'; ?> + +
+ +
+ + +
+ +
+ <?php echo esc_attr($hero_img['alt'] ?? ''); ?> +
+
+ +
+
+ +

لطفاً از تنظیمات صفحه، تصویر هیرو را آپلود کنید.

+
+
+ +
+

پلاگین ACF فعال نیست.

+
+ + + + +
+
+ +
+ +
+
+ + + 0): ?> +
+
+
+ CATEGORIES +

دسته‌بندی محصولات

+

از عسل‌های کوهستان تا دمنوش‌های گیاهی، بهترین‌های طبیعت را کشف کنید

+
+
+ 'honey', 'forest'=>'forest', 'red'=>'red', 'emerald'=>'emerald', 'amber'=>'amber'); + $c = $color_map[$cat['color']] ?? 'forest'; + ?> + +
+ +
+

+ +
+ +
+
+
+ + + + 0): ?> +
+
+
+
+ BESTSELLERS +

پرفروش‌ترین‌ها

+
+ +
+ +
+
+ + + + +
+
+
+
+ +
+ <?php echo esc_attr($story_img['alt'] ?? ''); ?> +
+ +
+
+ OUR STORY +

+

+ + 0): ?> +
+ +
+
+ +
+
+
+
+
+
+ +
+ + + 0): ?> +
+ +
+ + +
+ +
+ +
+
+
+
+ + + + 0): ?> +
+
+
+
+ TESTIMONIALS +

نظرات مشتریان ما

+
+
+ +
+
★★★★★
+

«»

+
+
+
+
+
+
+
+
+ +
+
+
+ + + +
+
+
+ +
+

+

+
+ + +
+
+
+ + +
+
+
+
+
+
ارسال سریع
به سراسر ایران
+
+
+
+
ضمانت اصالت
۱۰۰٪ اصل و طبیعی
+
+
+
+
پرداخت امن
درگاه‌های معتبر
+
+
+
+
بازگشت آسان
۷ روز ضمانت
+
+
+
+
+ +
+ + \ No newline at end of file diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..9629285 --- /dev/null +++ b/functions.php @@ -0,0 +1,263 @@ + __( 'منوی اصلی', 'motayeb' ), + 'footer' => __( 'منوی فوتر', 'motayeb' ), + ) ); +} +add_action( 'after_setup_theme', 'motayeb_setup' ); + +// ۲. لود فایل‌های CSS و JS +function motayeb_scripts() { + wp_enqueue_style( 'vazirmatn', 'https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap', array(), null ); + wp_enqueue_script( 'tailwind-cdn', 'https://cdn.tailwindcss.com', array(), null, false ); + + wp_add_inline_script( 'tailwind-cdn', " + tailwind.config = { + darkMode: 'class', + theme: { + extend: { + colors: { + forest: { 50:'#e8f5ec', 100:'#c6e6cf', 200:'#9ed0ae', 300:'#6fb88a', 400:'#4a9a6b', 500:'#2D5F3F', 600:'#254d34', 700:'#1c3b28', 800:'#13291c', 900:'#0a1710' }, + cream: { 50:'#FDFBF7', 100:'#F5F0E8', 200:'#EBE3D5', 300:'#DDD2BF', 400:'#C4B49A', 500:'#A99478' }, + honey: { 50:'#FDF5ED', 100:'#F9E6D0', 200:'#F2CC9E', 300:'#E8AC6A', 400:'#D4A574', 500:'#C08B52', 600:'#A07040', 700:'#7D5630', 800:'#5A3D20', 900:'#3A2612' }, + earth: { 50:'#F5EDE7', 100:'#E8D5C7', 200:'#D4B5A0', 300:'#BF9276', 400:'#8B5A3C', 500:'#734A30', 600:'#5C3B25', 700:'#452C1B', 800:'#2E1D12', 900:'#170E09' }, + dark: { bg:'#1A1D23', card:'#22262E', border:'#2E333D', text:'#E8E6E3', muted:'#9CA3AF' } + }, + fontFamily: { vazir: ['Vazirmatn', 'sans-serif'], inter: ['Inter', 'sans-serif'] } + } + } + } + " ); + + wp_enqueue_style( 'motayeb-main', get_template_directory_uri() . '/assets/css/main.css', array(), '1.0.0' ); + wp_enqueue_script( 'iconify', 'https://code.iconify.design/iconify-icon/1.0.7/iconify-icon.min.js', array(), null, true ); + wp_enqueue_script( 'motayeb-main', get_template_directory_uri() . '/assets/js/main.js', array(), '1.0.0', true ); +} +add_action( 'wp_enqueue_scripts', 'motayeb_scripts' ); + +// ۳. حذف استایل پیش‌فرض ووکامرس +add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' ); + +// ۴. بازنویسی تگ‌های Wraper ووکامرس +function motayeb_woo_wrapper_start() { + echo '
'; +} +function motayeb_woo_wrapper_end() { + echo '
'; +} +remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 ); +remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 ); +add_action( 'woocommerce_before_main_content', 'motayeb_woo_wrapper_start', 10 ); +add_action( 'woocommerce_after_main_content', 'motayeb_woo_wrapper_end', 10 ); + +// ۵. تنظیمات فروشگاه +add_filter( 'loop_shop_columns', function() { return 4; } ); +add_filter( 'loop_shop_per_page', function() { return 12; } ); + +// ۶. اضافه کردن کلاس nav-link به منو +add_filter('nav_menu_link_attributes', 'motayeb_add_nav_link_class', 10, 3); +function motayeb_add_nav_link_class($atts, $item, $args) { + if ($args->theme_location === 'primary') { + $atts['class'] = isset($atts['class']) ? $atts['class'] . ' nav-link' : 'nav-link'; + } + return $atts; +} + +// ۸. فیلدهای صفحه اصلی (ACF) +if ( function_exists( 'acf_add_local_field_group' ) ) { + acf_add_local_field_group( array( + 'key' => 'group_motayeb_homepage', + 'title' => 'تنظیمات صفحه اصلی مطیب', + 'fields' => array( + array( 'key' => 'field_hero_tab', 'label' => 'بخش هیرو', 'type' => 'tab' ), + array( 'key' => 'field_hero_title', 'name' => 'hero_title', 'label' => 'عنوان اصلی', 'type' => 'wysiwyg', 'tabs' => 'all', 'toolbar' => 'full', 'media_upload' => false, 'default_value' => 'طعم واقعی
طبیعت' ), + array( 'key' => 'field_hero_subtitle', 'name' => 'hero_subtitle', 'label' => 'زیرعنوان', 'type' => 'textarea', 'rows' => 2, 'default_value' => 'از عسل کوهستان تا ارده سنتی، هر محصول مطیب سفری به دل طبیعت ایران است.' ), + array( 'key' => 'field_hero_image', 'name' => 'hero_image', 'label' => 'تصویر هیرو', 'type' => 'image', 'return_format' => 'array' ), + array( 'key' => 'field_hero_btn_text', 'name' => 'hero_btn_text', 'label' => 'متن دکمه', 'type' => 'text', 'default_value' => 'مشاهده محصولات' ), + array( 'key' => 'field_stats_tab', 'label' => 'آمار', 'type' => 'tab' ), + array( 'key' => 'field_stats', 'name' => 'stats', 'label' => 'آمار', 'type' => 'repeater', 'layout' => 'horizontal', 'button_label' => 'افزودن', 'sub_fields' => array( + array( 'key' => 'field_stat_number', 'name' => 'number', 'label' => 'عدد', 'type' => 'text' ), + array( 'key' => 'field_stat_label', 'name' => 'label', 'label' => 'توضیح', 'type' => 'text' ), + )), + array( 'key' => 'field_cats_tab', 'label' => 'دسته‌بندی‌ها', 'type' => 'tab' ), + array( 'key' => 'field_categories', 'name' => 'home_categories', 'label' => 'دسته‌بندی‌ها', 'type' => 'repeater', 'layout' => 'table', 'button_label' => 'افزودن', 'sub_fields' => array( + array( 'key' => 'field_cat_title', 'name' => 'title', 'label' => 'نام', 'type' => 'text' ), + array( 'key' => 'field_cat_icon', 'name' => 'icon', 'label' => 'آیکون', 'type' => 'text' ), + array( 'key' => 'field_cat_color', 'name' => 'color', 'label' => 'رنگ', 'type' => 'select', 'choices' => array( 'honey' => 'عسلی', 'forest' => 'سبز', 'red' => 'قرمز', 'emerald' => 'سبز روشن', 'amber' => 'کهربایی' ) ), + array( 'key' => 'field_cat_link', 'name' => 'link', 'label' => 'لینک', 'type' => 'url' ), + array( 'key' => 'field_cat_count', 'name' => 'count', 'label' => 'تعداد', 'type' => 'text' ), + )), + array( 'key' => 'field_bestsellers_tab', 'label' => 'پرفروش‌ها', 'type' => 'tab' ), + array( 'key' => 'field_bestsellers', 'name' => 'bestseller_ids', 'label' => 'محصولات پرفروش', 'type' => 'relationship', 'post_type' => array( 'product' ), 'filters' => array( 'search' ), 'elements' => array( 'featured_image' ), 'min' => 1, 'max' => 8, 'return_format' => 'id' ), + array( 'key' => 'field_story_tab', 'label' => 'داستان برند', 'type' => 'tab' ), + array( 'key' => 'field_story_title', 'name' => 'story_title', 'label' => 'عنوان', 'type' => 'text', 'default_value' => 'داستان مطیب، از طبیعت تا سفره شما' ), + array( 'key' => 'field_story_text', 'name' => 'story_text', 'label' => 'متن', 'type' => 'textarea', 'rows' => 4 ), + array( 'key' => 'field_story_image', 'name' => 'story_image', 'label' => 'تصویر', 'type' => 'image', 'return_format' => 'array' ), + array( 'key' => 'field_story_values', 'name' => 'story_values', 'label' => 'ویژگی‌ها', 'type' => 'repeater', 'layout' => 'table', 'button_label' => 'افزودن', 'sub_fields' => array( + array( 'key' => 'field_val_icon', 'name' => 'icon', 'label' => 'آیکون', 'type' => 'text' ), + array( 'key' => 'field_val_title', 'name' => 'title', 'label' => 'عنوان', 'type' => 'text' ), + array( 'key' => 'field_val_desc', 'name' => 'desc', 'label' => 'توضیح', 'type' => 'text' ), + )), + array( 'key' => 'field_story_badges', 'name' => 'certificates', 'label' => 'گواهی‌ها', 'type' => 'repeater', 'layout' => 'horizontal', 'button_label' => 'افزودن', 'sub_fields' => array( + array( 'key' => 'field_badge_text', 'name' => 'text', 'label' => 'متن', 'type' => 'text' ), + )), + array( 'key' => 'field_testimonials_tab', 'label' => 'نظرات', 'type' => 'tab' ), + array( 'key' => 'field_testimonials', 'name' => 'testimonials', 'label' => 'نظرات', 'type' => 'repeater', 'layout' => 'block', 'button_label' => 'افزودن', 'sub_fields' => array( + array( 'key' => 'field_test_text', 'name' => 'text', 'label' => 'متن', 'type' => 'textarea', 'rows' => 3 ), + array( 'key' => 'field_test_name', 'name' => 'name', 'label' => 'نام', 'type' => 'text' ), + array( 'key' => 'field_test_city', 'name' => 'city', 'label' => 'شهر', 'type' => 'text' ), + array( 'key' => 'field_test_init', 'name' => 'initials', 'label' => 'حروف', 'type' => 'text' ), + )), + array( 'key' => 'field_newsletter_tab', 'label' => 'خبرنامه', 'type' => 'tab' ), + array( 'key' => 'field_news_title', 'name' => 'newsletter_title', 'label' => 'عنوان', 'type' => 'text', 'default_value' => 'از تخفیف‌ها باخبر شوید' ), + array( 'key' => 'field_news_text', 'name' => 'newsletter_text', 'label' => 'توضیح', 'type' => 'text', 'default_value' => 'با عضویت در خبرنامه، از جدیدترین محصولات مطلع شوید.' ), + ), + 'location' => array( + array( array( 'param' => 'page_template', 'operator' => '==', 'value' => 'front-page.php' ) ), + ), + ) ); +} + +// =================================================================== +// تابع کمکی برای ظاهر کامنت‌ها (بدون خطای Cannot redeclare) +// =================================================================== +function motayeb_comment_callback($comment, $args, $depth) { + $author = get_comment_author($comment); + $initial = mb_substr($author, 0, 1); + $date = get_comment_date('Y/m/d'); + $text = wpautop( esc_html( get_comment_text($comment) ) ); + $is_pending = ('0' == $comment->comment_approved); + + echo '
'; + echo '
'; + echo '
'; + echo '
' . $initial . '
'; + echo '
'; + echo '
' . $author . '
'; + echo '
' . $date . ''; + echo edit_comment_link('ویرایش', ' ', ''); + echo '
'; + comment_reply_link(array_merge($args, array('reply_text' => '', 'depth' => $depth, 'max_depth' => 3, 'before' => ''))); + echo '
'; + + if ($is_pending) { + echo '

نظر شما در انتظار تایید مدیریت است.

'; + } + + echo '
' . $text . '
'; + echo '
'; +} + +// =================================================================== +// دیتای تستی (فقط با زدن ?run_motayeb_seed در آدرس سایت اجرا می‌شود) +// =================================================================== +add_action('init', 'motayeb_seed_test_data'); +function motayeb_seed_test_data() { + if (get_option('motayeb_seeded_done') || !isset($_GET['run_motayeb_seed'])) { + return; + } + require_once(ABSPATH . 'wp-admin/includes/media.php'); + require_once(ABSPATH . 'wp-admin/includes/file.php'); + require_once(ABSPATH . 'wp-admin/includes/image.php'); + + $categories = array('عسل طبیعی', 'ارده و حلوا', 'سرکه و ترشی', 'دمنوش گیاهی', 'خشکبار و آجیل', 'روغن طبیعی', 'شیره طبیعی'); + $cat_ids = array(); + foreach ($categories as $cat_name) { + $term = term_exists($cat_name, 'product_cat'); + if (!$term) { $term = wp_insert_term($cat_name, 'product_cat'); } + $cat_ids[$cat_name] = is_array($term) ? $term['term_id'] : $term; + } + + $products_data = array( + array('name' => 'عسل طبیعی کوهستان', 'desc' => 'عسل خالص و طبیعی جمع‌آوری شده از دامنه‌های زاگرس.', 'price' => 295000, 'sale_price' => 249000, 'cat' => 'عسل طبیعی', 'img' => 'https://images.unsplash.com/photo-1587049352846-4a222e784d38?w=600&q=80'), + array('name' => 'عسل آویشن و گون', 'desc' => 'عسل تک‌گلی آویشن و گون با عطر و طعمی بی‌نظیر.', 'price' => 345000, 'sale_price' => '', 'cat' => 'عسل طبیعی', 'img' => 'https://images.unsplash.com/photo-1558642452-9d2a7deb7f62?w=600&q=80'), + array('name' => 'ارده کنجد سنتی', 'desc' => 'ارده کنجد سنگ‌فرش شده با دستگاه‌های سنتی.', 'price' => 185000, 'sale_price' => '', 'cat' => 'ارده و حلوا', 'img' => 'https://images.unsplash.com/photo-1595475207225-428b62bda831?w=600&q=80'), + array('name' => 'حلوا ارده شیرین', 'desc' => 'حلوا اردهای سنتی با ترکیب ارده کنجد مرغوب.', 'price' => 210000, 'sale_price' => 189000, 'cat' => 'ارده و حلوا', 'img' => 'https://images.unsplash.com/photo-1590080875515-8a3a8dc5735e?w=600&q=80'), + array('name' => 'سرکه انگور طبیعی', 'desc' => 'سرکه انگور تخمیر شده به روش سنتی.', 'price' => 125000, 'sale_price' => '', 'cat' => 'سرکه و ترشی', 'img' => 'https://images.unsplash.com/photo-1596040033229-a9821ebd058d?w=600&q=80'), + array('name' => 'دمنوش بابونه', 'desc' => 'ترکیب آرامش‌بخش گل‌های بابونه و اسطوخودوس کوهی.', 'price' => 89000, 'sale_price' => '', 'cat' => 'دمنوش گیاهی', 'img' => 'https://images.unsplash.com/photo-1556679343-c7306c1976bc?w=600&q=80'), + array('name' => 'آجیل مخلوط لوکس', 'desc' => 'ترکیبی از پسته، بادام، فندق و گردو درجه یک.', 'price' => 485000, 'sale_price' => 429000, 'cat' => 'خشکبار و آجیل', 'img' => 'https://images.unsplash.com/photo-1599599810769-bcde5a160d32?w=600&q=80'), + array('name' => 'روغن زیتون فرابکر', 'desc' => 'روغن زیتون فرابکر کشت شده در باغ‌های گیلان.', 'price' => 275000, 'sale_price' => '', 'cat' => 'روغن طبیعی', 'img' => 'https://images.unsplash.com/photo-1474979266404-7eaabda50445?w=600&q=80'), + array('name' => 'شیره خرما طبیعی', 'desc' => 'شیره خالص خرما بدون شکر اضافه.', 'price' => 95000, 'sale_price' => 79000, 'cat' => 'شیره طبیعی', 'img' => 'https://images.unsplash.com/photo-1590165482129-1b8b27698780?w=600&q=80'), + array('name' => 'خشک انجیر درجه یک', 'desc' => 'انجیر خشک شده به روش آفتابی از باغ‌های استهبان.', 'price' => 165000, 'sale_price' => '', 'cat' => 'خشکبار و آجیل', 'img' => 'https://images.unsplash.com/photo-1596591868264-4ef737fbd18b?w=600&q=80') + ); + + foreach ($products_data as $p_data) { + $attach_id = media_sideload_image($p_data['img'], 0, $p_data['name'], 'id'); + if (is_wp_error($attach_id)) { $attach_id = ''; } + + $product_id = wp_insert_post(array( + 'post_title' => $p_data['name'], 'post_content' => $p_data['desc'], + 'post_status' => 'publish', 'post_type' => 'product', + )); + + if (!is_wp_error($product_id)) { + wp_set_object_terms($product_id, 'simple', 'product_type'); + if (isset($cat_ids[$p_data['cat']])) { + wp_set_object_terms($product_id, array((int)$cat_ids[$p_data['cat']]), 'product_cat'); + } + update_post_meta($product_id, '_price', $p_data['sale_price'] ? $p_data['sale_price'] : $p_data['price']); + update_post_meta($product_id, '_regular_price', $p_data['price']); + update_post_meta($product_id, '_sale_price', $p_data['sale_price']); + update_post_meta($product_id, '_stock_status', 'instock'); + update_post_meta($product_id, '_manage_stock', 'no'); + if ($attach_id) { set_post_thumbnail($product_id, $attach_id); } + } + } + + $blog_cat = term_exists('سلامت و تغذیه', 'category'); + if (!$blog_cat) { + $blog_cat = wp_insert_term('سلامت و تغذیه', 'category'); + $blog_cat_id = is_array($blog_cat) ? $blog_cat['term_id'] : $blog_cat; + } else { + $blog_cat_id = is_array($blog_cat) ? $blog_cat['term_id'] : $blog_cat; + } + + $posts_data = array( + array('title' => '۱۰ فایده شگفت‌انگیز عسل طبیعی', 'content' => '

عسل طبیعی یکی از قدیمی‌ترین مواد غذایی است.

', 'img' => 'https://images.unsplash.com/photo-1558642452-9d2a7deb7f62?w=800&q=80'), + array('title' => 'طرز تهیه حلوا ارده خانگی', 'content' => '

حلوا ارده یکی از شیرینی‌های سنتی ایرانی است.

', 'img' => 'https://images.unsplash.com/photo-1590080875515-8a3a8dc5735e?w=800&q=80') + ); + + foreach ($posts_data as $post_data) { + $attach_id = media_sideload_image($post_data['img'], 0, $post_data['title'], 'id'); + if (is_wp_error($attach_id)) { $attach_id = ''; } + $post_id = wp_insert_post(array( + 'post_title' => $post_data['title'], 'post_content' => $post_data['content'], + 'post_status' => 'publish', 'post_type' => 'post', + )); + if (!is_wp_error($post_id)) { + wp_set_object_terms($post_id, array((int)$blog_cat_id), 'category'); + if ($attach_id) { set_post_thumbnail($post_id, $attach_id); } + } + } + + update_option('motayeb_seeded_done', true); + wp_redirect(admin_url('admin.php?seed_success=1')); + exit; +} + +add_action('admin_notices', 'motayeb_seed_success_notice'); +function motayeb_seed_success_notice() { + if (isset($_GET['seed_success'])) { + echo '

موفقیت‌آمیز! دیتای تستی اضافه شد.

'; + } +} + +// =================================================================== +// تابع کمکی برای ظاهر کامنت‌ها (بدون خطای Cannot redeclare) +// =================================================================== +add_action('init', function() { + remove_action('comment_template', 'comment_form'); +}); \ No newline at end of file diff --git a/header.php b/header.php new file mode 100644 index 0000000..2da72d9 --- /dev/null +++ b/header.php @@ -0,0 +1,133 @@ + + + + + + + +> + + + + + + + + + + \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..a3fc217 --- /dev/null +++ b/index.php @@ -0,0 +1,35 @@ + + +
+
+ +
+

+
+ +
+
+ 2, + 'prev_text' => '', + 'next_text' => '', + ) ); + else : ?> +
+ +

محتوایی یافت نشد

+

متأسفانه محتوایی در این قسمت یافت نشد.

+
+ +
+
+ + diff --git a/page.php b/page.php new file mode 100644 index 0000000..6efcfb6 --- /dev/null +++ b/page.php @@ -0,0 +1,20 @@ + + +
+
+ +
+
+ + '
', + 'wrap_after' => '
', + 'delimiter' => ' ' +)); +?> + +
+
+ + + + + + +
+
+ + \ No newline at end of file diff --git a/single.php b/single.php new file mode 100644 index 0000000..4ffef4f --- /dev/null +++ b/single.php @@ -0,0 +1,138 @@ + + +
+
+ + +
+ خانه + + مجله + + +
+ + + + +

+ +

+ + +
+ + <?php echo esc_attr(get_the_author()); ?> + +
+
+
+ + +
+
+ +
+ term_id ) ) . '" class="px-3 py-1 bg-cream-100 dark:bg-dark-bg rounded-full text-xs text-cream-500 dark:text-dark-muted hover:bg-forest-50 hover:text-forest-500 dark:hover:bg-forest-900/30 dark:hover:text-forest-300 transition">' . esc_html($cat->name) . ''; + } + } + ?> +
+
+ + + +
+ 'w-full object-cover' ) ); ?> +
+ + + +
+ +
+ + + +
+ + + + name); ?> + + +
+ + + + + + + + + $cat_ids, + 'posts_per_page' => 3, + 'post__not_in' => array( get_the_ID() ), + 'orderby' => 'rand' + ) ); + + if ( $related_posts && ! is_wp_error( $related_posts ) ) : + ?> + + + +
+
+ + \ No newline at end of file diff --git a/style.css b/style.css new file mode 100644 index 0000000..1ca47fc --- /dev/null +++ b/style.css @@ -0,0 +1,15 @@ +/* +Theme Name: Motayeb - مطیب +Theme URI: https://motayeb.ir +Author: VernaSOft (Kazem Alghasi) +Author URI: https://motayeb.ir +Description: قالب اختصاصی فروشگاهی مطیب برای محصولات ارگانیک و طبیعی - سازگار با ووکامرس +Version: 1.0.0 +Tested up to: 6.4 +Requires PHP: 7.4 +License: GNU General Public License v2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html +Text Domain: motayeb +Domain Path: /languages +*/ + diff --git a/ui.html b/ui.html new file mode 100644 index 0000000..13399b8 --- /dev/null +++ b/ui.html @@ -0,0 +1,1464 @@ + + + + + + مطیب | طعم واقعی طبیعت + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + +
+
+
+
+
+ + محصولات ۱۰۰٪ ارگانیک و طبیعی +
+

+ طعم + واقعی +
+ طبیعت +

+

+ از عسل کوهستان تا ارده سنتی، هر محصول مطیب سفری به دل طبیعت ایران است. با طعم‌های اصیل و سلامت واقعی آشنا شوید. +

+ + +
+
+
+۲۵۰
+
محصول ارگانیک
+
+
+
+
+۱۵K
+
مشتری راضی
+
+
+
+
۳۱
+
استان تحت پوشش
+
+
+
+ +
+
+ محصولات ارگانیک مطیب +
+
+ +
+
+
+ +
+
+
گواهی ارگانیک
+
تأیید شده توسط سازمان غذا
+
+
+
+ +
+
+
+
م
+
ع
+
ز
+
+
+
★★★★★
+
+۴.۸ از ۵۰۰۰ نظر
+
+
+
+
+
+
+ +
+ + + +
+
+ + +
+
+
+ CATEGORIES +

دسته‌بندی محصولات

+

از عسل‌های کوهستان تا دمنوش‌های گیاهی، بهترین‌های طبیعت را کشف کنید

+
+ +
+
+ + +
+
+
+
+ BESTSELLERS +

پرفروش‌ترین‌ها

+
+ +
+
+ +
+
+
+ + +
+
+
+
+
+ مزرعه ارگانیک +
+
+
+۱۲
+
سال تجربه
+
در تولید محصولات ارگانیک
+
+
+
+ OUR STORY +

داستان مطیب،
از طبیعت تا سفره شما

+

+ مطیب از سال ۱۳۹۰ با هدف عرضه محصولات ارگانیک و طبیعی ایرانی آغاز به کار کرد. ما مستقیماً از زنبورداران، کشاورزان و تولیدکنندگان سنتی سراسر ایران خرید می‌کنیم و با حفظ کیفیت اولیه، آنها را به سفره خانواده‌های ایرانی می‌رسانیم. +

+
+
+
+ +
+
+
کشت ارگانیک
+
بدون سم و کود شیمیایی
+
+
+
+
+ +
+
+
تضمین اصالت
+
آزمایشگاهی و مستند
+
+
+
+
+ +
+
+
بسته‌بندی سبز
+
دوست‌دار محیط زیست
+
+
+
+
+ +
+
+
تأمین محلی
+
حمایت از کشاورز ایرانی
+
+
+
+ +
+
+ + گواهی ارگانیک ایران +
+
+ + استاندارد ملی بهداشت +
+
+ + نماد اعتماد الکترونیکی +
+
+
+
+
+
+ + +
+
+
+ PRODUCT DETAIL +

نمونه صفحه محصول

+
+
+ +
+
+ عسل طبیعی کوهستان +
+ ارگانیک + ۲۰٪ تخفیف +
+ +
+
+ + + + +
+
+ +
+
+ برند: مطیب + + ★★★★★ (۱۲۸ نظر) +
+

عسل طبیعی کوهستان مطیب

+

عسل خالص و طبیعی جمع‌آوری شده از دامنه‌های زاگرس، بدون هیچ‌گونه افزودنی و شکر. غنی از آنتی‌اکسیدان و مواد مغذی.

+ + +
+ + موجود در انبار +
+ + +
+ +
+ + + +
+
+ + +
+ ۲۹۵,۰۰۰ + تومان + ۳۶۹,۰۰۰ +
+ + +
+ +
+ + ۱ + +
+
+ + +
+ + +
+ + +
+
+ + ارسال به تمامی نقاط کشور +
+
+ + ضمانت بازگشت ۷ روزه +
+
+ + ضمانت اصالت و کیفیت +
+
+
+
+ + +
+
+ + + + +
+
+
+

عسل طبیعی کوهستان مطیب از گل‌های وحشی دامنه‌های زاگرس مرکزی تولید شده و بدون هیچ‌گونه فرآیند حرارتی یا افزودنی عرضه می‌شود. این عسل به روش سنتی و با رعایت اصول ارگانیک برداشت شده است.

+

رنگ طلایی این عسل نشان‌دهنده غنای آن از آنتی‌اکسیدان‌ها و مواد معدنی است. طعم ملایم و مطبوع آن مناسب مصرف روزانه برای تمام اعضای خانواده است.

+
+
+ + + +
+ + +
+

معمولاً با هم خریداری می‌شوند

+
+
+ +

ارده کنجد سنتی

+
۱۸۵,۰۰۰ تومان
+
+
+ +

دمنوش نعناع کوهی

+
۸۹,۰۰۰ تومان
+
+
+ +

سرکه انگور طبیعی

+
۱۲۵,۰۰۰ تومان
+
+
+ +
+
+
+
+
+ + +
+
+
+
+ TESTIMONIALS +

نظرات مشتریان ما

+
+
+
+
★★★★★
+

«از وقتی عسل مطیب استفاده می‌کنیم، دیگه هیچ عسلی برامون قابل قبول نیست. طعم واقعی عسل رو با مطیب شناختیم.»

+
+
ز‌ک
+
زهرا کریمی
تهران
+
+
+
+
★★★★★
+

«ارده و شیره‌های مطیب کیفیت استثنایی دارن. بسته‌بندی هم بسیار تمیز و بهداشتیه. برای صبحانه عالیه.»

+
+
ح‌ن
+
حسین نوری
اصفهان
+
+
+
+
★★★★★
+

«دمنوش‌های گیاهی مطیب واقعاً طبیعین. برخلاف خیلی از برندها، عطر و طعم واقعی گیاهان رو حس می‌کنی.»

+
+
ف‌م
+
فاطمه موسوی
شیراز
+
+
+
+
+
+ + +
+
+
+
+ BLOG +

مجله سلامت مطیب

+
+ +
+
+
+
+
+
+ سلامت + ۱۵ آذر ۱۴۰۳ +
+

۱۰ فایده شگفت‌انگیز عسل طبیعی برای سلامتی

+

عسل طبیعی یکی از قدیمی‌ترین و مفیدترین مواد غذایی است که خواص بی‌نظیری دارد...

+
+
+
+
+
+
+ دستور پخت + ۱۰ آذر ۱۴۰۳ +
+

طرز تهیه حلوا ارده سنتی خانگی

+

با ارده کنجد مطیب، حلوا اردهای درست کنید که طعم شیرینی‌فروشی‌ها رو نداره...

+
+
+
+
+
+
+ سبک زندگی + ۵ آذر ۱۴۰۳ +
+

چگونه زندگی ارگانیک را شروع کنیم؟

+

گذار به سبک زندگی ارگانیک نیازی به تغییرات بزرگ ندارد. با این قدم‌های ساده شروع کنید...

+
+
+
+
+
+ + +
+
+
+ +
+

از تخفیف‌ها باخبر شوید

+

با عضویت در خبرنامه، از جدیدترین محصولات و تخفیف‌های ویژه مطلع شوید.

+
+ + +
+
+
+ + +
+
+
+
+
+ +
+
ارسال سریع
+
به سراسر ایران
+
+
+
+ +
+
ضمانت اصالت
+
۱۰۰٪ اصل و طبیعی
+
+
+
+ +
+
پرداخت امن
+
درگاه‌های معتبر
+
+
+
+ +
+
بازگشت آسان
+
۷ روز ضمانت
+
+
+
+
+ + +
+
+
+ CHECKOUT +

نمونه صفحه تسویه حساب

+
+ +
+
۱
+
+
۲
+
+
۳
+
+
+
+ +
+

اطلاعات خریدار

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+

آدرس تحویل

+
+
+ + +
+
+ + +
+
+
+ + +
+
+
+ + +
+
+ + +
+
+
+ +
+

روش پرداخت

+
+ + + +
+
+
+ +
+
+

خلاصه سفارش

+
+
+
جمع کالاها۰ تومان
+
هزینه ارسالرایگان
+
تخفیف۰ تومان
+
+ مبلغ قابل پرداخت + ۰ تومان +
+
+
+ + +
+ +

با ثبت سفارش، قوانین و مقررات مطیب را می‌پذیرید.

+
+
+
+
+
+ + +
+
+
+ CONTACT +

تماس با ما

+
+
+
+
+
+
+ +
+
آدرس

تهران، خیابان ولیعصر، بالاتر از میدان ونک، پلاک ۱۲۳

+
+
+
+ +
+
تلفن

۰۲۱-۱۲۳۴۵۶۷۸

۰۹۱۲-۳۴۵-۶۷۸۹

+
+
+
+ +
+
ایمیل

info@motayeb.ir

+
+
+
+ +
+
ساعت کاری

شنبه تا پنج‌شنبه: ۹ صبح تا ۶ عصر

+
+
+
+ + + + +
+
+
+
+ + +
+ + + + + +
+
+
+
+ +
+ + + + + + + + +
+ + + + \ No newline at end of file diff --git a/woocommerce/content-product.php b/woocommerce/content-product.php new file mode 100644 index 0000000..3420004 --- /dev/null +++ b/woocommerce/content-product.php @@ -0,0 +1,52 @@ + + +
> + + + + + <?php echo esc_attr( $product->get_name() ); ?> + + +
+ +
+
+ + +
+ + + get_name() ); ?> + + + + get_average_rating() > 0 ) : ?> +
+ + get_average_rating() ); ?> +
+ + + +
+ get_price_html(); ?> +
+
+
\ No newline at end of file diff --git a/woocommerce/content-single-product.php b/woocommerce/content-single-product.php new file mode 100644 index 0000000..e71916a --- /dev/null +++ b/woocommerce/content-single-product.php @@ -0,0 +1,243 @@ + + +
+
+ + +
+ +
+ +
+ + +
+ + + + + + + + +
+
+ + +
+ +
+ get_id(), ' ' ); ?> +
+ + +

+ + + get_review_count() > 0 ) : ?> +
+
+ get_average_rating(); + $full_stars = floor($rating); + $empty_stars = 5 - $full_stars; + echo str_repeat('★', $full_stars) . str_repeat('☆', $empty_stars); + ?> +
+ (get_review_count()); ?> نظر) +
+ + + +
+ is_in_stock() ) : ?> + + موجود در انبار + + + ناموجود + +
+ + + get_short_description() ) : ?> +
+ get_short_description() ); ?> +
+ + + +
+ is_on_sale() ) : ?> + get_sale_price() ); ?> + get_regular_price() ); ?> + + get_price() ); ?> + + تومان +
+ + + is_in_stock() ) : ?> +
+ get_id(), 'woocommerce-add-to-cart-nonce' ); ?> + + + + +
+ +
+ + + +
+ + + +
+ + +
+ is_in_stock() ) : ?> +
+ + این محصول در حال حاضر ناموجود است. +
+ + + +
+ get_sku() ) : ?> +
+ +
+
شناسه
+
get_sku()); ?>
+
+
+ +
+ +
+ +
+ get_id(), 'product_cat' ); + if ( $cats && ! is_wp_error( $cats ) ) : ?> + + + name ); ?> + + +
get_id(), ', ' ); ?>
+
+
+
+ + +
+
+
+ +
+ ارسال به سراسر کشور +
+
+
+ +
+ بازگشت ۷ روزه +
+
+
+ +
+ ضمانت اصالت کالا +
+
+
+ +
+ پرداخت امن +
+
+
+
+ + +
+ +
+ + +
+

محصولات مرتبط

+
+ +
+
+
\ No newline at end of file diff --git a/woocommerce/single-product/review-form.php b/woocommerce/single-product/review-form.php new file mode 100644 index 0000000..2e699a5 --- /dev/null +++ b/woocommerce/single-product/review-form.php @@ -0,0 +1,51 @@ + + +
+
+

ثبت نظر جدید

+ +
+ + + +
+ +
+ + + + + +
+ +
+ + +
+
+ +
+
+ +
+
+ + + + + +
+ +
+
+
+
\ No newline at end of file diff --git a/woocommerce/single-product/review.php b/woocommerce/single-product/review.php new file mode 100644 index 0000000..060af8d --- /dev/null +++ b/woocommerce/single-product/review.php @@ -0,0 +1,36 @@ +comment_ID, 'rating', true ) ); +?> + +
  • id="li-comment-"> +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + + +
    + +
    + +
    + comment_approved == '0' ) : ?> +

    + +
    + +
    +
    +
  • \ No newline at end of file