Skip to content

Instantly share code, notes, and snippets.

@wiesmann
Created March 9, 2015 07:47

Revisions

  1. wiesmann created this gist Mar 9, 2015.
    36 changes: 36 additions & 0 deletions gistfile1.phtml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    <?php
    /**
    * @package Sixteen
    */
    ?>

    <div class="article-wrapper">
    <article id="post-<?php the_ID(); ?>" <?php post_class('homepage-article'); ?>>


    <div class="featured-image">
    <?php if (has_post_thumbnail()) : ?>
    <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('homepage-thumb'); ?></a>
    <?php else: ?>
    <a href="<?php the_permalink(); ?>"><img src="<?php echo get_stylesheet_directory_uri()."/images/dthumb.jpg"; ?>"></a>
    <?php endif; ?>
    </div>

    <header class="entry-header">

    <?php
    if (mb_strwidth(get_the_title()) >= 85) { ?>
    <h1 class="entry-title"><a href="<?php the_permalink(); ?>" data-title="<?php the_title(); ?>" rel="bookmark">
    <?php echo mb_strimwidth(get_the_title(), 0, 84)."";
    }

    else { ?>
    <h1 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark">
    <?php the_title();
    }
    ?>
    </a></h1>
    </header><!-- .entry-header -->

    </article><!-- #post-## -->
    </div>