Esempio n. 1
0
    public function widget($args, $instance)
    {
        extract($args);
        $vm_twitter_blog_videos_blog_maxposts = $instance['vm_twitter_blog_videos_blog_maxposts'];
        $vm_twitter_blog_videos_videos_maxposts = $instance['vm_twitter_blog_videos_videos_maxposts'];
        $vm_twitter_blog_videos_twitter_code = $instance['vm_twitter_blog_videos_twitter_code'];
        echo $before_widget;
        ?>
        <!-- Contents Section Started -->
        <div class="interactivetabs">
            <!-- Nav tabs -->
            <ul class="nav nav-tabs" id="intertabs-<?php 
        echo uniqid();
        ?>
">
                <?php 
        $twitterid = uniqid();
        ?>
                <li class="active"><a href="#twittertab-<?php 
        echo $twitterid;
        ?>
" data-toggle="tab"><i class="fa fa-twitter"></i><?php 
        echo __('Twitter', THEME_TEXT_DOMAIN);
        ?>
</a></li>
                <li><a href="#blogtab-<?php 
        echo $twitterid + 1;
        ?>
" data-toggle="tab"><i class="fa fa-comments"></i><?php 
        echo __('Blog', THEME_TEXT_DOMAIN);
        ?>
</a></li>
                <li><a href="#abouttab-<?php 
        echo $twitterid + 5;
        ?>
" data-toggle="tab"><i class="fa fa-video-camera"></i><?php 
        echo __('Videos', THEME_TEXT_DOMAIN);
        ?>
</a></li>
            </ul>
            <!-- Tab panes -->
            <div class="tab-content">
                <!-- Twitter Tab Start -->
                <div class="tab-pane fade in active" id="twittertab-<?php 
        echo $twitterid;
        ?>
">
                    <?php 
        echo $vm_twitter_blog_videos_twitter_code;
        ?>
                </div>
                <!-- Twitter Tab End -->
                <?php 
        $type = 'post';
        $args = array('post_type' => $type, 'post_status' => 'publish', 'orderby' => 'date', 'order' => 'DESC', 'posts_per_page' => $vm_twitter_blog_videos_blog_maxposts);
        $vm_blog_query = new WP_Query($args);
        ?>
                <!-- Blog Tab Start -->
                <div class="tab-pane fade widget_recent-posts" id="blogtab-<?php 
        echo $twitterid + 1;
        ?>
">
                    <?php 
        if ($vm_blog_query->have_posts()) {
            ?>
                        <ul class="recentposts">
                            <?php 
            while ($vm_blog_query->have_posts()) {
                $vm_blog_query->the_post();
                ?>
                                <li>
                                    <h5><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h5>
                                    <p class="date"><?php 
                the_time('d F Y');
                ?>
</p>
                                </li>
                            <?php 
            }
            ?>
                        </ul>
                    <?php 
        } else {
            ?>
                        <p><?php 
            echo __('Sorry! There are no posts.', THEME_TEXT_DOMAIN);
            ?>
</p>
                    <?php 
        }
        ?>
                </div>
                <!-- Blog Tab End -->
                <?php 
        $type = 'video';
        $args = array('post_type' => $type, 'post_status' => 'publish', 'orderby' => 'date', 'order' => 'DESC', 'posts_per_page' => $vm_twitter_blog_videos_videos_maxposts);
        $vm_videos_query = new WP_Query($args);
        //echo '<pre>'; print_r($vm_videos_query); die();
        ?>
                <!-- Video List Tab Start -->
                <div class="tab-pane fade" id="abouttab-<?php 
        echo $twitterid + 5;
        ?>
">
                    <div class="videolistsmall">
                        <?php 
        if ($vm_videos_query->have_posts()) {
            ?>
                            <ul class="bloglist">
                                <?php 
            while ($vm_videos_query->have_posts()) {
                $vm_videos_query->the_post();
                ?>
                                    <?php 
                $video_duration = get_post_meta(get_the_ID(), '_vm_video_duration', true);
                ?>
                                    <li>
                                        <div class="media">
                                            <a href="<?php 
                the_permalink();
                ?>
" class="pull-left">
                                                <img class="media-object img-responsive hovereffect" src="<?php 
                echo vm_get_video_post_thumbnail(get_the_ID());
                ?>
" alt="<?php 
                the_title();
                ?>
" />
                                            </a>
                                            <div class="media-body">
                                                <h5><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h5>
                                                <ul>
                                                    <li><i class="fa fa-clock-o"></i><?php 
                echo $video_duration;
                ?>
</li>
                                                </ul>
                                            </div>
                                        </div>
                                    </li>
                                <?php 
            }
            ?>
                                <?php 
            wp_reset_postdata();
            ?>
                            </ul>
                        <?php 
        } else {
            ?>
                            <p><?php 
            echo __('Sorry! There are no posts.', THEME_TEXT_DOMAIN);
            ?>
</p>
                        <?php 
        }
        ?>
                    </div>
                </div>
                <!-- Video List Tab End -->
            </div>
        </div>
        <!-- Contents Section End -->

        <?php 
        echo $after_widget;
    }
        post_class('col-lg-4 col-md-6 col-sm-6 col-xs-12');
        ?>
> 
                    <!-- Video Box Start -->
                    <div class="videobox2">
                        <figure> 
                            <!-- Video Thumbnail Start --> 
                            <a href="<?php 
        echo get_the_permalink();
        ?>
">
                                <img alt="<?php 
        echo get_the_title();
        ?>
" class="img-responsive hovereffect" src="<?php 
        echo vm_get_video_post_thumbnail(get_the_ID());
        ?>
" />
                            </a> 
                            <!-- Video Thumbnail End --> 
                            <!-- Video Info Start -->
                            <div class="vidopts">
                                <ul>
                                    <!--<li><i class="fa fa-heart"></i>1056</li>-->
                                    <li><i class="fa fa-clock-o"></i><?php 
        echo $video_duration;
        ?>
</li>
                                </ul>
                                <div class="clearfix"></div>
                            </div>