New answers tagged

0

Okay so I figured out what was happening - either the new theme or an unintentional wordpress update, lead to media links being handled differently. My new theme now only needs the URL - no shortcodes or iframes - and it seems to automatically process it to display how it used to display them. Only issue with this is that the old posts have to be edited to ...


0

Instead of do_shortcode you can use the run_shortcode function of $wp_embed global $wp_embed; $embed = $wp_embed->run_shortcode( '[embed]' . $url . '[/embed]' ); echo $embed;


0

Adding another way here. You can leave this to WordPress and just pass the URL from the_content filter. Example:- $adresgoeshere = 'URL of oembed providers' echo apply_filters('the_content', $adresgoeshere);


2

As you are using URLs from oEmbed provides (YouTube, Vimeo, Soundcloud, etc), I would use wp_oembed_get() function. This function uses oEmbed and tries to get the embed HTML of the provided URL. $embed = wp_oembed_get( $some_url ); if( $embed ) { echo $embed; } else { // The embed HTML couldn't be fetched }


0

Found a solution. Adding this code below to the functions.php file of your theme will do the trick. if ( ! isset( $content_width ) ) $content_width = YOUR WIDTH HERE;


2

I found that https://wordpress.org/plugins/pinterest-widgets actually has the needed functionality but doesn't mention it in the description. After installing and activating you can add a pinboard to a post by using the following shortcodes [pin_board url="http://www.pinterest.com/pinterest/pin-pets/"] [pin_board url="http://www.pinterest.com/pinterest/pin-...


0

Go to Pinterest site and open a pin which you want to embed on your post. Now you can find 3 dots near send button in the top of the pin. Click that dots and you can see "Embed" option. Now click that. Pinterest will give you 5 options to embed their content. Pin Profile Board Follow and Pin it button Based on your requirement, select the option and ...


4

I assume you're talking about embedding audio files, like: [embed]http://s.w.org/images/core/3.9/AintMisbehavin.mp3[/embed] The audio embed handler is registered within wp_maybe_load_embeds() and filtered through the wp_embed_handler_audio filter. So within WP_Embed::shortcode() this generates to: [audio src="http://s.w.org/images/core/3.9/...



Top 50 recent answers are included