Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Kupası
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

WordPress RSS Beslemelerinizi Nasıl Tamamen Özelleştirebilirsiniz?

Editoryal Not: WPBeginner üzerindeki ortak bağlantılardan komisyon kazanıyoruz. Komisyonlar, editörlerimizin görüşlerini veya değerlendirmelerini etkilemez. Editoryal Süreç hakkında daha fazla bilgi edinin.

WordPress RSS beslemelerinize içerik mi eklemek istiyorsunuz?

RSS, ‘Really Simple Syndication’ anlamına gelir ve WordPress RSS beslemeleri en son içeriğinizi gösterir. Ancak, varsayılan olarak, RSS beslemesi kullanıcılarınız için bu içeriği özelleştirme seçeneği yoktur.

Bu makalede, WordPress RSS beslemelerinize nasıl kolayca içerik ekleyebileceğinizi ve bunları nasıl tamamen değiştirebileceğinizi göstereceğiz.

Adding custom content to your WordPress RSS feeds

İşte bu makalede ele alacağımız konulara hızlı bir genel bakış:

WordPress RSS Beslemelerine Özel İçerik Ekleme (Kolay Yol)

WordPress RSS beslemelerinize özel web sitesi içeriği eklemenin en kolay yolu All in One SEO eklentisini kullanmaktır. Piyasadaki en iyi WordPress SEO eklentisidir ve web sitenizin SEO’sunu kolayca optimize etmenizi sağlar.

Yapmanız gereken ilk şey All in One SEO eklentisini yüklemek ve etkinleştirmektir. Daha fazla ayrıntı için, bir WordPress eklentisinin nasıl kurulacağına ilişkin adım adım kılavuzumuza bakın.

Etkinleştirmenin ardından eklentiyi kurmanız istenecektir. Ekrandaki talimatları izleyin veya All in One SEO’nun nasıl kurulacağına ilişkin kılavuzumuza göz atın.

Bundan sonra, All in One SEO ” Genel Ayarlar sayfasını ziyaret etmeniz ve ‘RSS İçeriği’ sekmesine geçmeniz gerekir.

Adding custom content to your WordPress RSS feed using All in One SEO

Buradan, her RSS besleme öğesinden önce ve sonra görüntülemek istediğiniz içeriği ekleyebilirsiniz.

Özel içeriğe bağlantılar ve diğer meta verileri eklemek için akıllı etiketleri kullanabilirsiniz.

Adding before and after content for each post in your RSS feed

Özel içeriğinizi istediğiniz şekilde biçimlendirmek için temel HTML de kullanabilirsiniz.

Değişikliklerden memnun kaldığınızda, Değişiklikleri Kaydet düğmesine tıklamayı unutmayın.

All in One SEO artık her RSS besleme öğesine özel içeriğinizi ekleyecektir.

Kod Kullanarak WordPress RSS Beslemesine İçerik Ekleme

Yukarıda bahsedilen ilk yöntem WordPress RSS beslemelerinize özel içerik eklemenin en kolay yoludur. Ancak, WordPress beslemenizdeki tüm öğelere içerik ekler.

Ya belirli gönderilere, belirli kategorilerdeki gönderilere içerik eklemek ya da RSS beslemenizde özel meta veriler görüntülemek istiyorsanız?

Sonraki birkaç adım, özel kod parçacıkları kullanarak RSS beslemenize esnek bir şekilde içerik eklemenize yardımcı olacaktır. Bu yeni başlayanlar için önerilmez.

Bu kod parçacıklarını doğrudan temanızın functions.php dosyasına ekleyebilirsiniz. Ancak, WordPress web sitenizi bozmadan WordPress’e özel kod eklem enin en kolay yolu olduğu için bunun yerine WPCode eklentisini kullanmanızı öneririz.

Hatta kütüphanesinde birkaç tıklama ile etkinleştirilebilen birkaç RSS parçacığı da içerir.

WordPress eklentisi yükleme kılavuzumuzdaki talimatları kullanarak WPCode ücretsiz eklentisini kurun ve etkinleştirin.

WordPress RSS beslemelerine manuel olarak özel içerik eklemenin bazı örneklerini deneyelim.

1. WordPress RSS Akışınıza Özel Bir Alandan Veri Ekleme

Özel alanlar, WordPress yazılarınıza ve sayfalarınıza ekstra meta veriler eklemenize olanak tanır. Ancak bu meta veriler varsayılan olarak RSS beslemelerine dahil edilmez.

Adding custom fields in WordPress

İşte WordPress RSS beslemenizde özel alan verilerini almak ve görüntülemek için kullanabileceğiniz bir kod parçacığı:

function wpb_rsstutorial_customfield($content) {
global $wp_query;
$postid = $wp_query->post->ID;
$custom_metadata = get_post_meta($postid, 'my_custom_field', true);
if(is_feed()) {
if($custom_metadata !== '') {
// Display custom field data below content
$content = $content."<br /><br /><div>".$custom_metadata."</div>
";
}
else {
$content = $content;
}
}
return $content;
}
add_filter('the_excerpt_rss', 'wpb_rsstutorial_customfield');
add_filter('the_content', 'wpb_rsstutorial_customfield');

Bu kod ilk olarak özel alanın içinde veri olup olmadığını ve özel RSS beslemesinin görüntülenip görüntülenmediğini kontrol eder. Bundan sonra, content global değişkenini ekler ve özel alan verilerini içeriğin altına ekler.

2. RSS’de Gönderi Başlıklarına Ek Metin Ekleme

RSS beslemenizdeki bazı gönderilerin başlığına ek metin mi görüntülemek istiyorsunuz? Belki de normal makaleler ile konuk veya sponsorlu gönderiler arasında ayrım yapmak istiyorsunuz.

RSS beslemenizdeki gönderi başlıklarına nasıl özel içerik ekleyebileceğiniz aşağıda açıklanmıştır.

Örnek 1: Özel Alanlardan RSS Akışı Gönderi Başlığına Veri Ekleme

Öncelikle, görüntülemek istediğiniz içeriği bir özel alan olarak kaydetmek isteyeceksiniz. Örneğin, guest_post veya sponsored_post özel alanları ekleyebilirsiniz.

Bundan sonra, aşağıdaki kodu web sitenize ekleyebilirsiniz:

function wpb_rsstutorial_addtitle($content) {
global $wp_query;
$postid = $wp_query->post->ID;
$gpost = get_post_meta($postid, 'guest_post', true);
$spost = get_post_meta($postid, 'sponsored_post', true);
 
if($gpost !== '') {
$content = 'Guest Post: '.$content;
}
elseif ($spost !== ''){
$content = 'Sponsored Post: '.$content;
}
else {
$content = $content;
}
return $content;
}
add_filter('the_title_rss', 'wpb_rsstutorial_addtitle');

Bu kod basitçe özel alanları arar. Boş değillerse, özel alanın değerini RSS beslemenizdeki gönderi başlığına ekler.

Örnek 2: RSS Akışında Gönderi Başlığına Kategori Adı Ekleme

Bu örnek için, kategori adını yazı başlığında görüntüleyeceğiz.

Aşağıdaki kodu web sitenize eklemeniz yeterlidir:

function wpb_rsstutorial_titlecat($content) {
$postcat = "";
foreach((get_the_category()) as $cat) {
$postcat .= ' ('.$cat->cat_name . ')';
}
$content = $content.$postcat;
return $content;
}
add_filter('the_title_rss', 'wpb_rsstutorial_titlecat');

Artık RSS beslemesinde gönderi başlıklarıyla birlikte kategoriler de gösterilecek. Örneğin, Haberler ve Seyahat kategorilerinin yer aldığı “Bay Area’daki En İyi Yeni Restoranlar (Haberler) (Seyahat)”.

3. Belirli Etiketlere veya Kategorilere Sahip Gönderilere Özel İçerik Ekleme

Şimdi, yalnızca belirli etiketler veya kategoriler altında dosyalanan gönderiler için özel içerik eklemek istediğinizi varsayalım.

Aşağıdaki kod, belirli kategoriler ve etiketler altında dosyalanmış gönderilere kolayca içerik eklemenize yardımcı olacaktır:

function wpb_rsstutorial_taxonomies($content) {
 
if( is_feed() ){
 
// Check for posts filed under these categories
if ( has_term( array( 'travel', 'news' ), 'category' ) ) {
 
$content = $content."<br /><br />For special offers please visit our website"; 
 
}
}
return $content;
}
add_filter('the_excerpt_rss', 'wpb_rsstutorial_taxonomies');
add_filter('the_content', 'wpb_rsstutorial_taxonomies');

Bu kodu etiketlerin yanı sıra özel taksonomileri de hedefleyecek şekilde değiştirebilirsiniz.

İşte belirli etiketleri hedeflemeye bir örnek:

function wpb_rsstutorial_taxonomies($content) {
 
if( is_feed() ){
 
// Check for posts filed under these categories
if ( has_term( array( 'holidays', 'blackfriday' ), 'post_tag' ) ) {
 
$content = $content."<br /><br />For special offers please visit our website"; 
 
}
}
return $content;
}
add_filter('the_excerpt_rss', 'wpb_rsstutorial_taxonomies');
add_filter('the_content', 'wpb_rsstutorial_taxonomies');

Varsayılan olarak, WordPress RSS beslemeniz gönderiler için öne çıkan görselleri göstermez. WPCode’un kütüphanesinde bulunan bir kod parçacığını kullanarak bunları kolayca ekleyebilirsiniz.

Basitçe Code Snippets ” + Add Snippet ‘e gidin ve ardından kütüphanede ‘rss’ için arama yapın.

Daha sonra ‘RSS Beslemelerine Öne Çıkan Görseller Ekle’ adlı snippet’in üzerine gelip ‘Snippet’i Kullan’ düğmesine tıklayabilirsiniz.

WPCode Includes a Snippet to Add Featured Images to Your RSS Feed

Şimdi tek yapmanız gereken ‘Aktif’ geçişini Açık konuma getirmek ve ardından ‘Güncelle’ düğmesine tıklamak.

Öne çıkan görseller artık RSS beslemelerinize eklenmiştir.

Toggle the Active Switch On

RSS beslemenize öne çıkan resimleri manuel olarak da ekleyebilirsiniz.

Kullanabileceğiniz kod budur:

function wpb_rsstutorial_featuredimage($content) {
global $post;
if(has_post_thumbnail($post->ID)) {
$content = '<p>' . get_the_post_thumbnail($post->ID) .
'</p>' . get_the_content();
}
return $content;
}
add_filter('the_excerpt_rss', 'wpb_rsstutorial_featuredimage');
add_filter('the_content_feed', 'wpb_rsstutorial_featuredimage');

Bu kod basitçe bir gönderinin küçük resmi (öne çıkan görsel) olup olmadığını kontrol eder ve gönderi içeriğinizin geri kalanıyla birlikte görüntüler

WordPress RSS Beslemelerini Özelleştirmeye İlişkin Bonus Kaynaklar

RSS beslemeleri daha fazla kullanıcı çekmek ve mevcut abonelerinizin ilgisini canlı tutmak için yararlı bir araç olabilir. İşte WordPress beslemelerinizi daha da optimize etmenize yardımcı olacak birkaç kaynak:

Umarız bu makale WordPress RSS beslemelerinize nasıl içerik ekleyeceğinizi öğrenmenize yardımcı olmuştur. WordPress blogunuza e-posta aboneliklerini nasıl ekleyeceğinize ilişkin kılavuzumuzu veya en iyi WordPress işletme dizini eklentileri hakkındaki uzman seçimimizi de görmek isteyebilirsiniz.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Açıklama: İçeriğimiz okuyucu desteklidir. Bu, bazı bağlantılarımıza tıklarsanız komisyon kazanabileceğimiz anlamına gelir. WPBeginner'ın nasıl finanse edildiğini, neden önemli olduğunu ve nasıl destek olabileceğinizi görün. İşte editoryal sürecimiz.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Ultimate WordPress Araç Kiti

Araç setimize ÜCRETSİZ erişim sağlayın - her profesyonelin sahip olması gereken WordPress ile ilgili ürün ve kaynaklardan oluşan bir koleksiyon!

Reader Interactions

39 yorumBir Cevap Bırakın

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Roberto Diaz says

    Hi guys, I am trying to add the featured image by default to RSS posts and I have 2 questions:

    1. Where exactly do you add the code you mention?
    2. In your code I see “function wpb_rsstutorial” are we supposed to replace this or any other part of the code with our own parameters?

    Thank you for your help!

    • WPBeginner Support says

      If you check under our ‘Adding Content to WordPress RSS Feed using Code’ section we cover the different methods for adding the code from our guide.

      For the function names, those are not required to be changed unless you want to and if you change it you would want to ensure you change every instance of it with the original name to your new name.

      Yönetici

    • WPBeginner Support says

      We do not recommend adding content after every paragraph in your RSS feed at this time.

      Yönetici

  3. Macca Sherifi says

    On your RSS feed you’ve got a real simple “To leave a comment please visit [Post Title] on WPBeginner.”

    How do I replicate this? In your code that you’ve supplied, presumably I have to change “coolcustom”, but which one do I edit specifically?

  4. Lapan says

    Hi.
    If I have in post:
    [text1]Text one[text1]
    [text2]Text two[text2]

    How do I return text2 shortcode in rss only?

  5. Gretchen Louise says

    I’m trying to use the third option to add the Digg Digg plugin’s buttons to the bottom of my RSS feeds. Any suggestions on editing the content to incorporate PHP rather than just text?

  6. brandy says

    I am trying to use this to implement CSS disclosure buttons in my feed, but I *cannot* figure out how to get it into the description. I have code of what I tried (2 different functions for the excerpt & the post). i hate how the buttons show up in the excerpt and i don’t think it’s necessary. help? :)

  7. Matt says

    I really appreciate you sharing this information with us. I have implemented this on my site now…I always really liked how it looks in your “weekly” emails that I receive.

    I think that it looks very professional and of course it is gonna help fight back against those content scrapers (thieves).

    Again, well written code, and very useful advice. Thank you!

  8. Adam says

    Great info! One question…  on #1 Add a Custom Field to your WordPress RSS Footer, for some reason the content/custom field is displayed twice. Any idea why?

  9. rahul says

    I have problem that in my site if someone fills a contact us form then his all personal info is displayed in rss feed and any user can see it
    plz help !!!!!
     

  10. thehifly says

    I actually got it now. Just edited the “$content = $content.”<br /><br /><div>”.$coolcustom.”</div>n”;” line. Perfect!

  11. thehifly says

    Adding the additional text works great but I’m trying to have the RSS to show only that custom field (for example the “coolcustom”) as the post’s description. Get rid of the actual text of the post. Is that possible?

  12. scot says

    Hi, I’m looking to add two fields to my ‘full’ rss feed. One which displays the author of the post and the other which displays a list of the taxomonies, if any, that the post is in. So let’s say the author is JohnR and the post is in the NFL, Raiders and Jets taxonomies, the RSS would have two additional fields:

    JohnR
    NFL, Raiders, Jets

    Can someone point me in the right direction to get this done?

    – Scot

  13. Agilworld says

    Thanks for sharing…

    Your tutorial is useful to me for verify the Technorati claim token! It worked nicely. I was looking for an effective way to verify it and found articles that discuss about that. But most of it, is not effective. And in the end, thought in my mind how add extra text in each footer post RSS feeds, Great! I found a smart way through your article, Thanks!!

  14. Juri says

    Hi,
    your code to add Custom Fields to RSS works great!!!! Thanks!
    I’m wondering if there is a way to edit the position and not to show the custom fields in the footer but above the title, or under the title, or etc… Is there a chance to add the tag “style” and so use some css?
    Thank you very much

  15. Juri says

    Add a Custom Field to your WordPress RSS Footer:
    THANKS Your code works perfectly. I have a question: How can I edit the position to show custom field up before the title or just after the title?
    I tried to edit the code here:
    $content = $content.””.$coolcustom.”
    “;
    I can remove the br tags and it works but where can I add style and css?

    Thanks for your great help

    • Editorial Staff says

      You would have to use inline styling for the RSS to work on all different readers. To add it before, you will add it like $coolcustom.$content and then add div tags using quotation where you like…

      Yönetici

  16. Robert Simpson says

    Hi,

    I’m trying to find a way to use a custom field to EXCLUDE a post from the RSS feed.

    Any ideas?

    Cheers,
    Robert

  17. Zach says

    Hey, thanks for the tutorial. It worked perfectly. Had a quick question though – after I get the extra content to load into the RSS Feed (for example if I’m viewing it in Safari), when I actually embed the RSS Feed on a website, that extra info goes away. Do you have any idea why that would happen? It’s been about 4 days as well – and I’ve tried clearing my cache several times. Thanks!

  18. kiki says

    Thanks for this so far! I haven’t been able to find much on adding custom fields to the RSS feed until now.

    Would it be difficult to add multiple custom fields with the code from section 1? I have an event listing website with custom fields for each post I want to display in the RSS, i.e. “Venue,” “Event Date,” “Address,” et al.

      • Kiki says

        Sorry, I’m a bit of a novice, but what would the code look like to get the multiple custom fields. I’ve tried playing with a few configurations of the code so far but it keeps resulting in errors. One field is working great though!

    • Editorial Staff says

      Ajay but does your plugin allows one to add custom fields in the RSS Text? Because it just seems like that it has the exact same functionality that Joost’s RSS Footer Plugin has which is not what this article is showing. What if you need to display different FTC texts for each post, then plugins like yours and RSS Footer would fail because they show the same text on each post. With this, one can set different ways: For example, if custom field this: Display that otherwise display the default copyright or something like that.

      Yönetici

  19. Oscar says

    This is great, it should help out a lot when trying to do quick little customizations. Little bite-sized tips like this are very helpful. I’ve seen people put some of the social media icons at the bottom too, to add to digg, and su and stuff.

Bir Cevap Bırakın

Yorum bırakmayı seçtiğiniz için teşekkür ederiz. Lütfen tüm yorumların yorum poli̇ti̇kasi uyarınca denetlendiğini ve e-posta adresinizin yayımlanmayacağını unutmayın. Ad alanında anahtar kelime KULLANMAYIN. Kişisel ve anlamlı bir sohbet edelim.