Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9017483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:17:09+00:00 2026-06-16T04:17:09+00:00

Currently in WordPress 3.5 when you create a new post you can simply paste

  • 0

Currently in WordPress 3.5 when you create a new post you can simply paste in a YouTube URL and on the live post this gets converted into an embedded video. This is working great for me within WordPress, however I’m pulling the wordpress post into my non-WP site using get_post and the URL comes over instead of embedded video.

I’m trying to determine the best method to make any YouTube video link that is found in the content of a post, show as embedded video.

Not sure if there is a function I can borrow from WordPress on my page (and how I would do that) or if need to parse the content somehow with PHP to find video links. Not sure how to do that either, given that each video is going to have a different url parameter at the end such as: http://www.youtube.com/watch?v=abcdefghijk

Any thoughts on this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:17:10+00:00Added an answer on June 16, 2026 at 4:17 am

    I stumbled across this function:

        function get_string_between($string, $start, $end){
        $string = " ".$string;
        $ini = strpos($string,$start);
        if ($ini == 0) return "";
        $ini += strlen($start);   
        $len = strpos($string,$end,$ini) - $ini;
        return substr($string,$ini,$len);
    }
    
    $fullstring = "this is my [tag]dog[/tag]";
    $parsed = get_string_between($fullstring, "[tag]", "[/tag]");
    
    echo $parsed; // (result = dog)
    

    I used this as a basis to write an advanced search and replace. this may have been doable with REGEX, I’m not sure, but this has served the purpose. Thanks all!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my Wordpress Blog I'm currently using an integrated http://U.nu url-shortener. For this I've
I'm currently studying WordPress and want to create a custom Post Type and have
I'm currently into studying wordpress files structure. Which PHP file or PHP files are
Curious if anyone can help me on this. I am using WooThemes to create
I am currently working on a Wordpress site I have created some custom Post
I am new to Wordpress (using roughly 6 months) and just now getting into
I am having a CRAZY error with Wordpress. When I create a new article
I'm currently integrating information from a third party API into a wordpress site. What
I am using wordpress to create blog similar to stackoverflow.com where users can ask
I'm working on a WordPress theme and have JS for live filtering post results

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.