Undefined notice on unset field
The error is that you’re trying to read $value[‘kk_youtube’] when there is no kk_youtube key in the array (undefined index). Rather than use isset, use get_post_meta with the third argument “single” true: $youtube_link = esc_attr( get_post_meta( $post->ID, ‘kk_youtube’, true ) ); This is effectively the same as doing: $value = get_post_custom( $post->ID ); if ( … Read more