This repository has been archived on 2022-08-01. You can view files and clone it, but cannot push or open issues or pull requests.
Oldphaloskepsis/template-parts/content.php

28 lines
931 B
PHP
Raw Normal View History

2017-01-12 23:10:07 +00:00
<?php
/**
* The template part for displaying content
*
* @package WordPress
* @subpackage Ben_Goldsworthy
* @since Ben Goldsworthy 1.0
*/
?>
2017-01-12 23:13:02 +00:00
<div class="col-m-6 col-4 col-w-3">
2017-01-12 23:10:07 +00:00
<a href="<?php the_permalink(); ?>">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> style="background-image: url('<?php the_post_thumbnail_url(); ?>');">
<header class="entry-header">
<?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>
<span class="sticky-post"><?php _e( 'Featured', 'bengoldsworthy' ); ?></span>
<?php endif; ?>
<?php
2017-01-12 23:13:02 +00:00
if (strlen(get_the_title()) > 70) $small= "vsmall";
elseif (strlen(get_the_title()) > 35) $small = "small";
the_title( '<h2 class="post-title '.$small.'">', '</h2>' );
2017-01-12 23:10:07 +00:00
?>
</header><!-- .entry-header -->
</article><!-- #post-## -->
</a>
</div>