• Resolved pablopaul

    (@pablopaul)


    I am trying to display a list of our podcast series on one of our website’s pages. The shortcode works great for displaying just the series’ titles with links and episode counts, but we were hoping to include the description and image for each series as well. If this is not possible with a shortcode, can you please give me some guidance how to structure a query to get that data?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @pablopaul,

    Unfortunately, no series images and descriptions are not parameters in the current playlist short code but you can use image=true to display the episode’s featured image alongside the title and media player while the episode is playing. For the complete list of parameters available for the [podcast_playlist] please check our help docs https://support.castos.com/article/41-podcastplaylist-shortcode

    Thread Starter pablopaul

    (@pablopaul)

    Thank you for your quick reply. Since the shortcode doesn’t have the functionality we need, I have been trying construct a query with the ‘series’ taxonomy to retrieve only the ‘series’ posts, but haven’t been able to narrow the results; it always returns individual episodes rather than the series.

    Just for testing purposes, here’s the code I have tried that returns nothing:

    $query = new WP_Query( [
    	'posts_per_page'    => '4',
    	'post_type'         => 'post',
    	'post_status' 		=> 'publish',
    	'tax_query'        	=> [
    		[
    			'taxonomy'      => 'series',
    			'field' 	=> 'slug',
    		]
    	]
    ] );

    I have also tried using the post_type of podcast, and various other tax_query settings, all to no avail. I’d really appreciate it if you could help me properly form this query to return just the series, or point me in the right direction to accomplish this.

    Thank you!

    • This reply was modified 4 years, 6 months ago by pablopaul.
    Thread Starter pablopaul

    (@pablopaul)

    Finally got this to work, and maybe this will help someone in a similar situation. If you are building a page template and need to get a list of your series with the name, slug, images, descriptions, etc., you can use WP_Term_Query:

    
    // pre WP 4.7, less secure
    // $terms = get_terms( $args );
    
    // WP 4.7+, more secure
    $query = new WP_Term_Query( $args );
    $terms = $query->terms;
    
    // If there are results, do something with them
    if ( ! empty( $terms ) ) {
      echo "<pre>"; print_r($terms); echo "</pre>";
    }
    

    The support here is excellent. They followed up with me twice to be sure my issue was resolved. Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Is there any way to include series image and descriptions in the shortcode?’ is closed to new replies.