أشرح في هذا الفيديو كيفية عرض السنة الحالية في ووردبريس بشكل Dynamic مع ضمان تحديثها بشكل تلقائي.
الكود المستخدم في الفيديو:
function wpg_current_year_cb() {
$current_year = date("Y");
return $current_year;
}
add_shortcode("wpg_current_year", "wpg_current_year_cb");
رابط صفحة إضافة WP Code في موقع ووردبريس:
https://wordpress.org/plugins/insert-headers-and-footers/