Help to make the plugin compatible

Front page Forums CodeCanyon products WordPress YouTube video post plugin Help to make the plugin compatible

This topic contains 4 replies, has 2 voices, and was last updated by  logan 5 years, 7 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #402

    logan
    Participant

    HI
    i am using advanced newspaper theme … i i followed your tut to make it compatible with my theme but it didnt work.. anyway can you please help me to make it work ..
    Big Thanks 😀

    #403

    Constantin
    Keymaster

    Hi,

    Please try this in your theme/child theme functions.php file, it should do the trick:

    /**
     * Add theme compatibility 
     * @param array $themes - array of default compatible themes
     */
    function newspaper_theme_compat( $themes ){
    	
    	$themes['newspaper'] = array(
    		'post_type' => 'post',
    		'taxonomy' 	=> false,
    		'post_meta' => array(),
    		'post_format'	=> 'video',
    		'theme_name' 	=> 'Newspaper'
    	);	
    	return $themes;
    }
    add_filter('cbc_youtube_theme_support', 'newspaper_theme_compat');
    
    /**
     * On bulk post import, set up all extra fields needed by the theme to flag post as video
     * @param int $post_id - ID of newly created post
     * @param array $video - array of video data returned by YouTube
     * @param false/array $theme_import - theme import configuration
     */
    function newspaper_post_fields( $post_id, $video, $theme_import ){
    	// check if setting is to import as theme post
    	if( !$theme_import ){
    		return;
    	}
    	// look for the plugin general settings function
    	if( !function_exists('cbc_get_player_settings') ){
    		return;
    	}
    	
    	$url = 'http://www.youtube.com/watch?v='.$video['video_id'];
    	$data = array( 'td_video' => $url );
    	update_post_meta( $post_id, 'td_post_video', $data );	
    }
    add_action('cbc_post_insert', 'newspaper_post_fields', 10, 3);
    
    #404

    logan
    Participant

    Hi bro .. thanks for that but it didnt work …
    i think have some wrong with my theme name ,,,
    Here is the code i copied from .css

    /*
    Theme Name: advanced newspaper
    Version: 3.3
    Theme URI: http://www.gabfirethemes.com/
    Description: Designed by Gabfire Themes | See All Themes
    Author: Gabfire Themes
    MD5: bc30960d51c837a73c7630d5ada196bd
    Author URI: http://www.gabfirethemes.com
    Tags: Newspaper, Magazine, News
    */

    #405

    Constantin
    Keymaster

    Yours it’s a different theme from the one I thought you had. Please contact me from my CodeCanyon profile page here: http://codecanyon.net/user/cboiangiu

    #407

    logan
    Participant

    HI bro .. i just sended you an email

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.