Different size video display for category page (smaller) & detail page (larger)

The best solution here is to use the built-in filter for embed parameters: <?php function mytheme_embed_defaults( $defaults ) { return array( ‘width’ => 100, ‘height’ => 100 ); } add_filter( ’embed_defaults’, ‘mytheme_embed_defaults’ ); ?> This code can be added to your theme’s functions.php file and you can change the numbers to reflect the sizes that … Read more

Pull Youtube Link from 2nd WP_Editor

Maybe you should just add a custom field to accept the url itself, in stead of the wp_editor textarea; then append the video embed after you work with the input. Let me know if you need any help setting that up. OR: You could add a separete textarea to accept just comma separated or line-break … Read more

Add class to oEmbed video from within post editor?

One idea for the shortcode version, would be to add the custom class via the the native shortcode: then you could add it to your custom wrapper with: add_filter( ’embed_oembed_html’, function ( $html, $url, $attr, $post_ID) { return sprintf( ‘<figure class=”video-container %s”>%s</figure>’, isset( $attr[‘class’] ) ? esc_attr( $attr[‘class’] ) : ”, $html ); }, 10, … Read more

Add parameter to first post only

Use the property current_post of a WP_Query object – it’ll be zero for the first post: if ( $wp_query->current_post === 0 ) // First post in main loop if ( $get_videos->current_post === 0 ) // First video in current videos loop

oEmbded with wp_insert_post() [embedly]

Read up on Embeds. To trigger an embed use wp_oembed_get($url). In general the url needs to be on it’s own line with a space below and above when inside the_content. wp_insert_post() has nothing to do with embeds as the embed HTML is usually generated when passed through the_content filter. To add support for non-oEmbed sites … Read more

What are available arguments for wp_oembed_get?

The whole idea of embedding is that you do not have control over how the embedded content is being styled and it is controlled by the server from which the content is embedded. The embedding server might allow some control over the embedded content via the URL parameters but to know how to achieve that … Read more

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