Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter annarama

    (@annarama)

    I figured it out. Here is my Code.

    <?php
    // Check if youtube or Vimeo and Extract the IDS. Displayed with Shortcode in Sidebar
    global $wp_query;
    $postid = $wp_query->post->ID;
    
    $wpcf_video_trailers = get_post_meta($postid, 'wpcf-video_embed_trailer', false);
    $wpcf_video_extras = get_post_meta($postid, 'wpcf-video_embed_extras', false);
    $wpcf_video_drills = get_post_meta($postid, 'wpcf-video_embed_drills', false);
    $wpcf_videos = array_merge ($wpcf_video_trailers,$wpcf_video_extras,$wpcf_video_drills);
    
    foreach ($wpcf_videos as $wpcf_video) {
    		$parseds[]    = parse_url($wpcf_video);
    	}
    foreach ($parseds as $parsed) {
    		$hostnames[]   = $parsed['host'];
    		$querys[]      = $parsed['query'];
    		$paths[]       = $parsed['path'];
    	}
    
    	if ($hostname=='www.youtube.com' || $hostname=='youtube.com');
    		foreach ($querys as $query){
    			$Arr = explode('v=',$query);
    			$videoIDwithString = $Arr[1];
    			$videoIDsf[] = substr($videoIDwithString,0,11);
    		}
    $videoIDs = array_filter($videoIDsf);
    				//YOUTUBE.COM
    					if(isset($videoIDs)){
    						foreach ($videoIDs as $videoID)
    					echo do_shortcode('[youtube id="'.$videoID.'" mode="thumbnail"]');
    					}
    	if ($hostname=='vimeo.com');
    		foreach ($paths as $path){
    				$ArrV = explode('://vimeo.com/',$path);
    				$vimeoID = substr($ArrV[0],1,8);
    				$vimeoIDsIntf[] = intval($vimeoID);
    		}
    $vimeoIDsInt = array_filter($vimeoIDsIntf);
    				//VIMEO.COM
    					if(isset($vimeoIDsInt)){
    						foreach ($vimeoIDsInt as $vimeoIDInt)
    					echo do_shortcode('[vimeo id="'.$vimeoIDInt.'" mode="thumbnail"]');
    					}
    ?>
    Thread Starter annarama

    (@annarama)

    Sry. It doesn’t. Our employees must be able to insert just a link from Youtube OR Vimeo. Also the structure for handling the related video to that post is different compared to how we handle our youtube playlists. I have already searched for two days straight for a plugin that combines what i want to achieve (automatically insert embedded videos from three custom field arrays, open in colorbox, related to special taxonomy terms etc.) And I don’t want to handle 10 Plugins just for this. So i decided to hardcode this into the sidebar. Maybe someone can suggest a plugin that does exactly that, at least I haven’t found the right one.

    I have the same problem, and I can’t seem to get a hold of a solution.
    The First Widget on the page looks just fine. The second one is just a simple unordered list. Also the options like title color, hide title etc. are overridden by the other widget.

    Is there still anyone working on this plugin? It’s the only widget that is suited for my needs.

Viewing 3 replies - 1 through 3 (of 3 total)