Pregunta

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.

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top