How to auto embedded youtube with wp_insert_post()

Youtube urls and other services that embed content in post content work via a feature called oEmbed. You need to use wp_oembed_get() to fetch the embedded content for this to work. In your case, you’re inserting content directly, so you probably don’t want to just call wp_oembed_get() and call it a day. That won’t work. … Read more

Add latest Youtube videos on main page [closed]

Thats more a youtube than a wordpress question. But you can write a simple shortcode function and add it to your site. // Add Shortcode function custom_youtubeapishortcode() { $playlistid = “XXXX”; $apikey = “XXXX”; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => “https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=”.$playlistid.”&maxResults=1&key=”.$apikey.””, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => “”, CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION … Read more

How to save post change url youtube link?

I think you want to change default video width. You can change default embed video width and height by embed_defaults filter. add_filter(’embed_defaults’, ‘ravs_embed_defaults’); function ravs_embed_defaults($embed_size) { if (is_single()) { // Conditionally set max height and width $embed_size[‘width’] = 640; $embed_size[‘height’] = 600; } else { // Default values $embed_size[‘width’] = 460; $embed_size[‘height’] = 600; } … Read more

Cannot embed YouTube videos “Failed to embed” error

This may be due to a failed network request from the server to youtube. If the server cannot reach YouTube, the embed will show as “failed to embed” in the editor. You can fix the problem by allowing the server to make network requests to youtube. The WordPress Proxy documentation may be helpful, https://developer.wordpress.org/reference/classes/wp_http_proxy/ WordPress … Read more

pass user id in slug and get user information

The code seems incomplete. Maybe the problem is simply that you define $id but then try to use $user_id? Also, I think id is a protected variable, so maybe use my_id instead. Try this: www.mysite.com/test?my_id=123 $user_id = $_REQUEST[‘my_id’]; $camp_link = get_site_url().”/campaign-detail/?id=”.$user_id; echo “<p class=”campaign_store_name”><a href=””.$camp_link.””>”.$camp_title.”</a></p>”; $arform_id = Get_ARFORM_ID_using_slug($camp_link);

Embed Youtube video link in wordpress editor

Try just pasting the YouTube URL in to the post or page in the text editor with-out embed code as an editor. See if that works never heard anyone having this problem… https://www.youtube.com/watch?v=VYmp9HmMYwU&t It’s super easy to embed videos, images, tweets, audio, and other content into your WordPress site. This feature was added in WordPress … Read more

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