Hey guys,
I just wanted to share something I came across while trying to display the preacher image in the wpfc_preacher taxomony archive view. I was originally displaying the preachers image using apply_filters( 'sermon-images-list-the-terms', '' ); like so:
Problem with that approach, is that if the top post has multiple preachers associated with it, multiple preachers images will be displayed even though you're in an archive for a specific preacher. I searched around the documentation for how to properly display a single speaker's image but couldn't find anything. I then ran across the plugin originally used to develop the taxonomy images functionality for Sermon Manager and thankfully found a solution that still works with in the modified SM code:
`if ( apply_filters( 'sermon-images-queried-term-image', '', array( 'taxonomy' => 'wpfc_preacher', ) )) :
// get speaker image:
Hey guys, I just wanted to share something I came across while trying to display the preacher image in the wpfc_preacher taxomony archive view. I was originally displaying the preachers image using apply_filters( 'sermon-images-list-the-terms', '' ); like so:
if ( apply_filters( 'sermon-images-list-the-terms', '', array( 'taxonomy' => 'wpfc_preacher', ) )) : // get speaker image: print apply_filters( 'sermon-images-list-the-terms', '', array( 'image_size' => $size, 'taxonomy' => 'wpfc_preacher', 'after' => '', 'after_image' => '', 'before' => '', 'before_image' => '' ) );
Problem with that approach, is that if the top post has multiple preachers associated with it, multiple preachers images will be displayed even though you're in an archive for a specific preacher. I searched around the documentation for how to properly display a single speaker's image but couldn't find anything. I then ran across the plugin originally used to develop the taxonomy images functionality for Sermon Manager and thankfully found a solution that still works with in the modified SM code: `if ( apply_filters( 'sermon-images-queried-term-image', '', array( 'taxonomy' => 'wpfc_preacher', ) )) : // get speaker image:
Hope this info is helpful to someone. Let me know if there's a better way to get the single preacher image in an archive.
Platform
Sermon Manager Version: 2.15.17
WordPress Version: 5.3.2
PHP Version: 7.3.14