Created
March 26, 2019 15:50
-
-
Save bacalj/fa3d1de2bc794e5010c1f43d554c8995 to your computer and use it in GitHub Desktop.
facet wp template code for outputting posts as foundation cards
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="cards-container"> | |
<?php while ( have_posts() ): the_post(); ?> | |
<div class="card"> | |
<?php the_post_thumbnail(); ?> | |
<div class="card-content"> | |
<h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4> | |
<?php | |
$tags = get_the_tags(); | |
if ($tags){ | |
foreach ($tags as $tag) { | |
global $wp; | |
$fwplink = home_url($wp->request) . '/?fwp_tags=' . $tag->slug; | |
echo '<a style="margin-right:1px" class="small button" href="'. $fwplink .'">'; | |
echo $tag->name; | |
echo '</a>'; | |
} | |
} | |
?> | |
<p> | |
<?php the_excerpt(); ?> | |
</p> | |
</div> | |
</div> | |
<?php endwhile; ?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment