function jhp_get_main_image_id($post = null)
{
    _deprecated_function(__FUNCTION__, '0.9.8', 'hmp_get_main_image_id()');
    return hmp_get_main_image_id($post);
}
Example #2
0
/**
*
*	Returns Main <img>
*
*/
function hmp_get_the_main_image($post_id = null, $width_or_size = 'full', $h = 0, $crop = false)
{
    if ($post_id === null) {
        $post_id = get_the_ID();
    }
    if (!is_numeric($post_id)) {
        $post_id = $post_id->ID;
    }
    $attachment_id = hmp_get_main_image_id($post_id);
    if (!$attachment_id) {
        return null;
    }
    $crop = $crop ? '1' : '0';
    if (is_numeric($width_or_size)) {
        return wp_get_attachment_image($attachment_id, "width={$width_or_size}&height={$h}&crop={$crop}");
    } else {
        return wp_get_attachment_image($attachment_id, $width_or_size);
    }
}