Embedding Youtube video on comments

Just add the comments to oEmbed. Here’s a small plugin that you can use as MU-Plugin or normal plugin and that should explain what’s going on pretty well. <?php defined( ‘ABSPATH’ ) or exit; /* Plugin Name: (#105942) oEmbed Comments */ add_filter( ‘comment_text’, ‘wpse_105942_oembed_comments’, 0 ); function wpse_105942_oembed_comments( $comment ) { add_filter( ’embed_oembed_discover’, ‘__return_false’, 999 … Read more

Div around YouTube video

I’m not sure why that’s not working except maybe you need to put the returned stuff in a variable? This is what works for me when I put it in my functions.php file: add_filter( ’embed_oembed_html’, ‘tdd_oembed_filter’, 10, 4 ) ; function tdd_oembed_filter($html, $url, $attr, $post_ID) { $return = ‘<figure class=”video-container”>’.$html.'</figure>’; return $return; }

How to make my new theme read [youtube id=”id of the video here” width=”600″ height=”350″]?

You can for example: Copy the YouTube shortcode from the old theme to your new theme. Locate the line (most likely in the functions.php file): add_shortcode( ‘youtube’, ‘some_function’ ); and copy this line and the some_function() to your functions.php in your new theme or better yet – create a new plugin file including: /*Plugin Name: … Read more

How To Display Content from a website on wordpress page?

Although CURL requests will work, you should use wp_remote_post() to do requests to external pages, especially if you are writing a plugin or theme. (Plugin review doesn’t like CURL requests; they will ask you to convert to wp_remote_post(). See https://codex.wordpress.org/Function_Reference/wp_remote_post . The return value includes the header and all content of the request. You can … Read more

How to Implement Responsive YouTube Video Framing? [closed]

Make the media query for <iframe> responsive. Set an id to <iframe>and set max-width and min-width, and give specific size to this <iframe> on different device widths. CSS: <style> @media screen and (max-width: 400px) { #res{ width:200px; height:200px; } } </style> HTML: <iframe id=”res” src=”https://www.youtube.com/embed/rL66iCVZ6mE?rel=0&amp;controls=0&amp;showinfo=0″ frameborder=”0″ allowfullscreen></iframe>`

Embedding custom posts with REST API

Your endpoint is wrong, /wp/v2/posts is just for objects with post_type=”post”. If your custom post type is registered with ‘activity-api’ the endpoint would be /wp/v2/activity-api/11. That’s because it’s the slug you registered in ‘rest_base’ => ‘activity-api’ argument to your post type. Without a custom rest_base argument, the endpoint would be at /wp/v2/st_activity

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