Exemplo n.º 1
0
/**
 * Layout functions
 */
function stachestack_content_width_px($echo = false)
{
    _stachestack_deprecated_function(__FUNCTION__, '3.2', 'StacheStack_Layout::content_width_px()');
    return StacheStack_Layout::content_width_px($echo);
}
 function featured_image()
 {
     global $ss_framework, $ss_settings;
     $data = array();
     if (!has_post_thumbnail() || '' == get_the_post_thumbnail()) {
         return;
     }
     $data['width'] = StacheStack_Layout::content_width_px();
     if (is_singular()) {
         // Do not process if we don't want images on single posts
         if ($ss_settings['feat_img_post'] != 1) {
             return;
         }
         $data['url'] = wp_get_attachment_url(get_post_thumbnail_id());
         if ($ss_settings['feat_img_post_custom_toggle'] == 1) {
             $data['width'] = $ss_settings['feat_img_post_width'];
         }
         $data['height'] = $ss_settings['feat_img_post_height'];
     } else {
         // Do not process if we don't want images on post archives
         if ($ss_settings['feat_img_archive'] != 1) {
             return;
         }
         $data['url'] = wp_get_attachment_url(get_post_thumbnail_id());
         if ($ss_settings['feat_img_archive_custom_toggle'] == 1) {
             $data['width'] = $ss_settings['feat_img_archive_width'];
         }
         $data['height'] = $ss_settings['feat_img_archive_height'];
     }
     $image = StacheStack_Image::image_resize($data);
     echo $ss_framework->clearfix() . '<a href="' . get_permalink() . '"><img class="featured-image ' . $ss_framework->float_class('left') . '" src="' . $image['url'] . '" /></a>';
 }