• I’ve been running this for some time. It might be a 3.5.1 issue or something I missed.

    however when I run

    <?php tern_wp_youtube_video($e=true); } ?>

    it puts a youtube player on every single post regardless of whether there is a value for the YouTube ID: or any of the other fields for the array $tern_wp_youtube_fields

    How can I set it to only show a video player when a given youtube post has a youtube video set using the admin fields created by this plugin?

    Ergo I have some posts that have no videos what so ever and they are not supposed to, but when I run this plugin is pulls in a null value for a youtube video and shows a box anyway

    <iframe title="YouTube video player" width="380" height="280" src="http://www.youtube.com/embed/?rel=0" frameborder="0" allowfullscreen="" allowtransparency="true"></iframe>

    Seems like I need some type of if else statement, however I suspect the $e=true is trumping all of my efforts?
    Tried the following no luck:

    <?php /* if there is a video loaded in post show it otherwise do not show it */
    	if(!empty($_tern_wp_youtube_video)) {
    		tern_wp_youtube_video($e=true); } ?>
    if(!$_tern_wp_youtube_video) {
    		return; }
    		else {
    		tern_wp_youtube_video($e=true); } ?>

    http://wordpress.org/extend/plugins/automatic-youtube-video-posts/

Viewing 1 replies (of 1 total)
  • Plugin Author ternstyle

    (@mpraetzel)

    You’ll want to check if the video exists first by looking for the video ID in post meta:

    <?php $video = get_post_meta($post->ID,'_tern_wp_youtube_video',true); ?>

Viewing 1 replies (of 1 total)
  • The topic ‘How to Set it to show only on Posts with Videos’ is closed to new replies.