Advertisement
imranmodel32

Video Post formate in feature image

Nov 21st, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. // Video Post formate  in feature image
  2.  
  3. function wpb_filter_featured_image_to_video( $html, $post_id = 0 ) {
  4.  
  5.   global $post;
  6.   if ( isset($post) && !empty($post) ) {
  7.     $x = get_post_meta( $post->ID, 'your_meta_field_id', true); // Here we need to call the metabox that contain the embed code
  8.     if (strlen($x) > 0)
  9.       return $x;
  10.   }
  11.  
  12.   return $html;
  13.  
  14. }
  15.  
  16. if (!is_admin())
  17. add_filter( 'post_thumbnail_html', 'wpb_filter_featured_image_to_video' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement