CloudBT CloudBT
  • 17-11-2021, 14:29:16
    #1
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Merhaba,

    Odak anahtar kelimesi belirlenmemiş gönderinizin başlığını odak anahtar kelimesi olarak ayarlamak için:

    WordPress Dashboard > Görünüm > Tema Düzenleyici'ye giderek temanızın functions.php dosyasına aşağıdaki kodu ekleyebilirsiniz .
    Not: SEO uyumlu özel yazılarınız ve belirli odak anahtar kelimeleri var ise onları da başlık ile değiştiriyor. Eğer böyle bir durum söz konusu ise 2.kodu kullanın.

    /**
    * Function to automatically update the focus keyword with the post title
    */
    function update_focus_keywords()
    {
    $posts = get_posts(array(
    'posts_per_page' => -1,
    'post_type' => 'post' //replace post with the name of your post type
    ));
    foreach ($posts as $p) {
    update_post_meta($p->ID, 'rank_math_focus_keyword', strtolower(get_the_title($p->ID)));
    }
    }
    add_action('init', 'update_focus_keywords');
    * Bu kod sayesinde odak anahtar kelimesi olmayan içeriklerinizin odak anahtar kelimesini belirlemiş olursunuz. (Makale başlığını)

    Bu kod yazılı kaldığı sürece de nerden içerik çekerseniz çekin otomatik olarak yazı başlığını odak anahtar kelimesi olarak belirliyor.

    * Sadece odak anahtar kelimesi olmayan yazılarınız var ve bunlara otomatik olarak yazı başlığını odak anahtar kelimesi eklemek istiyorsanız

    WordPress Dashboard > Görünüm > Tema Düzenleyici'ye giderek temanızın functions.php dosyasına aşağıdaki kodu ekleyebilirsiniz .

    /**
    * Function to automatically update the focus keyword with the post title, if no focus keyword is set
    */
    function update_focus_keywords() {
    $posts = get_posts(array(
    'posts_per_page' => -1,
    'post_type' => 'post' // Replace post with the name of your post type
    ));
    foreach($posts as $p){
    // Checks if Rank Math keyword already exists and only updates if it doesn't have it
    $rank_math_keyword = get_post_meta( $p->ID, 'rank_math_focus_keyword', true );
    if ( ! $rank_math_keyword ){
    update_post_meta($p->ID,'rank_math_focus_keyword',strtolower(get_the_title($p->ID)));
    }
    }
    }
    add_action( 'init', 'update_focus_keywords' );
    Not: İlgili kodlar çalışmaz ise: Ana dizin > wp-content > themes > içine ''rank-math.php'' dosyası oluşturup ilgili kodu rank-math.php içine yazın.

    Kaynak: https://rankmath.com/kb/how-to-autom...focus-keyword/
  • 17-11-2021, 14:38:37
    #2
    Güzel paylaşım teşekkürler.
  • 17-11-2021, 14:41:39
    #3
    Peace adlı üyeden alıntı: mesajı görüntüle
    Merhaba,

    Odak anahtar kelimesi belirlenmemiş gönderinizin başlığını odak anahtar kelimesi olarak ayarlamak için:

    WordPress Dashboard > Görünüm > Tema Düzenleyici'ye giderek temanızın functions.php dosyasına aşağıdaki kodu ekleyebilirsiniz .

    /** * Function to automatically update the focus keyword with the post title, if no focus keyword is set */
    function update_focus_keywords() {    $posts = get_posts(array(    'posts_per_page'    => -1,    'post_type'        => 'post' // Replace post with the name of your post type    ));    foreach($posts as $p){        // Checks if Rank Math keyword already exists and only updates if it doesn't have it        $rank_math_keyword = get_post_meta( $p->ID, 'rank_math_focus_keyword', true );
    if ( ! $rank_math_keyword ){             update_post_meta($p->ID,'rank_math_focus_keyword',strtolower(get_the_title($p->ID)));        }    }
    }
    add_action( 'init', 'update_focus_keywords' );
    * Bu kod sayesinde odak anahtar kelimesi olmayan içeriklerinizin odak anahtar kelimesini belirlemiş olursunuz. (Makale başlığını)

    Bu kod yazılı kaldığı sürece de nerden içerik çekerseniz çekin otomatik olarak yazı başlığını odak anahtar kelimesi olarak belirliyor.

    * Ek olarak: Sadece odak anahtar kelimesi olmayan yazılarınız var ve bunlara otomatik olarak odak anahtar kelimesi eklemek istiyorsanız

    WordPress Dashboard > Görünüm > Tema Düzenleyici'ye giderek temanızın functions.php dosyasına aşağıdaki kodu ekleyebilirsiniz .

    /** * Function to automatically update the focus keyword with the post title */
    function update_focus_keywords()
    {    $posts = get_posts(array(        'posts_per_page'    => -1,        'post_type'        => 'post' //replace post with the name of your post type    ));    foreach ($posts as $p) {        update_post_meta($p->ID, 'rank_math_focus_keyword', strtolower(get_the_title($p->ID)));    }
    }
    add_action('init', 'update_focus_keywords');
    Hocam çok teşekkürler paylaşım için. Elinizde kodlar varsa paylaşırmısınız bizimle mümkünse. bu müthiş bir kolaylık. Birde hocam bunu en alta mı yapıştıryoruz.
  • 17-11-2021, 14:44:19
    #4
    dnzfeneri adlı üyeden alıntı: mesajı görüntüle
    Hocam çok teşekkürler paylaşım için. Elinizde kodlar varsa paylaşırmısınız bizimle mümkünse. bu müthiş bir kolaylık. Birde hocam bunu en alta mı yapıştıryoruz.
    Rica ederim üstadım.
    Kodlar yukarıda mevcut, hangisi size uygunsa en alta ekleyebilirsiniz.
  • 17-11-2021, 14:48:28
    #5
    şimdi kaydetmek istediğimde şöyle bir uyarı veriyor.

    Your PHP code changes were rolled back due to an error on line 114 of file wp-content/themes/jannah/functions.php. Please fix and try saving again.
    syntax error, unexpected 'if' (T_IF), expecting ')'
  • 17-11-2021, 14:49:29
    #6
    dnzfeneri adlı üyeden alıntı: mesajı görüntüle
    şimdi kaydetmek istediğimde şöyle bir uyarı veriyor.

    Your PHP code changes were rolled back due to an error on line 114 of file wp-content/themes/jannah/functions.php. Please fix and try saving again.
    syntax error, unexpected 'if' (T_IF), expecting ')'
    WP-Admin üzerinden değil dosya yöneticisi ile düzenleyebilir misiniz?
  • 18-11-2021, 00:32:28
    #7
    backlinkmatik.com
    paylaşım teknik anlamda çok başarılı teşekkürler hocam
  • 18-11-2021, 09:28:11
    #8
    Emeğine sağlık harikasın.
  • 18-11-2021, 09:49:47
    #9
    Peace adlı üyeden alıntı: mesajı görüntüle
    Merhaba,

    Odak anahtar kelimesi belirlenmemiş gönderinizin başlığını odak anahtar kelimesi olarak ayarlamak için:

    WordPress Dashboard > Görünüm > Tema Düzenleyici'ye giderek temanızın functions.php dosyasına aşağıdaki kodu ekleyebilirsiniz .
    Not: SEO uyumlu özel yazılarınız ve belirli odak anahtar kelimeleri var ise onları da başlık ile değiştiriyor. Eğer böyle bir durum söz konusu ise 2.kodu kullanın.

    /**
    * Function to automatically update the focus keyword with the post title
    */
    function update_focus_keywords()
    {
    $posts = get_posts(array(
    'posts_per_page' => -1,
    'post_type' => 'post' //replace post with the name of your post type
    ));
    foreach ($posts as $p) {
    update_post_meta($p->ID, 'rank_math_focus_keyword', strtolower(get_the_title($p->ID)));
    }
    }
    add_action('init', 'update_focus_keywords');
    * Bu kod sayesinde odak anahtar kelimesi olmayan içeriklerinizin odak anahtar kelimesini belirlemiş olursunuz. (Makale başlığını)

    Bu kod yazılı kaldığı sürece de nerden içerik çekerseniz çekin otomatik olarak yazı başlığını odak anahtar kelimesi olarak belirliyor.

    * Sadece odak anahtar kelimesi olmayan yazılarınız var ve bunlara otomatik olarak yazı başlığını odak anahtar kelimesi eklemek istiyorsanız

    WordPress Dashboard > Görünüm > Tema Düzenleyici'ye giderek temanızın functions.php dosyasına aşağıdaki kodu ekleyebilirsiniz .

    /**
    * Function to automatically update the focus keyword with the post title, if no focus keyword is set
    */
    function update_focus_keywords() {
    $posts = get_posts(array(
    'posts_per_page' => -1,
    'post_type' => 'post' // Replace post with the name of your post type
    ));
    foreach($posts as $p){
    // Checks if Rank Math keyword already exists and only updates if it doesn't have it
    $rank_math_keyword = get_post_meta( $p->ID, 'rank_math_focus_keyword', true );
    if ( ! $rank_math_keyword ){
    update_post_meta($p->ID,'rank_math_focus_keyword',strtolower(get_the_title($p->ID)));
    }
    }
    }
    add_action( 'init', 'update_focus_keywords' );
    harika paylaşım ama kaynağını da belirtseydin. KAYNAK ama harika yerden yakalamışsın