Add podcast images

This commit is contained in:
2019-01-06 22:14:51 +00:00
parent aa2a74a2f5
commit 5deece89bf
6 changed files with 15 additions and 10 deletions

View File

@@ -62,3 +62,7 @@
margin-bottom: var(--space-sm); margin-bottom: var(--space-sm);
background-color: var(--color-light-blue); background-color: var(--color-light-blue);
} }
.excerpt__image {
height: 200px;
}

BIN
images/tfc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

BIN
images/xin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 971 KiB

View File

@@ -36,11 +36,11 @@
<h2 class="title">Podcasts</h2> <h2 class="title">Podcasts</h2>
<div class="page__columns"> <div class="page__columns">
<div class="page__cell"> <div class="page__cell">
<?php $podcast = windycoys_get_podcast_meta('tfc') ?> <?php $podcast = windycoys_get_podcast_meta('xin') ?>
<?php get_template_part('partials/podcast') ?> <?php get_template_part('partials/podcast') ?>
</div> </div>
<div class="page__cell"> <div class="page__cell">
<?php $podcast = windycoys_get_podcast_meta('xin') ?> <?php $podcast = windycoys_get_podcast_meta('tfc') ?>
<?php get_template_part('partials/podcast') ?> <?php get_template_part('partials/podcast') ?>
</div> </div>
</div> </div>

View File

@@ -121,11 +121,12 @@ function windycoys_get_podcast_meta($id) {
$item = $rss->channel->item; $item = $rss->channel->item;
$date = strtotime((String) $item->pubDate); $date = strtotime((String) $item->pubDate);
return array( return array(
id => $id,
from_cache => $res['from_cache'], from_cache => $res['from_cache'],
podcast_title => (String) $rss->channel->title, podcast_title => (String) $rss->channel->title,
podcast_description => (String) $rss->channel->description, podcast_description => (String) $rss->channel->description,
podcast_url => (String) $rss->channel->image->url,
podcast_episodes => windycoys_get_episodes_url($id), podcast_episodes => windycoys_get_episodes_url($id),
artwork_url => (String) $rss->channel->image->url,
title => (String) $item->title, title => (String) $item->title,
description => (String) $item->description, description => (String) $item->description,
image => (String) $item->image['href'], image => (String) $item->image['href'],

View File

@@ -1,18 +1,18 @@
<?php <?php
global $podcast; global $podcast;
$artwork = get_template_directory_uri().'/images/'.$podcast['id'].'.png';
?> ?>
<div class="excerpt"> <div class="excerpt">
<div class="excerpt__head"> <div class="excerpt__head">
<h3 class="excerpt__title"> <img
<a class="link" href="<?php echo $podcast['podcast_episodes'] ?>"> class="excerpt__image"
<?php echo $podcast['podcast_title'] ?> title="<?php echo $podcast['podcast_title'] ?>"
</a> src="<?php echo $artwork ?>">
</h3> <h3 class="excerpt__subtitle">
<h4 class="excerpt__subtitle">
<a class="link" href="<?php echo $podcast['url'] ?>"> <a class="link" href="<?php echo $podcast['url'] ?>">
<?php echo $podcast['title'] ?> <?php echo $podcast['title'] ?>
</a> </a>
</h4> </h3>
</div> </div>
<div class="excerpt__body"> <div class="excerpt__body">
<?php echo $podcast['description'] ?> <?php echo $podcast['description'] ?>