문제

I'm trying to use this code to ask if the post is a video if so it would add the video meta-tags needed to display a playable video on facebook. The result is that it dosnt call the_content(); an example post from my site: http://associate.graymafia.com/old-spice-remix/

<?php if( get_post_format() == 'video' ) {
echo '<meta property="og:video" content="';
the_content();
echo '" />'; 
echo        '<meta property="og:video:height" content="640" />';
echo        '<meta property="og:video:width" content="385" />';
echo        '<meta property="og:video:type" content="application/x-shockwave-flash" />';


} else {


} ?>

The content is just the url of the video.

도움이 되었습니까?

해결책

the_content() is a WordPress core function and is used to echo out the whole HTML of the post, and can only be used inside the loop. What you want in your og:video meta tag instead is your video's URL. If you have defined your own function the_content() then you just need to rename it.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top