function featured_post_image()
{
    if (has_post_thumbnail()) {
        if (is_singular()) {
            ?>
            <?php 
            if (ucinews_is_featured_portrait()) {
                ?>
                <div class="uci-post-image-portrait">
                    <?php 
                the_post_thumbnail();
                ?>
                </div>
            <?php 
            } else {
                ?>
                <div class="uci-post-image-landscape">
                <?php 
                the_post_thumbnail();
                ?>
                </div>
            <?php 
            }
            ?>

        <?php 
        } else {
            ?>
            <?php 
            if (ucinews_is_featured_portrait()) {
                ?>
                <div class="uci-post-image-portrait">
                    <a href="<?php 
                the_permalink();
                ?>
" aria-hidden="true">
                        <?php 
                the_post_thumbnail('post-thumbnail', array('alt' => get_the_title()));
                ?>
                    </a>
                </div>
            <?php 
            } else {
                ?>
                <div class="uci-post-image-landscape">
                    <a href="<?php 
                the_permalink();
                ?>
" aria-hidden="true">
                        <?php 
                the_post_thumbnail('post-thumbnail', array('alt' => get_the_title()));
                ?>
                    </a>
                </div>
            <?php 
            }
        }
    }
}
Пример #2
0
/**
 * Content Template is used for every post format and used on single posts
 */
// post has review?
$review = Bunyad::posts()->meta('reviews');
?>
<article id="post-<?php 
the_ID();
?>
" class="<?php 
// hreview has to be first class because of rich snippet classes limit
echo ($review ? 'hreview ' : '') . join(' ', get_post_class());
?>
" itemscope itemtype="http://schema.org/Article">
	<?php 
$portraitImage = ucinews_is_featured_portrait();
if ($portraitImage) {
    echo "<div class='post-header cf portrait-header'>";
} else {
    echo "<div class='post-header cf'>";
}
?>


	<?php 
if (!Bunyad::posts()->meta('featured_disable')) {
    ?>
		<div class="featured">
			<?php 
    if (has_post_thumbnail()) {
        ?>