Why this code is not working
-
function video() { echo '<h3>Featured Video</h3>'; query_posts(array('category_name' => 'videopost','showposts' => 1)); if (have_posts()) : while (have_posts()) : the_post(); $dn = get_post_meta($post->ID, "video", TRUE); //the_excerpt(''); echo "<iframe width=\"300\" height=\"300\" src=\"http://www.youtube.com/embed/".$dn."\" frameborder=\"0\" allowfullscreen></iframe>"; endwhile; endif; wp_reset_query(); }I am not able to extract post meta data through this code. Though the same code is working fine in single.php file and able to extract the video meta data from the same post.
The topic ‘Why this code is not working’ is closed to new replies.