• Resolved arminvit

    (@arminvit)


    Is there any way to create a simple UL/LI list that outputs the episode title and the episode description? It seems this isn’t possible through the shortcodes or widgets but seems like it should be within reach… I was looking at the PHP file under widgets “class-series.php” and I feel like I could add it there (around like 125) but unfortunately, I’m not that well versed in PHP.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Jonathan Bossenger

    (@psykro)

    Hi @arminvit

    You can use the ssp_episodes function for this.

    This function will return a array of episode objects, that you can loop through and output as an unordered list.

    I’ve included a simple example, which ouputs the episode title below

    
    $episodes = ssp_episodes();
    echo '<ul>';
    foreach ($episodes as $episode){
    	echo '<li>' . $episode->post_title . '</li>';
    }
    echo '</ul>';
    
    Thread Starter arminvit

    (@arminvit)

    Perfect, thank you Jonathan! If anybody else is looking for this to work, here is the amended code to show the description:

    $episodes = ssp_episodes();
    echo '<ul>';
    foreach ($episodes as $episode){
    	echo '<li>' . $episode->post_title . ': ' . $episode->post_content . '</li>';
    }
    echo '</ul>';
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘List of Episode Titles AND Descriptions’ is closed to new replies.