Tags template

This commit is contained in:
2018-12-13 21:56:06 +00:00
parent 9a2baf2f95
commit 07e5436c4b
8 changed files with 125 additions and 39 deletions

View File

@@ -61,7 +61,7 @@ function windycoys_the_tags() {
if ($tags) {
foreach($tags as $key=>$tag) {
echo '<a class="metadata__categories-link" href="' .
home_url() . '/tags/' . $tag->name . '" rel="tag">' .
home_url() . '/tag/' . $tag->name . '" rel="tag">' .
$tag->name . '</a>';
if ($key < count($tags) - 1) {
echo ', ';

View File

@@ -1,16 +1,16 @@
<div class="social">
<a class="social__link" href="https://www.facebook.com/WindyCOYS/">
<svg class="icon icon--facebook">
<a class="social__link" href="https://www.facebook.com/WindyCOYS/" aria-label="WindyCOYS on Facebook">
<svg class="icon icon--facebook" aria-hidden="true">
<use href="#icon-facebook"></use>
</svg>
</a>
<a class="social__link" href="https://twitter.com/windycoys/">
<svg class="icon icon--twitter">
<a class="social__link" href="https://twitter.com/windycoys/" aria-label="WindyCOYS on Twitter">
<svg class="icon icon--twitter" aria-hidden="true">
<use href="#icon-twitter"></use>
</svg>
</a>
<a class="social__link" href="/feed">
<svg class="icon icon--rss">
<a class="social__link" href="/feed" aria-label="WindyCOYS RSS Feed">
<svg class="icon icon--rss" aria-hidden="true">
<use href="#icon-rss"></use>
</svg>
</a>

View File

@@ -1,6 +1,6 @@
<section class="metadata">
<div class="metadata__date">
<svg class="icon">
<svg class="icon" aria-hidden="true">
<use href="#icon-calendar"></use>
</svg>
<span class="metadata__date-text">
@@ -10,7 +10,7 @@
<?php if (is_user_logged_in()): ?>
<div class="metadata__editor">
<a class="metadata__editor-link" href="<?php echo get_edit_post_link() ?>">
<svg class="icon">
<svg class="icon" aria-hidden="true">
<use href="#icon-edit"></use>
</svg>
<span class="metadata__editor-text">
@@ -21,7 +21,7 @@
<?php endif; ?>
<div class="metadata__comments">
<a class="metadata__comments-link" href="<?php the_permalink() ?>#comments">
<svg class="icon">
<svg class="icon" aria-hidden="true">
<use href="#icon-comments"></use>
</svg>
<span class="metadata__comments-text">
@@ -30,7 +30,7 @@
</a>
</div>
<div class="metadata__categories">
<svg class="icon">
<svg class="icon" aria-hidden="true">
<use href="#icon-hash"></use>
</svg>
<span class="metadata__categories-text">
@@ -39,12 +39,12 @@
</div>
<div class="metadata__share">
<a class="metadata__share-link" href="#" aria-label="Facebook">
<svg class="icon icon--facebook">
<svg class="icon icon--facebook" aria-hidden="true">
<use href="#icon-facebook"></use>
</svg>
</a>
<a class="metadata__share-link" href="<?php windycoys_share_twitter_url() ?>" aria-label="Twitter">
<svg class="icon icon--twitter">
<svg class="icon icon--twitter" aria-hidden="true">
<use href="#icon-twitter"></use>
</svg>
</a>

View File

@@ -14,36 +14,36 @@ get_header();
echo $wp_query->found_posts.' results matching "' . $query . '" found.';
?>
</h1>
<ol class="search-results">
<ol>
<?php if (have_posts()): while (have_posts()) : the_post(); ?>
<?php $username = get_the_author_meta('nickname') ?>
<?php $date = get_the_date('jS F, Y', $id).' at '.get_the_date('H:i', $id) ?>
<li class="search-results__content">
<div class="search-result">
<div class="search-result__head">
<div class="search-result__title">
<li>
<div class="excerpt">
<div class="excerpt__head">
<div class="excerpt__title">
<a class="link" href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</div>
</div>
<div class="search-result__body">
<div class="excerpt__body">
<?php echo the_excerpt() ?>
</div>
<div class="search-result__foot">
<p class="search-result__metadata">
<span class="search-result__icon">
<div class="excerpt__foot">
<p class="excerpt__metadata">
<span class="excerpt__icon">
<svg class="icon icon--extra-small" aria-hidden="true">
<use href="#icon-profile"></use>
</svg>
</span>
<span class="search-result__text"><?php echo $username ?></span>
<span class="search-result__icon">
<span class="excerpt__text"><?php echo $username ?></span>
<span class="excerpt__icon">
<svg class="icon icon--extra-small" aria-hidden="true">
<use href="#icon-calendar"></use>
</svg>
</span>
<span class="search-result__text"><?php echo $date ?></span>
<span class="excerpt__text"><?php echo $date ?></span>
</p>
</div>
</div>

77
theme/tag.php Normal file
View File

@@ -0,0 +1,77 @@
<?php get_header() ?>
<main class="page">
<section class="page__logo">
<?php get_template_part('partials/logo') ?>
</section>
<section class="page__content">
<div class="content">
<h1 class="title">
<span class="title__icon">
<svg class="icon icon--large" aria-hidden="true">
<use href="#icon-hash"></use>
</svg>
</span>
<span class="title__text">
<?php echo single_tag_title() ?>
</span>
</h1>
<ol>
<?php if (have_posts()): while (have_posts()) : the_post(); ?>
<?php $username = get_the_author_meta('nickname') ?>
<?php $date = get_the_date('jS F, Y', $id).' at '.get_the_date('H:i', $id) ?>
<li>
<div class="excerpt">
<div class="excerpt__head">
<div class="excerpt__title">
<a class="link" href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</div>
</div>
<div class="excerpt__body">
<?php echo the_excerpt() ?>
</div>
<div class="excerpt__foot">
<p class="excerpt__metadata">
<span class="excerpt__icon">
<svg class="icon icon--extra-small" aria-hidden="true">
<use href="#icon-profile"></use>
</svg>
</span>
<span class="excerpt__text"><?php echo $username ?></span>
<span class="excerpt__icon">
<svg class="icon icon--extra-small" aria-hidden="true">
<use href="#icon-calendar"></use>
</svg>
</span>
<span class="excerpt__text"><?php echo $date ?></span>
</p>
</div>
</div>
</li>
<?php endwhile; ?>
</ol>
</div>
</section>
<section class="page__pagination">
<?php get_template_part('partials/pagination') ?>
</section>
<?php else: ?>
<section class="page__article">
<article class="article">
<h1 class="article__title">Sorry, no results found.</h1>
<div class="article__content">
<a class="link" href="<?php echo get_site_url() ?>/">Go back home</a>
</div>
</article>
</section>
<?php endif; ?>
<section class="page__banner">
<?php get_template_part('partials/banner') ?>
</section>
<section class="page__footer">
<?php get_template_part('partials/footer') ?>
</section>
</main>
<?php get_template_part('partials/navigation') ?>
<?php get_footer() ?>