# Shortcode vs Template Tags

**URL:** <https://community.podlove.org/t/shortcode-vs-template-tags/192>\
**Category:** Podlove Publisher\
**Created:** [July 5, 2015, 12:36pm UTC](https://community.podlove.org/t/shortcode-vs-template-tags/192 "2015-07-05T12:36:23Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![philipbanse](https://community.podlove.org/letter_avatar_proxy/v4/letter/p/bbe5ce/32.png) [@philipbanse](https://community.podlove.org/u/philipbanse)\
**Post date:** [July 5, 2015, 12:36pm UTC](https://community.podlove.org/t/shortcode-vs-template-tags/192/1 "2015-07-05T12:36:23Z")

</div>

Hi.

My landing page [kuechenstud.io](http://kuechenstud.io) used to show the subtitle of the latest show:

\<?php echo do\_shortcode('[podlove-episode field="subtitle"]'); ?\>

After one of the latest updates it doesn´t work anymore.

How do I use template tags to show the subtitle of the latest show again?

Thanks.

---

<div class="post-metadata">

**Author:** ![katrinleinweber](https://community.podlove.org/user_avatar/community.podlove.org/katrinleinweber/32/332_2.png) [@katrinleinweber](https://community.podlove.org/u/katrinleinweber)\
**Post date:** [July 5, 2015, 1:24pm UTC](https://community.podlove.org/t/shortcode-vs-template-tags/192/2 "2015-07-05T13:24:19Z")

</div>

Hi!

The corresponding template tag to `[podlove-episode field="subtitle"]` is `{{ episode.subtitle }}`, so maybe just replacing that does the trick. I’m not familiar with wrapping it in this PHP code, though.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![philipbanse](https://community.podlove.org/letter_avatar_proxy/v4/letter/p/bbe5ce/32.png) [@philipbanse](https://community.podlove.org/u/philipbanse)\
**Post date:** [July 6, 2015, 6:24am UTC](https://community.podlove.org/t/shortcode-vs-template-tags/192/3 "2015-07-06T06:24:02Z")

</div>

Thanks - but no 😉 Doesn´t help.

---

<div class="post-metadata">

**Author:** ![katrinleinweber](https://community.podlove.org/user_avatar/community.podlove.org/katrinleinweber/32/332_2.png) [@katrinleinweber](https://community.podlove.org/u/katrinleinweber)\
**Post date:** [July 6, 2015, 7:46am UTC](https://community.podlove.org/t/shortcode-vs-template-tags/192/4 "2015-07-06T07:46:13Z")

</div>

Hm… [kuechenstud.io](http://www.kuechenstud.io/) now shows `[podcast.subtitle]` to the template engine itself seems to work. But where do the square brackets come from? I think they are the deal breaker here. Can you maybe post your entire template code here?

---

<div class="post-metadata">

**Author:** ![philipbanse](https://community.podlove.org/letter_avatar_proxy/v4/letter/p/bbe5ce/32.png) [@philipbanse](https://community.podlove.org/u/philipbanse)\
**Post date:** [July 6, 2015, 8:13am UTC](https://community.podlove.org/t/shortcode-vs-template-tags/192/5 "2015-07-06T08:13:05Z")

</div>

Right now [kuechenstud.io](http://kuechenstud.io) shows {{ episode.summary }}.

The whole code of the landing-page is:

```
<?php
/*
Template Name: Landing Page
*/
?>

<?php get_header(); ?>
<?php if ( have_posts() ) the_post(); ?>
  <section id="landing-info">
    <?php the_content(); ?>
  </section>

  <section>
    <ul id="show-list" class="landing">
    <?php
      $shows = get_blogs_of_user(1);
      // print_r($shows);
      
      global $post;
      
      $args = array(
        'numberposts' => 1,
        'post_type' => 'podcast' );

      foreach ($shows as $show) {
               
        switch_to_blog($show->userblog_id);
        
        $episodes = get_posts( $args );
        foreach ($episodes as $post ) {
          setup_postdata($post);
          ?>
	        <li class="<?php echo str_replace('/','',$show->path); ?>">
	          <div class="show-head">
	            <a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>">
	              <h2><?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?></h2>
	              <img src="<?php header_image(); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" />
              </a>
              <div class="player-small">
                <?php // echo do_shortcode('[podlove-web-player]'); ?>
              </div>
            </div>
	          <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
	          <?php echo do_shortcode(' {{ episode.summary }} '); ?>
	        </li>
	        <?php
        }
      }
      switch_to_blog(1);
    ?>
    </ul>
	</section>

<?php get_footer(); ?>
```

---

<div class="post-metadata">

**Author:** ![katrinleinweber](https://community.podlove.org/user_avatar/community.podlove.org/katrinleinweber/32/332_2.png) [@katrinleinweber](https://community.podlove.org/u/katrinleinweber)\
**Post date:** [July 6, 2015, 8:21am UTC](https://community.podlove.org/t/shortcode-vs-template-tags/192/6 "2015-07-06T08:21:35Z")

</div>

OK, thanks. @ericteubert: I’m at the end of my knowledge & intuition here, sorry.

---

<div class="post-metadata">

**Author:** ![ericteubert](https://community.podlove.org/user_avatar/community.podlove.org/ericteubert/32/1568_2.png) [@ericteubert](https://community.podlove.org/u/ericteubert)\
**Post date:** [July 6, 2015, 9:01am UTC](https://community.podlove.org/t/shortcode-vs-template-tags/192/7 "2015-07-06T09:01:18Z")

</div>

There’s no official way yet to access Publisher data from within themes, but this will work here:

```php
<?php
$episode = \Podlove\Model\Episode::find_one_by_post_id(get_the_ID());
echo $episode->summary;
?>

```

---

<div class="post-metadata">

**Author:** ![philipbanse](https://community.podlove.org/letter_avatar_proxy/v4/letter/p/bbe5ce/32.png) [@philipbanse](https://community.podlove.org/u/philipbanse)\
**Post date:** [July 6, 2015, 10:09am UTC](https://community.podlove.org/t/shortcode-vs-template-tags/192/8 "2015-07-06T10:09:35Z")

</div>

Great. Works. I only changed

```
$episode->summary

```

to

```
$episode->subtitle

```

Thanks!

---

<div class="post-metadata">

**Author:** ![timpritlove](https://community.podlove.org/user_avatar/community.podlove.org/timpritlove/32/1930_2.png) [@timpritlove](https://community.podlove.org/u/timpritlove)\
**Post date:** [July 6, 2015, 2:38pm UTC](https://community.podlove.org/t/shortcode-vs-template-tags/192/9 "2015-07-06T14:38:50Z")

</div>

This whole podcast overview page could be done much simpler with a single Podlove Template that would need no theme support or PHP intervention at all.

This is not a complete instruction, just from the top of my head and untested:

First create a list of podcasts named “kuechenstudio” in `Network -> Lists`. and add all relevant podcasts to it.

Then create a template named “kuechenhome” in `Network -> Templates` with the following contents:

```auto
<ul>
  {% for podcast in network.lists({id: "kuechenstudio"}).podcasts %}
  <li>
    <a href="{{ podcast.landingPageUrl }}" title="{{ podcast.title }}">
      {{ podcast.image.html({ width: icon_size }) }}
    </a>
    <div class="player-small"/>
    {% for episode in podcast({ limit: 1 }) %}
      <h3>
        <a href="{{ episode.url }}">
          {{ episode.title }}
        </a>
      </h3>
      {{ episode.subtitle }}          
    {% endfor %}
  </li>
  {% endfor %}
</ul>

```

Then put this shortcode into the page that is representing the home page:

```auto
[podlove-template template="kuechenhome"]

```

This should more or less do what you are doing now.
