Posts

Showing posts from October, 2025

الخطوة 1: أضف هذا الكود إلى ملف functions.php

  الخطوة 1: أضف هذا الكود إلى ملف functions.php php Copy Download <?php // Add this to your theme's functions.php file // إنشاء شورتكود لأحداث مارس function march_events_shortcode ( $atts ) { // الإعدادات الافتراضية $atts = shortcode_atts ( array ( 'day' => date ( 'j' ) , // اليوم الحالي كافتراضي 'year' => '1997' // السنة الافتراضية ) , $atts ) ; $day = intval ( $atts [ 'day' ] ) ; $year = $atts [ 'year' ] ; // التحقق من صحة اليوم (1-31) if ( $day < 1 || $day > 31 ) { return "<p>❌ اليوم يجب أن يكون بين 1 و 31</p>" ; } // بيانات الأحداث لشهر مارس - يمكنك إضافة المزيد $march_events = [ 1 => [ " $year : افتتاح قبة أوساكا في اليابان" , "عيد القديس ديفيد - احتفال ويلز" ] , 2 => [ " $y...

كود لحساب الساعات والدقائق التي مرت او ستكون النسخة الاولي

  ممتاز! سأقوم بإنشاء شورت كود جديد لحساب الوقت (ساعات ودقائق) بنفس المنطق والتصميم. إليك الكود الكامل: php Copy Download <?php // ============================================================================ // TIME AGO/FROM NOW COUNTER - STANDALONE VERSION // ============================================================================ // Register the shortcode add_shortcode ( 'time_ago_from_now' , 'time_ago_from_now_handler' ) ; function time_ago_from_now_handler ( $atts ) { // Set default attributes $atts = shortcode_atts ( array ( 'hours' => '0' , 'minutes' => '0' , 'type' => 'ago' , // ago or from_now 'language' => 'en' ) , $atts ) ; // Get attributes $hours = intval ( $atts [ 'hours' ] ) ; $minutes = intval ( $atts [ 'minutes' ] ) ; $type = $atts [ 'type' ] ; ...