Created
February 26, 2020 02:21
-
-
Save dospuntocero/b9c82c5c86a1d302d8c758fd7806d83a to your computer and use it in GitHub Desktop.
cutting the title and content for showing even smaller excerpts they they dont fit in the design
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="cell medium-4"> | |
<div class="media__teaser"> | |
<p class="media__teaser--type"> | |
<?php echo get_the_category()[0]->name; ?> | |
</p> | |
<div class="media__teaser--title"> | |
<?php echo mb_strimwidth(get_the_title(), 0, 50, '...'); ?> | |
</div> | |
<div class="media__teaser--img" style="background-image: url(<?php echo get_the_post_thumbnail_url(); ?>);"> | |
<div class="media__teaser--date"> | |
<p class="month"><?php echo get_the_date( 'M' );?></p> | |
<p class="day"><?php echo get_the_date( 'D' );?></p> | |
<p class="year"><?php echo get_the_date( 'j' );?></p> | |
</div> | |
</div> | |
<div class="media__teaser--excerpt"> | |
<?php echo mb_strimwidth(get_the_excerpt(), 0, 200, '...'); ?> | |
</div> | |
<a class="button button__white" href="<?php the_permalink(); ?>">learn more</a> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment