Hi @josephindiegraf
Could I just confirm, are you trying to get the image added to the Series in the Series UI, or the image added to the Series feed, in the plugin Feed Settings?
Hi @psykro I am trying to get the image from the Series UI.
Thanks in advance!
Hi @josephindiegraf
Based on your original post, I assume you’re working on a theme archive page, and rendering the series using the default WordPress series url (eg domain.com/series/series-name)
Your first step is to get the series object, which you can do using the following code
$series = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
Once you have the series, you need to get the attachment id of the image, which is saved as term meta value for the series, using the meta key podcast_series_image_settings.
$attachement_id = get_term_meta( $series->term_id, 'podcast_series_image_settings', true );
Once you have the attachment id, you can use any of WordPress’ built in attachment functions, like wp_get_attachment_image or wp_get_attachment_image_src, which will return different types of data for that image, depending on what you need for your specific requirements.
https://developer.wordpress.org/reference/functions/wp_get_attachment_image/
https://developer.wordpress.org/reference/functions/wp_get_attachment_image_src/
This is exactly what I’ve been looking for @psykro thank you again!
Hi @psykro
a var_dump($series) called after your first step code, return null.
Can you help me to have series name and series image on my podcast-single page and series page ?
Thank you for helping,
-ISZ.
I don’t understand. Where is the code going to be put.