Improve metadata markup

This commit is contained in:
2019-01-11 16:13:11 +00:00
parent 4bc196ad7b
commit 14de3f46ad
6 changed files with 183 additions and 135 deletions

View File

@@ -13,30 +13,36 @@ global $excerpt;
<?php echo $excerpt['content'] ?>
</div>
<div class="excerpt__foot">
<p class="excerpt__metadata">
<span class="excerpt__icon">
<svg class="icon icon--extra-small" aria-hidden="true">
<use xlink:href="#icon-profile"></use>
</svg>
</span>
<span class="excerpt__text"><?php echo $excerpt['author'] ?></span>
<span class="excerpt__icon">
<svg class="icon icon--extra-small" aria-hidden="true">
<use xlink:href="#icon-calendar"></use>
</svg>
</span>
<span class="excerpt__text"><?php echo $excerpt['date'] ?></span>
<span class="excerpt__icon">
<svg class="icon icon--extra-small" aria-hidden="true">
<use xlink:href="#icon-comments"></use>
</svg>
</span>
<span class="excerpt__text">
<?php
$number = $excerpt['comments'];
echo $number === '1' ? '1 comment' : $number . ' comments';
?>
</span>
</p>
<ul class="excerpt__list">
<li class="excerpt__list-item">
<span class="excerpt__icon">
<svg class="icon icon--extra-small" aria-hidden="true">
<use xlink:href="#icon-profile"></use>
</svg>
</span>
<span class="excerpt__text"><?php echo $excerpt['author'] ?></span>
</li>
<li class="excerpt__list-item">
<span class="excerpt__icon">
<svg class="icon icon--extra-small" aria-hidden="true">
<use xlink:href="#icon-calendar"></use>
</svg>
</span>
<span class="excerpt__text"><?php echo $excerpt['date'] ?></span>
</li>
<li class="excerpt__list-item">
<span class="excerpt__icon">
<svg class="icon icon--extra-small" aria-hidden="true">
<use xlink:href="#icon-comments"></use>
</svg>
</span>
<span class="excerpt__text">
<?php
$number = $excerpt['comments'];
echo $number === '1' ? '1 comment' : $number . ' comments';
?>
</span>
</li>
</ul>
</div>
</div>

View File

@@ -1,74 +1,76 @@
<section class="metadata">
<div class="metadata__item metadata__item--light">
<span class="metadata__icon">
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-calendar"></use>
</svg>
</span>
<span class="metadata__text">
<?php the_time(get_option('date_format')) ?>
</span>
</div>
<?php if (is_user_logged_in()): ?>
<div class="metadata__item">
<a class="metadata__link" href="<?php echo get_edit_post_link() ?>">
<ul class="metadata__list">
<li class="metadata__list-item metadata__list-item--light">
<span class="metadata__icon">
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-edit"></use>
<use xlink:href="#icon-calendar"></use>
</svg>
</span>
<span class="metadata__text">
Edit post
<?php the_time(get_option('date_format')) ?>
</span>
</a>
</div>
<?php endif; ?>
<div class="metadata__item">
<a class="metadata__link" href="<?php the_permalink() ?>#comments">
<span class="metadata__icon">
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-comments"></use>
</svg>
</span>
<span class="metadata__text">
<?php comments_number(); ?>
</span>
</a>
</div>
<div class="metadata__item">
<span class="metadata__icon">
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-tag"></use>
</svg>
</span>
<span class="metadata__text">
<?php windycoys_the_tags() ?>
</span>
</div>
<div class="metadata__item">
<div
class="fb-share-button"
data-href="<?php echo get_the_permalink() ?>"
data-layout="box_count"
data-size="small"
data-mobile-iframe="false"
>
<a
target="_blank"
href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fplugins%2F&amp;src=sdkpreparse"
class="fb-xfbml-parse-ignore"
>
Share
</li>
<?php if (is_user_logged_in()): ?>
<li class="metadata__list-item">
<a class="metadata__link" href="<?php echo get_edit_post_link() ?>">
<span class="metadata__icon">
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-edit"></use>
</svg>
</span>
<span class="metadata__text">
Edit post
</span>
</a>
</li>
<?php endif; ?>
<li class="metadata__list-item">
<a class="metadata__link" href="<?php the_permalink() ?>#comments">
<span class="metadata__icon">
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-comments"></use>
</svg>
</span>
<span class="metadata__text">
<?php comments_number(); ?>
</span>
</a>
</li>
<li class="metadata__list-item">
<span class="metadata__icon">
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-tag"></use>
</svg>
</span>
<span class="metadata__text">
<?php windycoys_the_tags() ?>
</span>
</div>
</div>
<div class="metadata__item">
<a
class="twitter-share-button"
href="<?php echo windycoys_get_twitter_share_url() ?>"
data-url="<?php echo get_the_permalink() ?>"
>
Tweet
</a>
</div>
<li class="metadata__list-item">
<div
class="fb-share-button"
data-href="<?php echo get_the_permalink() ?>"
data-layout="box_count"
data-size="small"
data-mobile-iframe="false"
>
<a
target="_blank"
href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fplugins%2F&amp;src=sdkpreparse"
class="fb-xfbml-parse-ignore"
>
Share
</a>
</div>
</li>
<li class="metadata__list-item">
<a
class="twitter-share-button"
href="<?php echo windycoys_get_twitter_share_url() ?>"
data-url="<?php echo get_the_permalink() ?>"
>
Tweet
</a>
</li>
</ul>
</section>

View File

@@ -8,7 +8,7 @@ $artwork = get_template_directory_uri().'/images/'.$podcast['id'].'.png';
class="excerpt__image"
title="<?php echo $podcast['podcast_title'] ?>"
src="<?php echo $artwork ?>">
<h3 class="excerpt__subtitle">
<h3 class="excerpt__title">
<a class="link" href="<?php echo $podcast['url'] ?>">
<?php echo $podcast['title'] ?>
</a>
@@ -21,24 +21,30 @@ $artwork = get_template_directory_uri().'/images/'.$podcast['id'].'.png';
<audio class="excerpt__audio" src="<?php echo $podcast['audio'] ?>" controls="true">
Your browser does not support the <code>audio</code> element.
</audio>
<p class="excerpt__metadata">
<a
class="link"
href="<?php echo $podcast['audio'] ?>"
title="Download the MP3">
Download MP3
</a> |
<a class="link" href="<?php echo $podcast['podcast_episodes'] ?>">
More episodes
</a>
</p>
<p class="excerpt__metadata">
<span class="excerpt__icon">
<svg class="icon icon--extra-small" aria-hidden="true">
<use xlink:href="#icon-calendar"></use>
</svg>
</span>
<span class="excerpt__text"><?php echo $podcast['date'] ?></span>
</p>
<ul class="excerpt__links">
<li class="excerpt__link">
<a
class="link"
href="<?php echo $podcast['audio'] ?>"
title="Download the MP3">
Download MP3
</a>
</li>
<li class="excerpt__link">
<a class="link" href="<?php echo $podcast['podcast_episodes'] ?>">
More episodes
</a>
</li>
</ul>
<ul class="excerpt__list">
<li class="excerpt__list-item">
<span class="excerpt__icon">
<svg class="icon icon--extra-small" aria-hidden="true">
<use xlink:href="#icon-calendar"></use>
</svg>
</span>
<span class="excerpt__text"><?php echo $podcast['date'] ?></span>
</li>
</ul>
</div>
</div>