Episode
Title
episode.title
Returns the episode title, if set, otherwise the post title. If you want to access the post title directly, use episode.post.post_title
.
Subtitle
episode.subtitle
Summary
episode.summary
Number
episode.number
Type
episode.type
One of: full
, trailer
, bonus
Slug
episode.slug
Post content
episode.content
Podcast
episode.podcast
Player
episode.player
Web Player for the current episode. The player should not appear in feeds, so embed it like this:
{% if not is_feed() %}
{{ episode.player }}
{% endif %}
You can set a custom context for tracking:
{{ episode.player({context: 'landing-page'}) }}
Post publication date
episode.publicationDate Uses WordPress datetime format by default or custom format:
{{ episode.publicationDate.format('Y-m-d') }}
see datetime
Post recording date
episode.recordingDate Uses WordPress datetime format by default or custom format:
{{ episode.recordingDate.format('Y-m-d') }}
see datetime
Explicit status
episode.explicit
yes
, no
or clean
URL
episode.url
Duration Object
episode.duration Useduration to display formatted hours, minutes and seconds. Alternatively, use the duration accessors for custom rendering.
see datetime
WordPress WP_Post object
episode.post
Image
episode.image
fallback: true
or false
.
Should the podcast image be used if no episode image is available? Default: false
Example:
{{ episode.image({fallback: true}).url }}
see image
Image URL
episode.imageUrl
Image URL with fallback
episode.imageUrlWithFallback
Total downloads
episode.total_downloads Please note that this value is only updated hourly.
Example:
{{ episode.total_downloads | number_format(0, ',', '.') }}
Meta value
episode.meta
Access a single meta value
Meta values
episode.metas
Access a list of meta values
Example:
<ul>
{% for meta in episode.metas("mymetakey") %}
<li>{{ meta }}</li>
{% endfor %}
</ul>
{% for meta in episode.metas("mymetakey") %}
{{ meta }}{% if not loop.last %}, {% endif %}
{% endfor %}
Post Tags
episode.tags
Access a list of post tags.
See http://codex.wordpress.org/Function_Reference/wp_get_object_terms#Argument_Options for a list of available argument options.
Example:
{% for tag in episode.tags({order: "ASC", orderby: "count"}) %}
<a href="{{ tag.url }}">{{ tag.name }} ({{ tag.count }})</a>
{% endfor %}
see tag
Categories
episode.categories
Access a list of episode categories. See http://codex.wordpress.org/Function_Reference/wp_get_object_terms#Argument_Options for a list of available argument options.
Requires the "Categories" module.
Example:
{% for category in episode.categories({order: "ASC", orderby: "count"}) %}
<a href="{{ category.url }}">{{ category.name }} ({{ category.count }})</a>
{% endfor %}
see category
Files
episode.files
List of episode files
see file
File
episode.file
One episode file by asset name.
Example:
<a href="{{ episode.file("pdf").publicUrl }}">Download episode PDF</a>
see file
Chapters
episode.chapters List of episode chapters
see chapter
License
episode.license
To render an HTML license, use {% include '@core/license.twig' %}
for a license with fallback to the podcast license or {% include '@core/license.twig' with {'license': episode.license} %}
for the episode license only.
see chapter
Contributors
episode.contributors
List of episode contributors
Examples
Iterating over a list of contributors
{% for contributor in episode.contributors %}
{{ contributor.name }}
{% if not loop.last %}, {% endif %}
{% endfor %}
Iterating over a grouped list of contributors
{% for contributorGroup in episode.contributors({groupby: "group"}) %}
<strong>{{ contributorGroup.group.title }}:</strong>
{% for contributor in contributorGroup.contributors %}
{{ contributor.name }}
{% if not loop.last %}, {% endif %}
{% endfor %}
{% endfor %}
Parameters
- id: Fetch one contributor by its id. Example:
episode.contributors({id: 'james'}).name
- group: group slug. If none is given, show all contributors.
- role: role slug. If none is given, show all contributors.
- groupby: group or role slug. Group by
group
orrole
. If used, the returned data is has another layer for the groups. See examples for more details. - order: Designates the ascending or descending order of the
orderby
parameter. Defaults toASC
.ASC
- ascending order from lowest to highest values (1, 2, 3; a, b, c).DESC
- descending order from highest to lowest values (3, 2, 1; c, b, a).
- orderby: Sort contributors by parameter. Defaults to
position
.position
- Order by the contributors position in the episode.comment
- Order by the contributors comment in the episode.
Season
episode.season
Get season for an episode
Related Episodes
episode.relatedEpisodes
List of Related Episodes
Show
episode.show
Examples
This episode is part of the Show: {{ episode.show.title }}
which deals with
{{ episode.show.summary }}
Transcript
episode.transcript
Grouped by speaker
Examples
<style type="text/css">
.ts-speaker { font-weight: bold; }
.ts-items { margin-left: 20px; }
.ts-time { font-size: small; color: #999; }
</style>
{% for group in episode.transcript %}
<div class="ts-group">
{% if group.contributor %}
<div class="ts-speaker">{{ group.contributor.name }}</div>
{% endif %}
<div class="ts-items">
{% for line in group.items %}
<span class="ts-time">{{ line.start }}–{{ line.end }}</span>
<div class="ts-content">{{ line.content }}</div>
{% endfor %}
</div>
</div>
{% endfor %}
Shownotes
episode.shownotes
info
Requires the Shownotes module.
Examples
Display all shownotes in a list.
<ul>
{% for entry in episode.shownotes %}
<li class="psn-entry">
{% if entry.type == "link" %}
{% if entry.icon %}
<img class="psn-icon" src="{{ entry.icon }}" />
{% endif %}
<a class="psn-link" href="{{ entry.url }}">{{ entry.title }}</a>
{% elseif entry.type == "topic" %}
{{ entry.title }}
{% endif %}
</li>
{% endfor %}
</ul>
Group shownotes by topic.
{% for topic in episode.shownotes({groupby: "topic"}) %}
<h3>{{ topic.title }}</h3>
<ul>
{% for entry in topic.entries %}
<li class="psn-entry">
{% if entry.type == "link" %}
{% if entry.icon %}
<img class="psn-icon" src="{{ entry.icon }}"/>
{% endif %}
<a class="psn-link" href="{{ entry.url }}">{{ entry.title }}</a>
{% endif %}
</li>
{% endfor %}
</ul>
{% endfor %}
Has Shownotes?
episode.hasShownotes
Examples
{% if episode.hasShownotes %}
Here are some shownotes
{% else %}
¯\_(ツ)_/¯
{% endif %}