How to load post_meta for custom post type via Ajax
How to load post_meta for custom post type via Ajax
How to load post_meta for custom post type via Ajax
How to make Youtube short code transfer
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; }
Each video can have different aspet ratio, that is totally normal. Normally, the theme set a global $contnt_width to set the max width for embeded content and the height is auto. For exampl: if ( ! isset( $content_width ) ) { $content_width = 700; } If you need to set a specific width and height … Read more
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
Youtube Iframe Api play one video at a time
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>”; }
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
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
Well I found the culprit, no solution yet though. As I said the code ran well on a static HTML page, so I copied the exact static HTML into my theme, leaving all the rest out, and it didn’t work. So it had to be WordPress related, so I turned off installed plugins one by … Read more