التصنيف: دعم عام
التصنيف: دعم عام
  • مكون إضافي يقوم تلقائيًا بوضع النص من ltr إلى rtl
  • إضافة schema سكيما للصورة البارزة itemprop
  • الالوان في ستايل اضافة News-Ticker-Benaceur لا تعمل

مكون إضافي يقوم تلقائيًا بوضع النص من ltr إلى rtl

هل هناك مكون إضافي يقوم تلقائيًا بوضع النص من ltr إلى rtl مثل نص twitter !؟؟
ps84uuug9m |29 نوفمبر 2024 |1

إضافة schema سكيما للصورة البارزة itemprop

مرحبا أخي ، لقد قمت بتثبيت كود ولاكن أواجه مشكلةإنه يعمل بشكل جيد هنا[ر...
mansor2020 |24 ديسمبر 2020 |5

الالوان في ستايل اضافة News-Ticker-Benaceur لا تعمل

مرحبا الالوان في ستايل اضافة News-Ticker-Benaceur لا تعمل و شريط الاخبار معدل ع...
soufien |4 ديسمبر 2020 |3

  • Add the date,author,comment count to news ticker benaceur plugin

2020/10/27
كاتب الموضوع: BENACEUR
التصنيف: my plugins, ووردبريس wordpress

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' );

شارك هذا الموضوع على:

رابط الموضوع للنسخ

نبذة قصيرة عن BENACEUR

أقوم بتطوير الووردبريس وكل ما يتعلق به كالإضافات حيث ساهمت بثلاث إضافات من تطويري, ولذلك فموقعي هذا جعلته يهتم بالدرجة الأولى بتطوير ودعم الووردبريس, ثم الأنترنت والمواقع الإلكترونية بصفة عامة ...




أضف تعليقك | سجّل دخولك

تعليقاتك في هذا الموضوع تحتاج إلى المراجعة قبل النشر