Skip to content

Instantly share code, notes, and snippets.

@fergbrain
Created April 6, 2012 05:47
Show Gist options
  • Save fergbrain/2317389 to your computer and use it in GitHub Desktop.
Save fergbrain/2317389 to your computer and use it in GitHub Desktop.
Display alternate thumbnail
<?php
include(CFCT_PATH.'header/featured/init.php');
if($image === ''){
global $post;
if(get_post_meta($post->ID, 'wp_thumbnail', TRUE)){
$class[] = 'has-featured-img';
$class = implode(' ', $class);
$image = '<img src="' . get_post_meta($post->ID, 'wp_thumbnail', TRUE) . '" class="featured-img" />';
}
elseif(preg_match('/\[flickr\]([0-9]+)\[\/flickr\]/i', $post->post_content, $match)){
$class[] = 'has-featured-img';
$class = implode(' ', $class);
$image = '<img src="' . fergcorp_flickrShortcode_buildPhotoURL($match[1], "small 320") . '" class="featured-img" />';
}
}
?>
<article id="featured-post-<?php echo $slot; ?>" class="featured <?php echo $class; ?>">
<?php echo $image; ?>
<div class="featured-content">
<span class="featured-format"></span>
<h1 class="featured-title"><?php the_title(); ?></h1>
<div class="featured-description">
<?php echo cf_trim_text(get_the_excerpt(), 150, "<p>", "&hellip;</p>"); ?>
</div>
</div>
<a href="<?php the_permalink(); ?>" class="featured-link"><?php _e('Read More', 'favepersonal'); ?></a>
</article><!-- .featured -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment