I personally use get_publish() function to obtain a specific publish content. However, I am unable to result in the auto embed video runs.
This is actually the code
<?php $post_id = 110; $queried_post = get_post($post_id); $content = $queried_post->post_content; $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); echo $content; ?>
I would like it auto identify the youtube link and let the embed video. The sample submissions are
Check out this cool video: http://www.youtube.com/watch?v=nTDNLUzjkpg That was a cool video.
I've not attempted this myself, but this is exactly what I will tell you:
- The oEmbed functionality is used in wordpress with a filter.
- The get_posts() function inhibits filters automatically and that i guess
get_post()does exactly the same, although I wasn't in a position to verify this within the documentation.
Possibly you should use query_posts() (which does not suppress filters) or
suppress_filters=>false to check this.