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

30 lines
975 B
PHP
Raw Normal View History

2018-03-21 18:19:20 +00:00
<?php
/**
2021-01-09 11:13:06 +00:00
* The template part for displaying content.
*
* @package WordPress
* @subpackage Omphaloskepsis
* @since Omphaloskepsis 1.0
*/
2018-03-21 18:19:20 +00:00
?>
2021-01-09 11:13:06 +00:00
<a class="item" href="<?php echo ( $link = get_post_meta( get_the_ID(), 'External_Link', true ) ) ? $link : get_the_permalink(); ?>" <?php echo ( $link ) ? 'target="_blank"' : ''; ?>>
2018-03-21 18:19:20 +00:00
<article id="post-<?php the_ID(); ?>" class="tile col-m-6 col-4 col-w-3" style="background-image: url('<?php the_post_thumbnail_url(); ?>');">
2021-01-09 11:13:06 +00:00
<?php
if ( strlen( get_the_title() ) > 70 ) {
$small = 'vsmall';
} elseif ( strlen( get_the_title() ) > 35 ) {
$small = 'small';
} elseif ( strlen( get_the_title() ) > 12 ) {
$small = 'qsmall';
}
?>
<header>
<h1 class="<?php echo $small; ?> post-title"><?php echo get_the_title(); ?></h1>
<?php if ( $subtitle = get_post_meta( get_the_ID(), 'Subtitle', true ) ) : ?>
<h2><?php echo $subtitle; ?></h2>
<?php endif; ?>
</header>
2018-03-21 18:19:20 +00:00
</article><!-- #post-## -->
2021-01-09 11:13:06 +00:00
</a>