2
get_post() 함수를 사용하여 특정 게시물 내용을 가져옵니다. 그러나 자동으로 비디오를 실행할 수는 없습니다.get_post() 함수를 사용하여 embed youtube 비디오를 자동으로 활성화하십시오.
여기에 코드
<?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;
?>
나는 그것이 자동 유튜브 링크를 감지하고 동영상 삽입을 가능하게하려는에게 있습니다. 샘플 콘텐츠 나는이에게 자신을 시도하지 않은
Check out this cool video:
http://www.youtube.com/watch?v=nTDNLUzjkpg
That was a cool video.
http://codex.wordpress.org/Function_Reference/get_post
http://codex.wordpress.org/Embeds
답변 해 주셔서 감사합니다. oEmbed는 get_posts() 또는 query_posts()를 사용하여 작동하지 않습니다. 그러나 query_posts()로 Smart Youtube Plugin 작업을 할 수 있습니다. – YNhat