Forum
How do I get the most recent podcast episode and display it?
I haven't worked with perch in months and have forgotten how to do so many things. I'm working on a site for a podcast, and the client would like to display the most recent podcast episode on their home page. I thought it would be something like this, except the available options for that function doesn't include a count or sort-order, and it doesn't seem to actually do anything.
<?php perch_podcasts_episode(perch_get('show-slug'), perch_get('ep'), array(
'template' => 'episode.html',
'sort-order' => 'DESC',
'count' =>1
)); ?>
I think that's because your code is looking for a query string in the url to identify what podcast to show.
Does this work?:
That works, in that it pulls the template, but it doesn't display any of the content within the template for the episode itself, such as the title and description.
What's in your template?
Don't you need to use
perch_podcasts_episodes
rather than shows?Then those options with the template should work. So:
Dexter, that does exactly what I needed it to do. I was close-ish.