Protex adlı üyeden alıntı: mesajı görüntüle
ozaman short code yi aktifleştirecek filtreniz yok functions ta. Ve o short code için sonradan farklı seo eklentiler kurduysan title yapısı değişebiliyor. yoastta vs .. mantıkende ona göre ayarlamanız gerekir.
örnek:
normal title ve yoast'ın titlesi için tarih shortcode si ve titleye uygulanışı.

//* Shortcode to display the current date, month and year in WordPress
//* shortcode: [date_month_year]
add_shortcode( 'date_month_year' , 'current_date_month_year' );
function current_date_month_year() {
$year = date("Y");
$month = date("M");
$date = date("D");
return "$date, $month, $year";
}
add_filter( 'the_title', 'do_shortcode' ); // activate shortcode in WP Title
add_filter( 'wpseo_title', 'do_shortcode' ); // activate shortcode in Yoast Title
add_filter( 'wpseo_metadesc', 'do_shortcode' ); // activate shortcode in Yoast Meta Description
veya bütün konulardaki shortcode yi deiştirmekle uğraşmak yerine, yukardaki betiği var olan kendi shortcode nize göre değiştirebilirsin isimlerini.
//* Shortcode to display the current date, month and year in WordPress
//* shortcode: [date_month_year]
add_shortcode( 'date_month_year' , 'current_date_month_year' );
function current_date_month_year() {
$year = date("Y");
$month = date("M");
$date = date("D");
return "$date, $month, $year";
}
add_filter( 'the_title', 'do_shortcode' ); // activate shortcode in WP Title
add_filter( 'seo_title', 'do_shortcode' ); // activate shortcode in Yoast Title
add_filter( 'seo_description', 'do_shortcode' ); // activate shortcode in Yoast Meta Description
Hocam rahatsızlık veriyorum kusura bakmayın ama sanırım başaramadım. Rank math kullanıyorum dediğiniz gibi düzenledim olmadı. Eklentiyi pasif ettim yine olmadı. Aslında olmayan şey sadece titlede ve kaynak kodunda [yil] olarak shortcode çıkması. Başlıkta ve yazı içinde çıkıyor ama bir türlü titlede ve kaynakta 2022 yazdıramadım.