Don’t know if this is your only issue, but you’re using the_title()
to build your URI. This ECHOS the title, which is not what you want.
Instead, you should be using get_the_title().
I’d also urlencode the title, as Jan suggested.
Your best bet is to print out the YouTube URI after you build it, then try to hit it in a browser. If the results aren’t right, the problem is with your URI.
Related Posts:
- Setting a post’s featured image from an embedded YouTube video
- Do_Shortcode not working for Embed
- Return $post_id when DOING_AUTOSAVE?
- Implementing “Video of the Day” Feature?
- Including Angle Brackets In Pre Sections
- Set wmode attribute to transparent for the embed shortcode to make drop-down menu hover over YouTube embed in Internet Explorer
- Anchor Text code string is automatically modified by WordPress
- WordPress is converting & to & inbetween [code] brackets
- Notice: Undefined property: wpdb::$current_post What can be wrong?
- Where to save common libraries?
- source code: WP_INSTALLING vs. WP_SETUP_CONFIG in setup-config.php
- Sublime Video: Playlist which gets all attached videos
- Code Friendly Block Quotes
- Remove line breaks from ?
- How to fix a “globals” issue to avoid a rejected theme?
- Embed YouTube video from custom field value
- Need resource on available functions and objects
- WordPress wp_insert_post() returns 0 but not not wp_error
- I want to remove the home page header image from all other pages
- Video Embed with Captions in Turkish
- Lightbox Plus ColorBox plugin and auto playing YouTube video
- How to import my YouTube channel into WordPress?
- Proper implementation/use of code/syntax highlighting
- How to remove all comments from JS, HTML, CSS files?
- How to auto embedded youtube with wp_insert_post()
- oEmbed not working in WordPress
- What data validation we must use in different contexts?
- Need To Post Unformated Code
- Sidebar login: How do I get the username to show after “Welcome”?
- YouTube Sidebar Widget – YouTube service unavailable
- How to manage multiple wordpress project with shared code base
- Block IP Addresses using Code [closed]
- videos not showing on my tag pages
- Find Total Authors
- Why does HTML entities are still encoded in Code Block?
- How to create a checkbox to show/hide a field in WooCommerce checkout [closed]
- how to display google maps with javascript
- How to pass https://achecker.ca/ validator? [closed]
- How to write custom code on WordPress?
- Remove Metaboxes
- Looking to Customize YouTube Video Embeds
- Google analytics won’t work in wordpress
- Where do I add an action hook & callback in my theme?
- How do I reset my footer.php to its original state? (theme: Origami)
- Commenting out in HTML editor breaks template
- wordpress prepare error
- Adding code to send referrer on login page
- Table styles disappear when updating content
- Manage recurring event time
- wp_editor save all content
- Need an elegant solution to declare the value of two variables based on the count of the post
- How to insert integration code for CRM?
- You tube videos Appear Different Dimension
- A good way to include snippets of code in both posts, pages and Event Manager Template files?
- Anchor Text code string is automatically modified by WordPress
- Return $post_id when DOING_AUTOSAVE?
- Choopy Video Playback in a popup using Artiss Youtube Embed [closed]
- Can someone please help me find a solution to my youtube embed problems? [duplicate]
- Changes in code only show after changing theme
- Code Highlighting in BlockQuote
- Fetching Video From YouTube Automatically [closed]
- Where do I go to add a tag before the closing body tag?
- Embedding a custom live chat (gen. from Salesforce) into my WordPress header
- How do I get a YouTube video thumbnail from the YouTube API?
- YouTube Autoplay not working
- YouTube: How to extract closed caption transcript from YouTube video?
- Is there a way to get all IP addresses of youtube to block it with Windows Firewall?
- YouTube maxresdefault thumbnails
- Youtube – downloading a playlist – youtube-dl
- ‘NoneType’ object has no attribute ‘group’
- How do I get a YouTube video thumbnail from the YouTube API?
- Youtube api – stop video
- Youtube_dl : ERROR : YouTube said: Unable to extract video data
- How do I hide related videos at the end of a YouTube playlist embed code?
- URL syntax for Youtube video in fullscreen and start at time index
- Disable play/pause/full screen for HTML5
- Failed to execute ‘postMessage’ on ‘DOMWindow’: https://www.youtube.com !== http://localhost:9000
- How to embed a youtube playlist with a sidebar
- YouTube: How to present embed video with sound muted
- How to customize an end time for a YouTube video?
- How to embed an autoplaying YouTube video in an iframe?
- How can I embed a YouTube video in a WordPress template page?
- How to display SQL query that ran in query?
- Best collection of code for your .htaccess file [closed]
- Generating Thumbnails for video
- What is the meaning of %s, %1$s etc.? [closed]
- Upload Multiple Files With media_handle_upload
- Use [embed] filter in template files
- WordPress Internal @ Mentions
- How do I embed youtube videos with https instead of http in the URL?
- Include WP_Query in my own PHP file?
- How to get a variable number of posts per post type on the main loop?
- What is this code in my theme’s functions.php? if (isset($_REQUEST[‘action’]) && isset($_REQUEST[‘password’])
- Get first video from the post (both embed and video shortcodes)
- What theme is good for posting code? [closed]
- Replace audio/video enclosure with player?
- How can I clear oEmbed caches for YouTube on posts as they are loaded
- How add class youtube and type/html to oembed code?
- Create custom [sourcecode] shortcode, the right way?
- How to Replace YouTube Videos with a “Click to Play” Thumbnail?