コード例 #1
0
             <?php 
 if ($post_format == 'audio') {
     $link = $cl_redata['media_post_link'];
     echo do_shortcode('[soundcloud]' . $link . '[/soundcloud]');
 } elseif ($post_format == 'gallery') {
     $slider = new codeless_slideshow(get_the_ID(), 'flexslider');
     if ($slider && $slider->slide_number > 0) {
         $slider->img_size = 'blog';
         $sliderHtml = $slider->render_slideshow();
         echo $sliderHtml;
     }
 } elseif ($post_format == 'video') {
     $video = "";
     $link = $cl_redata['media_post_link'];
     if (codeless_backend_is_file($link, 'html5video')) {
         $video = codeless_html5_video_embed($link);
     } else {
         if (strpos($link, '<iframe') !== false) {
             $video = $link;
         } else {
             global $wp_embed;
             $video = $wp_embed->run_shortcode("[embed]" . trim($link) . "[/embed]");
         }
     }
     if (strpos($video, '<a') === 0) {
         $video = '<iframe src="' . esc_url($link) . '"></iframe>';
     }
     echo $video;
 } elseif (get_post_thumbnail_id()) {
     ?>
                 <?php 
コード例 #2
0
    if ($cl_redata['single_portfolio_media'] == 'slideshow') {
        $slider = new codeless_slideshow(get_the_ID(), 'flexslider');
        $slider->slides = $cl_redata['single_portfolio_gallery'];
        $slider->slide_number = count($cl_redata['single_portfolio_gallery']);
        if ($slider && $slider->slide_number > 0) {
            $slider->img_size = 'blog';
            $sliderHtml = $slider->render_slideshow();
            echo $sliderHtml;
        }
    }
    ?>
        <?php 
    if ($cl_redata['single_portfolio_media'] == 'video') {
        $video = "";
        if (codeless_backend_is_file($cl_redata['single_portfolio_video'], 'html5video')) {
            $video = codeless_html5_video_embed($cl_redata['single_portfolio_video']);
        } else {
            if (strpos($cl_redata['single_portfolio_video'], '<iframe') !== false) {
                $video = $cl_redata['single_portfolio_video'];
            } else {
                global $wp_embed;
                $video = $wp_embed->run_shortcode("[embed]" . trim($cl_redata['single_portfolio_video']) . "[/embed]");
            }
        }
        if (strpos($video, '<a') === 0) {
            $video = '<iframe src="' . esc_url($cl_redata['single_portfolio_video']) . '"></iframe>';
        }
        echo $video;
    }
    ?>