Skip to content

Instantly share code, notes, and snippets.

@beaverbuilder
Last active June 28, 2024 17:18
Show Gist options
  • Save beaverbuilder/d6830e30fda195d8b8c48b7fda7f1647 to your computer and use it in GitHub Desktop.
Save beaverbuilder/d6830e30fda195d8b8c48b7fda7f1647 to your computer and use it in GitHub Desktop.
This snippet is used on the following knowledge base article - http://kb.wpbeaverbuilder.com/article/577-create-a-card-layout-for-posts-themer
[wpbb-if post:featured_image]
<a class="post-card-image-link" href="[wpbb post:url]">
<div class="post-card-image" style="background-image: url([wpbb post:featured_image size='full' display='url']);"></div>
</a>
<div class="post-card-content">
<a class="post-card-content-link" href="[wpbb post:url]">
<header class="post-card-header">
<span class="post-card-category">[wpbb post:terms_list taxonomy='category' separator=', ' linked='no']</span>
<h2 class="post-card-title">[wpbb post:title]</h2>
</header>
<section class="post-card-excerpt">
[wpbb post:excerpt length='12' more='']
</section>
</a>
</div>
[wpbb-else]
<div class="post-card-content">
<a class="post-card-content-link" href="[wpbb post:url]">
<header class="post-card-header">
<span class="post-card-category">[wpbb post:terms_list taxonomy='category' separator=', ' linked='no']</span>
<h2 class="post-card-title">[wpbb post:title]</h2>
</header>
<section class="post-card-excerpt">
[wpbb post:excerpt length='46' more='']
</section>
</a>
</div>
[/wpbb-if]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment