Front page › Forums › CodeCanyon products › WordPress YouTube video post plugin › Tag «Read More»
This topic contains 5 replies, has 3 voices, and was last updated by Constantin 6 years, 1 month ago.
-
AuthorPosts
-
November 28, 2013 at 5:01 PM #262
How to add a tag «Read More» () between video and description?
Using theme: Twenty TwelveDecember 20, 2013 at 7:45 PM #271You could try something like this (please note that this will work only for newly imported videos). Enter the code below in your theme functions.php file:
/** * Filter the post content on new video insert */ function twentythirteen_cbc_video_content( $post_content, $video, $theme_import ){ // check if importing in theme if( !$theme_import ){ return $post_content; } // we want to add the video link to post content at the beginning $video_url = 'http://www.youtube.com/watch?v='.$video['video_id']; return $video_url."\n" . make_clickable($post_content); } add_filter('cbc_video_post_content', 'twentythirteen_cbc_video_content', 10, 3);
December 30, 2013 at 8:10 AM #276Thanks.
Correct:
return $video_url."\n" . make_clickable($post_content);
Another problem. Not apply plugin styles (or settings) YouTube to the theme.Example:
http://ipic.lv/i4/acf6bf4e/c834426fcda24ee.jpg
http://ipic.lv/i1/777f17dd/ffdb1bf1041f532.jpg
http://ipic.lv/i4/782b9138/08b4931b43c9395.jpgMy themes function.php
function twentytwelve_theme_compat( $themes ){
$themes['twenty twelve'] = array(
'post_type' => 'post',
'taxonomy' => false,
'post_meta' => array(
'embed' => 'video_embed_value'
),
'post_format' => 'video',
'theme_name' => 'Twenty Twelve'
);
return $themes;
}
add_filter('cbc_youtube_theme_support', 'twentytwelve_theme_compat');function twentytwelve_post_fields( $post_id, $video, $theme_import ){
if( !$theme_import ){
return;
}
if( !function_exists('cbc_get_player_settings') ){
return;
}$player_settings = cbc_get_player_settings();
update_post_meta( $post_id, 'video_width_value', $player_settings['width'] );
update_post_meta($post_id, 'is_video_value', true);}
add_action('cbc_post_insert', 'twentytwelve_post_fields', 10, 3);
function twentytwelve_cbc_video_content( $post_content, $video, $theme_import ){
if( !$theme_import ){
return $post_content;
}$video_url = 'http://www.youtube.com/watch?v='.$video['video_id'];
return $video_url."\n" . make_clickable($post_content);
}add_filter('cbc_video_post_content', 'twentytwelve_cbc_video_content', 10, 3);
December 30, 2013 at 11:17 AM #277I see you’re importing as normal post type. From your second print screen I see the iframe has all settings but not in front-end. Unfortunately, this is happening based on something other than the plugin, the only thing the plugin does when importing is to put all details on the according custom fields, whatever happends after that isn’t managed by it.
December 2, 2014 at 12:58 PM #397Hi, Is there any way that the Tags from the YouTube videos also directly are imported when you do a bulk import? I have tested importing a playlist, but the tags are not imported, they are blank.
So this means, I need to manually add tags to the posts now?
December 17, 2014 at 3:28 PM #398Hi,
Sorry for the delay, had some personal issues to take care of during the last weeks. Regarding YouTube tags importing, I’m sorry but YouTube API doesn’t return them when a video playlist query is made so there’s nothing to import.
-
AuthorPosts
You must be logged in to reply to this topic.