• hi, I’m trying to set my theme to check if the post has a video or not if yes create a thumbnail of the video or a small version of the first video in my post and use it as a thumbnail that i can play the video even if i didn’t open the post. if the post doesn’t have any video use the post feature image as thumbnail.

    ANY HELP???

Viewing 1 replies (of 1 total)
  • Thread Starter Mahmud Hamid

    (@joun007)

    after searching i found this:

    <?php if ( get_post_meta($post->ID, "_videoembed", true) || get_post_meta($post->ID, "_videoembed_manual", true) ) { ?>
    <div class="video"></div>
    <?php } else if ( has_post_thumbnail($thumbnail->ID) ) {
    echo '<a href="' . get_permalink( $thumbnail->ID ) . '" title="' . esc_attr( $thumbnail->post_title ) . '">';
    echo get_the_post_thumbnail($thumbnail->ID, 'medium' );
    echo '</a>';?>
    <?php } else { ?>
    <a href="<?php the_permalink() ?>"><img src="<?php bloginfo('template_url'); ?>/images/an.png" alt="" /></a>
    <?php } ?>

    now what should i add in the <div class=”video”></div> so it display the video????

Viewing 1 replies (of 1 total)
  • The topic ‘if post has video use it as thumbnail’ is closed to new replies.