
https://wordpress.org/plugins/news-ticker-benaceur/
ضع الكود التالي في ملف functions.php الخاص بقالبك المفعّل:
put this code in functions.php file of your active theme:
function ben_ntb_funct_filter_title( $title, $args, $post ) {
# 'd M Y H-i'| d/m/Y H-i
$format = is_rtl() ? 'Y/m/d' : 'd/m/Y';
$d = date_i18n( $format, strtotime( $post["post_date"] ) );
return sprintf( '%s: %s', $d, $title );
}
add_filter( 'ntb_title_filter_ben', 'ben_ntb_funct_filter_title', 10, 3 );
ولإظهار كاتب الموضوع غيّر هذا السطر:
To display the author change this line:
$d = date_i18n( 'd/m/Y', strtotime( $post["post_date"] ) );
إلى:
to:
$d = $args[1];
ولإظهار تاريخ آخر تعديل للموضوع عدل السطر إلى:
and to display the post modification date change to:
$d = date_i18n( 'd/m/Y', strtotime( $args[2] ) );
ولإظهار عدد تعليقات الموضوع عدّل السطر إلى:
and to display comment count change to:
$d = $args[3];
ولتغيير شكل التاريخ في الووردبريس تابع الموضوع التالي:
To change the format of the date see this post:
https://wordpress.org/support/article/formatting-date-and-time/
أو عدد التعليقات:
or number of comments:
function ben_ntb_funct_filter_title( $title, $args, $post ) {
$d = $args[3];
return '[ comment(s): '. $d .' ] '. $title;
}
add_filter( 'ntb_title_filter_ben', 'ben_ntb_funct_filter_title', 10, 3 );
الكاتب:
author:
function ben_ntb_funct_filter_title( $title, $args, $post ) {
$d = $args[1];
return '[ author: '. $d .' ] '. $title;
}
add_filter( 'ntb_title_filter_ben', 'ben_ntb_funct_filter_title', 10, 3 );
تاريخ آخر تعديل للموضوع:
Date of the last modification of the post:
function ben_ntb_funct_filter_title( $title, $args, $post ) {
$d = date_i18n( 'd/m/Y', strtotime( $args[2] ) );
return '[ modified: '. $d .' ] '.$title;
}
add_filter( 'ntb_title_filter_ben', 'ben_ntb_funct_filter_title', 10, 3 );
————————
وهذه مع الستايل لكن لا يشتغل تحديد عدد حروف العنوان تلقائيا عند تغيير عرض الشاشة:
function ben_ntb_funct_filter_title( $title, $args, $post ) {
# 'd M Y H-i'| d/m/Y H-i
$format = is_rtl() ? 'Y/m/d' : 'd/m/Y';
$d = '<div class="ben_ntb_funct_filter_title"><div class="ben_ntb_funct_filter_title-str s1">';
$d .= date_i18n( $format, strtotime( $post["post_date"] ) );
$d .= ':</div>';
return sprintf( '%s<div class="ben_ntb_funct_filter_title-str">%s</div></div>', $d, $title );
}
add_filter( 'ntb_title_filter_ben', 'ben_ntb_funct_filter_title', 10, 3 );
add_filter( 'ntb_filter_enable_ellipsis', '__return_false' );
function ben_ntb_funct_filter_title_style() {
echo "<style>
.ben_ntb_funct_filter_title-str.s1 {color:red !important;font-weight: bold !important;padding:0 3px !important;}
.ben_ntb_funct_filter_title div {display:inline;}
.ben_ntb_funct_filter_title-str {white-space: nowrap;}
</style>";
}
add_action( 'wp_head', 'ben_ntb_funct_filter_title_style' );
رابط الموضوع للنسخ