VelihanD adlı üyeden alıntı: mesajı görüntüle
Kodu bu şekilde ekliyorum , sanırım bir yazım yanlışı yok ?
Fonksiyon daha önce oluşturulduğu içinde olabilir farklı bir isim verip deneyebilir misiniz hocam?
[COLOR=#515365][FONT=consolas]function update_focus_keywords2() {[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]    $posts = get_posts(array([/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]    'posts_per_page'    => -1,[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]    'post_type'        => 'post' // Replace post with the name of your post type[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]    ));[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]    foreach($posts as $p){[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]        // Checks if Rank Math keyword already exists and only updates if it doesn't have it[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]        $rank_math_keyword = get_post_meta( $p->ID, 'rank_math_focus_keyword', true );[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]    if ( ! $rank_math_keyword ){[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]            update_post_meta($p->ID,'rank_math_focus_keyword',strtolower(get_the_title($p->ID)));[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]        }[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]    }[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]}[/FONT][/COLOR]
[COLOR=#515365][FONT=consolas]add_action( 'init', 'update_focus_keywords2' );[/FONT][/COLOR]
gibi.