Now that I’ve got the display of all sermons and the pagination sorted, it’s time to figure out how to display just the sermons from a particular speakers.
get_the_term_list() function returns a link which should arrive at a page showing all sermons by that speaker, but for it to work, some extra work is needed.
Adding Taxonomy Template
Create a new file named taxonomy-speaker.php. This can be copied from tag.php in the twenty ten parent theme. The template hierarchy will load this file when getting sermons from a specific speaker.
Add the following line before the printing of the page title.
$term = get_term_by('slug',get_query_var('term'),get_query_var('taxonomy'));
Modify the bit in between the
<span> tags to
get_template_part() function to
get_template_part('loop','sermons') to use the customized loop for sermons. This will ensure that the speaker name and full text are displayed.