WordPress.org

Ready to get started?Download WordPress

Forums

Automatic Youtube Video Posts Plugin
Thumbnail question (10 posts)

  1. anotherwpguy
    Member
    Posted 2 years ago #

    I think many people had this question about having thumbnails for posts and I did not find an answer except the documentation shows exactly this in the readme.txt
    "Add the following code wherever you'd like the image to appear: `<?php tern_wp_youtube_image(); ?>"
    I would appreciate if someone can help me with where exactly is this wherever? which .php file, because there are 20 php fles in this plugin. Please help me
    Also, even though I set not to post automatically, it seems like the videos are automatically added to my site. Any help with this will also be appreciated. I really tried looking for answers to my questions online for 2 days before posting the question.

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

  2. designofka
    Member
    Posted 2 years ago #

    Hey Anothewpguy,

    When they say:
    "Add the following code wherever you'd like the image to appear: `<?php tern_wp_youtube_image(); ?>"

    they are refering to the files used to create your index. This is the code I have for the index.php on one of the sites I run:

    ...
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post();?>

    <div <?php post_class() ?>>

    <div class="post-thumb">
    <?php tern_wp_youtube_image(); ?>
    </div>

    <h2>"><?php the_title(); ?></h2>

    <div class="meta">
    <?php echo getPostViews(get_the_ID()); ?>
    </div>
    </div>
    ...

    What this is basically doing is adding the youtube video thumbnail to wherever you would like to be. CSS can be used to style its position.

    I'd like to thank you by the way as this post saved me a lot of hassle. I didn't bother checking the readme.txt when using the plugin.

  3. anotherwpguy
    Member
    Posted 2 years ago #

    Hi Thank your responding. I have tried to insert the code but no luck, I am sorry to troubling you more but can you please tell me where exactly in the following code I would insert it.
    <?php unset($img);
    if ( current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail() ) {
    $thumbURL = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), '' );
    $img = $thumbURL[0]; }
    else {
    unset($img);
    if ($wpzoom_cf_use == 'Yes') { $img = get_post_meta($post->ID, $wpzoom_cf_photo, true); }
    else {
    if (!$img) { $img = catch_that_image($post->ID); } }
    }
    if ($img) { $img = wpzoom_wpmu($img); ?>
    <div class="thumb">" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo $img ?>&w=130&h=90&zc=1" alt="<?php the_title(); ?>" /> </div><?php } ?>

    again, thank you for the response

  4. designofka
    Member
    Posted 2 years ago #

    I haven't seen this kind of coding before but if I were to try and attempt to get it to work i'd try inserting it here:

    ...
    $thumbURL = wp_get_attachment_image_src( <?php tern_wp_youtube_image(); ?>, '' );
    ...

    Not sure if this will help. Also not sure if the " at the end of that code is necessary/causing a problem. I might be wrong.

    Tell me how it goes.

  5. anotherwpguy
    Member
    Posted 2 years ago #

    Thanks for the tip but it dint work, I will keep trying but again thanks for your help.

  6. mpraetzel
    Member
    Plugin Author

    Posted 2 years ago #

    Try this:

    <?php unset($img);
    if(get_post_meta($post->ID,'_tern_wp_youtube_video',true)) {
    tern_wp_youtube_image();
    }
    elseif ( current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail() ) {
    $thumbURL = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), '' );
    $img = $thumbURL[0]; }
    else {
    unset($img);
    if ($wpzoom_cf_use == 'Yes') { $img = get_post_meta($post->ID, $wpzoom_cf_photo, true); }
    else {
    if (!$img) { $img = catch_that_image($post->ID); } }
    }
    if ($img) { $img = wpzoom_wpmu($img); ?>
    <div class="thumb">" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?src=<?php echo $img ?>&w=130&h=90&zc=1" alt="<?php the_title(); ?>" /> </div><?php } ?>

  7. pookeyblow
    Member
    Posted 2 years ago #

    I'm wondering about this too. I would like to have a thumbnail of the video set as the featured image of the post.

    Does anyone know how to do this?

  8. mpraetzel
    Member
    Plugin Author

    Posted 2 years ago #

    I'm going to attempt to add this functionality with the next iteration of the plugin.

  9. anotherwpguy
    Member
    Posted 2 years ago #

    Hey mpraetzel, thanks for your input and saying that you will attempt to add this functionality in the next update.
    I ended up using fiverr services for this and got it working.
    I am looking forward for the next iteration and I am sure many others are too. One last suggestion for your consideration in the next update: Please try to include an option such that your user can set different categories for different video posts instead of one category. I know requesting you for different services is easy and you get lot of requests but I definitely believe that this feature will get you many A+++'s

  10. mpraetzel
    Member
    Plugin Author

    Posted 2 years ago #

    That functionally is #1 on my list. Thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.