Front page › Forums › CodeCanyon products › WordPress YouTube video post plugin › Error adding a favorites playlist › Reply To: Error adding a favorites playlist
May 27, 2015 at 11:25 AM
#502
Hi,
Very sorry about this, I didn’t receive any notification about the shortcode reply. Yes, this can be easily done. Please do the following in your WP theme/child theme functions.php file:
/**
* Register theme Enfold
*/
function cbc_enfold_theme_support( $themes ){
$themes['enfold'] = array(
'post_type' => 'post',
'taxonomy' => false,
'post_meta' => array(),
'post_format' => 'video',
'theme_name' => 'Enfold'
);
return $themes;
}
add_filter( 'cbc_youtube_theme_support', 'cbc_enfold_theme_support' );
/**
* Add shortcode to video post content
*/
function cbc_enfold_video_shortcode( $post_content, $video, $theme_import ){
if( !$theme_import ){
return $post_content;
}
$shortcode = "[av_video src='https://www.youtube.com/watch?v=" . $video['video_id'] . "' format='16-9' width='16' height='9']" . "\n";
return $shortcode . $post_content;
}
add_filter( 'cbc_video_post_content', 'cbc_enfold_video_shortcode', 10, 3 );
The theme will officially be implemented into the plugin by default but for now, please try using the filters.