Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Video Post formate in feature image
- function wpb_filter_featured_image_to_video( $html, $post_id = 0 ) {
- global $post;
- if ( isset($post) && !empty($post) ) {
- $x = get_post_meta( $post->ID, 'your_meta_field_id', true); // Here we need to call the metabox that contain the embed code
- if (strlen($x) > 0)
- return $x;
- }
- return $html;
- }
- if (!is_admin())
- add_filter( 'post_thumbnail_html', 'wpb_filter_featured_image_to_video' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement