Simple Facebook Connect
[resolved] Youtube Thumbnails (3 posts)

  1. Aakash83
    Posted 4 years ago #

    I have a question about the auto publish to facebook feature. by default this plugin looks for any embeded videos and automatically generate thumbs for that video . In my theme I have a custom field "video" which contains the Youtube URL of video. Now what I want is to make some change in the code in the "simple-facebook-connect/sfc-publish.php" File so that it take the youtube URL from the custom Field " Video" and generate thumbnails so that this thumbnail can be used when the plugin publsih this post to facebook.

    I tried this code but it is not working. In my theme I am generating thumbs using the same method.

    $youtubeid = get_post_meta($post->ID, "video", true);
    $url = parse_url($youtubeid);
    array_unshift($images, "http://img.youtube.com/vi/$v/1.jpg");


  2. Samuel Wood (Otto)
    WordPress.org Tech Dude
    Plugin Author

    Posted 4 years ago #

    The code to find videos in the post is in the sfc-base.php file. You can modify the function sfc_base_find_video($post) to find the relevant video files for your setup.

    I recommend doing this here instead of elsewhere because this also affects the meta information put into the single post headers, which affects what happens with like/share and other things. Putting code like this in publish would only change one aspect of this.

  3. Aakash83
    Posted 4 years ago #

    Thanks for your reply. but the queation is that how can we modify the code so that It can search a Youtube URL from a custom field and generate its thumbnail while autoposting to facebook. i.e I want the plugin to pick the video URL from custom field and not the main post content. can you please guide I am not very good with PHP .


Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic