wordpress the_content not showing video

I am developing a separate website and for showing the blogs i am using the worpress.I have used following code to display blogs.It shows the textual contents properly but for video it just shows the player bar and not click able.

I have also checked themes index.php there is no the_excerpt.

Read More

When i check preview of the post using wordpress admin it shows the video properly.

can anyone help me resolve this?

here is my code..

<?php
global $more;
$posts = get_posts('category=3&numberposts=10&order=ASC&orderby=post_title');
foreach ($posts as $post) : setup_postdata( $post ); ?>
<?php $more = 1; ?>
<?php the_date(); echo "<br />"; ?>
<span style="color:#1C1644;font-size:1.3em !important;font-weight: bold;">
<?php the_title(); ?> 
</span>   
<div id="lol"><?php the_content(); ?>
</div>
<hr>
<?php
endforeach;
?>

Related posts

Leave a Reply

3 comments

  1. Please try this

    <?php
    global $more;
    $posts = get_posts('category=3&numberposts=10&order=ASC&orderby=post_title');
       foreach ($posts as $post) : 
       setup_postdata( $post ); ?>
         <?php $more = 1; ?>
         <?php the_date(); echo "<br />"; ?>
         <span style="color:#1C1644;font-size:1.3em !important;font-weight: bold;">
            <?php echo the_title(); ?> 
         </span>   
         <div id="lol">
            <?php echo the_content(); ?>
         </div>
         <hr>
         <?php
       endforeach;
    ?>
    
  2. All you need to do to embed something into a post or page is to post the URL to it into your content area. Make sure that the URL is on its own line and not hyper-linked (clickable when viewing the post).

    For example:

    http://www.youtube.com/watch?v=dQw4w9WgXcQ

    WordPress will automatically turn that into a YouTube embed when the post is viewed.

    You can also optionally wrap the URL in the [embed] shortcode. It will accomplish the same effect, but does not require the URL to be on its own line.

    It also allows you to set a maximum (but not fixed) width and height, like so:

    [embed width="123" height="456"]http://www.youtube.com/watch?v=dQw4w9WgXcQ[/embed]

    If WordPress fails to embed your URL you will get a hyper-link to the URL.

  3. Use wp custom fields. Add video_embed custom field your post and add code.

    <?php echo get_post_meta($post->ID, 'video_embed', true); ?>
    

    Edit:

    if(get_post_meta($post->ID, 'video_embed', true)){
        echo get_post_meta($post->ID, 'video_embed', true);
    }
    else
    {
        the_content();
    }