Author Topic: Powerpress image of the episode  (Read 1206 times)

geekazine

  • Full Member
  • **
  • Posts: 31
Powerpress image of the episode
« on: July 08, 2011, 08:30:26 pm »
Hey guys

Trying to create a media bar on the top of my page (similar to tpn.tv). Exception: I want top 3 posts in the category. The first post, I want the image to show up.

Not sure if the [powerpress image] is the right route to go. Here is the code:

Code: [Select]
<?php query_posts(&#39;cat=3&showposts=3&#39;);
if (have_posts()) : while (have_posts()) : the_post(); ?>

<?php if (the_post(id) == 0) { ?> [powerpress image] <?php ?>
<!-- title of featured article -->
<a href="<?php the_permalink() ?>" rel="bookmark"><?php echo substr(the_title(&#39;&#39;,&#39;..&#39;,FALSE),12,39); ?></a><br />
<?php endwhile; endif; wp_reset_query();?>

What's the nomenclature so I can post the image? Or do I have to do something different?

Thanks.


angelo

  • CIO, RawVoice
  • Administrator
  • Hero Member
  • *****
  • Posts: 4483
Re: Powerpress image of the episode
« Reply #1 on: July 14, 2011, 10:07:41 am »
That is not going to work. First, the shoretcode only works when it's within blog post content. Second, there's no way to tell PowerPress just to display an image. What's used on the tpn.tv theme is custom code.

You want to do something like this.


Code: [Select]
<?php query_posts(&#39;cat=3&showposts=3&#39;);
if (have_posts()) : while (have_posts()) : the_post(); ?>

<?php

if( function_exists(&#39;powerpress_get_enclosure_data&#39;) )
{
$EpisodeData powerpress_get_enclosure_dataget_the_ID(), &#39;podcast&#39;);
if( !empty($EpisodeData[&#39;image&#39;]) )
{
$image $EpisodeData[&#39;image&#39;];
$title get_the_title();
$link get_permalink();
echo &#39;<a href="&#39;. $link .&#39;" title="&#39;. $title .&#39;">&#39;;
echo &#39;<img src="&#39;. $image .&#39;" alt="&#39;. $title .&#39;" />&#39;;
echo &#39;</a>&#39;;
}
}

?>

<!-- title of featured article -->
<a href="<?php the_permalink() ?>" rel="bookmark"><?php echo substr(the_title(&#39;&#39;,&#39;..&#39;,FALSE),12,39); ?></a><br />
<?php endwhile; endif; wp_reset_query();?>

geekazine

  • Full Member
  • **
  • Posts: 31
Re: Powerpress image of the episode
« Reply #2 on: July 14, 2011, 11:47:31 am »
Understood on the code. Since I posted it's gone through some changes. I tried the picture option and it worked. Now to do some tooling to make the ajax work the way I want.

Thanks Angelo. You da man!