Lazy Load iframes
-
Uncaught TypeError: $ is not a function?
at 49660769-1489694389.js:42
at 49660769-1489694389.js:314I am also using this function to load the iframe on my post format. What filter do you recommend so that your plugin works?
/*
Iframe function loading
*/function thirty_eight_get_embedded_media( $type = array() ){
$content = do_shortcode( apply_filters( ‘the_content’, get_the_content() ) );
$embed = get_media_embedded_in_content( $content, $type );
if( in_array( ‘audio’, $type ) ){
$output = str_replace( ‘?visual=true’, ‘?visual=false’, $embed[0] );
} else {
$output = $embed[0];
}return $output;
}
echo thirty_eight_get_embedded_media( array( ‘video’, ‘iframe’) );
Thanks for the help
- The topic ‘Lazy Load iframes’ is closed to new replies.