Anara Ciyarwar Podcast na waje zuwa Ciyarwar shafin yanar gizonku na WordPress

Ayyukan Ciyarwar WordPress

Shahararren Podcast akan layi yana amfani dashi WordPress azaman dandalin wallafe-wallafensu don bayani game da kwaskwarimar su da kuma buga tarin bayanai game da kowane wasan kwaikwayo. Koyaya, da gaske suna karɓar kwasfan fayiloli kanta akan injin kwastomomi na waje. Ba shi da kyau ga baƙi na rukunin yanar gizon - amma ba shi da fasali guda ɗaya wanda ba ya ganuwa ga masu amfani amma bayyane ga masu rarrafe kamar Google.

Google ya ayyana wannan a cikin tallafi:

Kari akan haka, idan kun hada abincin RSS da shafin farko, masu amfani da ke neman kwalliyar ku ta hanyar suna za su iya samun kwatancen kwasfan ku da kuma carousel na abubuwan da za su nuna wasanku a kan Google Search. Idan baku samar da shafin haɗin yanar gizo ba, ko kuma Google ba zai iya tantance shafin gidanku ba, har ila yau abubuwanku na iya bayyana a cikin sakamakon Neman Google, amma an haɗa su ne kawai tare da wasu ɓangarorin daga sauran kwasfan fayiloli a kan wannan batun.

Google - Samu kwasfan fayiloli akan Google

 Tare da haɗin gwiwar guda biyu, zaku iya samun kyakkyawan ɗaukar hoto a cikin Google:

Taskar labarai akan Google SERP

Jirgin shafin yana bayyana abincin gidan yanar gizo, amma ba ainihin ba podcast abinci - wanda aka shirya shi a waje. Kamfanin yana son adana abincinsa na yanzu, don haka muna son ƙara ƙarin abinci zuwa shafin. Ga yadda:

  1. Muna buƙatar lambar a sabon abinci a cikin taken WordPress.
  2. Muna bukatan dawo da buga abincin kwasfan fayiloli na waje a cikin wannan sabon abincin.
  3. Muna bukatan aara hanyar haɗi a cikin kai na shafin yanar gizon WordPress wanda ke nuna sabon URL ɗin abinci.
  4. Kyauta: Muna buƙatar tsaftace sabon URL na ciyarwar fayel don haka bai kamata mu dogara da tushen tushe ba kuma zamu iya sake rubuta hanyar a cikin URL mai kyau.

Yadda ake Kara Sabon Abinci zuwa WordPress

A cikin takenku ko (ingantaccen shawarar) fayil ɗin ayyukan yara.php, zaku so ƙara sabon abinci kuma ku faɗi WordPress yadda zaku gina shi. Bayani ɗaya akan wannan… zai fitar da sabon abincin a https://yoursite.com/?feed=podcast

function add_podcast_feed() {
    add_feed( 'podcast', 'render_podcast_feed' );
}
add_action( 'init', 'add_podcast_feed' );

Dawo da Abincin Podcast na waje kuma Buga shi A Ciyarwar WordPress

Mun gaya wa WordPress za mu ba da kwasfan fayiloli ta amfani sake_podcast_feed, don haka yanzu muna son dawo da abincin waje (wanda aka sanya shi a matsayin https: //yourexternalpodcast.com/feed/ a cikin aikin da ke ƙasa kuma kwafin shi a cikin WordPress a lokacin buƙatar. Noteaya daga cikin bayanin kula… WordPress zai adana martani.

function render_podcast_feed() {
    header( 'Content-Type: application/rss+xml' );
    $podcast = 'https://yourexternalpodcast.com/feed/';
    
    $response = wp_remote_get( $podcast );
        try {
            $podcast_feed = $response['body'];

        } catch ( Exception $ex ) {
            $podcast_feed = null;
        } // end try/catch
 
    echo $podcast_feed;
} 

Sake Rubuta Sabon Abincinku zuwa Nice URL

Ga kadan daga cikin kari. Ka tuna yadda ake buga abincin tare da querystring? Zamu iya ƙara dokar sake rubutawa zuwa ayyuka.php don musanya hakan tare da URL mai kyau:

function podcast_feed_rewrite( $wp_rewrite ) {
    $feed_rules = array(
        'feed/podcast/' => 'index.php?feed=podcast'
    );

    $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;
}
add_filter( 'generate_rewrite_rules', 'podcast_feed_rewrite' );

Yanzu, an buga sabon abincin a https://yoursite.com/feed/podcast/

Aara hanyar haɗi zuwa Ciyar a cikin Kai

Mataki na karshe shine cewa kana so ka ƙara hanyar haɗi tsakanin alamun kai na rukunin yanar gizonku ta hanyar yanar gizo don masu yawo su iya nemo shi. A wannan halin, har ma muna so mu sanya abincin a matsayin farkon wanda aka jera (sama da blog ɗin da ciyarwar sharhi), saboda haka mun ƙara fifiko na 1. Za ku kuma so sabunta taken a cikin mahaɗin kuma ku tabbata cewa ba ya 'bai dace da taken wani abincin a shafin ba:

function add_podcast_link_head() {
    $podcast_link = site_url().'/feed/podcast/';
    ?>
    <link rel="alternate" type="application/rss+xml" title="My Podcast Name" href="<?php echo $podcast_link; ?>"/>
    <?php
}
add_action('wp_head', 'add_podcast_link_head', 1);

Sabon Abincin Wutar Lantarki na WordPress

Abu mai kyau game da wannan hanyar shine cewa mun sami damar ɗaukar kanmu duk canje-canje a cikin taken shafin… babu ƙarin fayilolin samfuri ko gyare-gyare na kanun labarai, da dai sauransu. Wasu mahimman bayanai kaɗan:

  • Permalinks - Da zarar ka ƙara lambar zuwa functions.php, kuna buƙatar buɗe Saituna> Permalinks a cikin WordPress admin. Wannan zai sake sabunta dokokinka na yau da kullun don haka lambar da muka ƙara don sake rubutawa yanzu ana aiki.
  • Tsaro - Idan rukunin yanar gizon ku SSL ne kuma abincin ku na adda ba haka bane, zaku shiga cikin batutuwan da hade tsaro. Ina bayar da shawarar sosai game da tabbatar da rukunin gidan yanar gizonku da kuma adana bayanan talla (a wani https adireshin ba tare da kurakurai ba).
  • Syndication - Ina bayar da shawarar sosai game da amfani da wannan takamaiman abincin na podcast don aikawa ga Google, Apple, Spotify da kowane irin sabis. Fa'idodi anan shine cewa yanzu zaka iya canza gidan watsa shirye-shiryenka duk lokacin da kake so kuma ba lallai bane ka sabunta kowane tushen tushen sabis.
  • Analytics - Ni da kaina zan bada shawarar samun sabis kamar FeedPress inda zaku iya tsara abincinku kuma ku sami bin diddigin tsarin amfani da shi fiye da yadda yawancin sabis ke samarwa. Hakanan FeedPress yana baka damar sarrafa aikin kai tsaye zuwa hanyoyin sadarwar ka, kyakkyawan yanayin fasali!

Kuna son ganin idan yana aiki? Zaka iya amfani da Yarda Ciyarda Validator don tabbatar da ciyarwar!

3 Comments

  1. 1

    Ya dauke ni kwanaki 2 1/2 na binciken gidan yanar gizo in sami wani abu da nake tsammanin kowane mai tallata shafin WordPress dole ne ya so ya yi - dauki bakuncin RSS game da kwasfan shirye-shiryen da suka shirya na uku a shafin su na wordpress.

    Don haka na gode! Tabbas labarinku yana buƙatar tambaya: me yasa wannan ba shine kayan aikin WordPress ba? Mafi kusa dana samu shine WP RSS Aggregator, amma gaba daya ya sake rubuta XML kuma ya karya RSS.

  2. 2

    Hi
    Na kafa shafin yanar gizon WordPress don sake buga RSS na kamar yadda aka nuna, kuma yana aiki da kyau, yana da kyau in sarrafa shi da kaina kuma in ɗauki babban mataki daga aikin watsa labarai.

    Ina da tambaya kodayake, saboda yadda mai masaukin kwastomata ke samar da RSS XML - yana samar da hanyar yanar gizo ta atomatik ga kowane al'amari wanda yake nuni zuwa shafin HTML akan gidan yanar gizon gidan yanar gizo mai kyauta wanda bana amfani dashi.

    Wani abu kamar <rss2><channel><item><link></link> idan alamar aiki. Ko "rss2> tashar> abu> mahada"

    Apple Podcast yana amfani da wannan bayanan na XML don nuna babban hanyar haɗi a kan shafinta don kowane abin da ya faru. Amma ban yi amfani da wannan gidan yanar gizon kyauta ba daga mai masaukin adana (Podbeans). Ina buƙatar shi ya nuna zuwa gidan yanar gizon kaina - inda aka shirya ciyarwar RSS da nake sarrafawa.

    Kuna tsammanin abu ne mai yuwuwa don sarrafa XML mai shigowa don canza hanyoyin haɗin da ke ciki daga podbeans.com zuwa my-website.com?

    • 3

      Zai yiwu a yi haka, amma kuma dole ne a rubuta lambar don neman ainihin fayilolin da aka shirya (kamar MP3). A gaskiya ba zan yi haka ba saboda yawancin rundunonin yanar gizo ba a inganta su don manyan fayilolin saukar da fayil da ake buƙata tare da kwasfan fayiloli ba.

Me kuke tunani?

Wannan shafin yana amfani da Akismet don rage spam. Koyi yadda aka sarrafa bayanan bayaninka.