Podcast URL template tag
Issue #25
resolved
I think there should be a template tag for the podcast url. This way, if it needs to change in the future (which it might), it can be changed in the function and then all templates using the tag won't have to update to reflect potential changes.
It could be done like this
function wpfc_podcast_url(){
return home_url() . '/feed/podcast';
}
And then themes just have to use this when they want to use the podcast url:
echo wpfc_podcast_url();
Comments (3)
-
reporter -
reporter Sorry about the code formatting there, apparently the formatting is lost in comments here.
-
repo owner - changed status to resolved
- Log in to comment
Additionally, you could provide options to the theme author to return a link to just the feed page, or to the itpc link which auto loads itunes:
example:
//Podcast Feed URL function wpfc_podcast_url($feed_type = false){ if ($feed_type == false){ //return URL to feed page return home_url() . '/feed/podcast'; } else{ //return URL to itpc itunes-loaded feed page $itunes_url = str_replace("http", "itpc", home_url() ); return $itunes_url . '/feed/podcast'; } }
And then if I want to use the itpc version I can put this in my template echo wpfc_podcast_url(true);