Filter for wp_embed_handler_youtube not working

a little late, but it might be because this is a filter, and you’re adding it as an action, try add_filter( ‘wp_embed_handler_youtube’, ‘bigger_youtube_embeds’, 10, 4); function bigger_youtube_embeds($embed, $attr, $url, $rawattr) { // alter the $embed string… return $embed; }

display only youtube video sticky post

When you call get_the_content() some filters aren’t applied like they would with the_content() so if you want your content to be formatted you have to use the following: $my_content = apply_filters( ‘the_content’, get_the_content() ) If you want to extract the youtube video out of your content you’ll have to detect the youtube link with a … Read more

Add video tag to youtube link fron content

You can try doing this: $string = “Some text before the link http://www.youtube.com/?123 some text after the link”; preg_match_all(‘@(https?://www\.?youtube.com/.[^\s.,”\’]+)@i’, $string, $matches); var_dump($matches); In your case would be something similar to this: preg_match_all(‘@(https?://www\.?youtube.com/.[^\s.,”\’]+)@i’, $post->post_content, $matches); foreach($matches as $match){ echo “<video>$match</video>”; }

Widget to embed youtube video

In simple PHP,I am use this code : Url :have code that same as you genrate that appended at the end of url.I am work with core php. $url=”http://www.youtube.com/watch?v=fHBFvlQ3JGY”; preg_match( ‘/[\\?\\&]v=([^\\?\\&]+)/’, $url, $matches ); $id = $matches[1]; $width=”640″; $height=”385″; echo ‘<object width=”‘ . $width . ‘” height=”‘ . $height . ‘”><param name=”movie” value=”http://www.youtube.com/v/’ . $id … Read more

Order Posts By Youtube Views

https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters <ul> <?php $item=0; $attr = array( ‘post_type’ => ‘lyrics’, ‘date_query’ => array( array( ‘after’ => ‘1 month ago’ ) ), ‘post_status’=> ‘publish’, ‘meta_key’ => ‘youtube_views’, ‘orderby’ => ‘meta_value’, ‘order’ => ‘DESC’, ‘posts_per_page’ => 10 ); $loop = new WP_Query( $attr ); while ( $loop->have_posts() ) : $loop->the_post(); $song_name = get_the_title(); /*YOUTUBE QUERY HERE*/ // … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)