mh_featured_image

The MH Corporate basic mh featured image function.

Description

mh_featured_image(); 

Usage

  1. if ( !function_exists( 'mh_featured_image' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = mh_featured_image(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/functions.php  
  1. function mh_featured_image() { 
  2. global $page, $post; 
  3. if (has_post_thumbnail() && $page == '1') { 
  4. $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'content'); 
  5. $caption_text = get_post(get_post_thumbnail_id())->post_excerpt; 
  6. echo "\n" . '<div class="post-thumbnail">' . "\n"; 
  7. echo '<img src="' . $thumbnail[0] . '" alt="' . get_post_meta(get_post_thumbnail_id(), '_wp_attachment_image_alt', true) . '" title="' . get_post(get_post_thumbnail_id())->post_title . '" />' . "\n"; 
  8. if ($caption_text) { 
  9. echo '<span class="wp-caption-text">' . wp_kses_post($caption_text) . '</span>' . "\n"; 
  10. echo '</div>' . "\n";