示例#1
0
    function widget($args, $instance)
    {
        extract($args);
        $image_id = esc_attr(isset($instance[$this->image_field]) ? $instance[$this->image_field] : 0);
        $image = new WidgetImageField($this, $image_id);
        ?>

        <div class="banner2">
            <a href="<?php 
        echo $instance['link'];
        ?>
" <?php 
        if ($instance['link_target'] == 'new_window') {
            echo 'target="_blank"';
        }
        ?>
>
                <img src="<?php 
        echo $image->get_image_src('full');
        ?>
"/>
            </a>
        </div>
        <?php 
    }
    /**
     * Front-end display of widget.
     *
     * @see WP_Widget::widget()
     *
     * @param array $args     Widget arguments.
     * @param array $instance Saved values from database.
     */
    public function widget($args, $instance)
    {
        extract($args);
        $image_id = $instance[$this->image_field];
        $image = new WidgetImageField($this, $image_id);
        $title = apply_filters('widget_title', $instance['title']);
        $text = apply_filters('widget_textarea', empty($instance['textarea']) ? '' : $instance['textarea'], $instance);
        $url = $instance['url'];
        echo $args['before_widget'];
        ?>
            <?php 
        if (!empty($image_id) && !empty($title) && !empty($url)) {
            ?>
    			<a href="<?php 
            echo $url;
            ?>
" title="<?php 
            echo $title;
            ?>
" class="sld-widgetImage">
    				<img src="<?php 
            echo $image->get_image_src('large');
            ?>
" alt="<?php 
            echo $title;
            ?>
" />
    			</a>
				<?php 
            echo $args['before_title'];
            ?>
<a href="<?php 
            echo $url;
            ?>
" title="<?php 
            echo $title;
            ?>
" class="sld-widgetTitle"><?php 
            echo $title;
            ?>
</a><?php 
            echo $args['after_title'];
            ?>
				<div class="sld-caption"><div class="sld-captionText"><?php 
            if (!empty($text)) {
                echo wpautop($text);
            }
            ?>
</div></div>
            <?php 
        }
        ?>
            
        <?php 
        echo $args['after_widget'];
    }
示例#3
0
 public function widget($args, $instance)
 {
     extract($args);
     $image_id = $instance[$this->image_bg_field];
     $image = new WidgetImageField($this, $image_id);
     $tmp = $image->get_image_src('full');
     $style = 'style="background: url(\'' . $tmp . '\') no-repeat center center;  -webkit-background-size: 100%; -moz-background-size: 100%; -o-background-size: 100%; background-size: 100%;"';
     if ($instance) {
         $list_about = '<div class="about-top top_bg" ' . $style . '>' . '<div class="about-top-content">';
         $list_about .= $instance['content'];
         $list_about .= $instance['content_2'];
         $list_about .= '</div>' . '</div>';
         echo $list_about;
     }
 }
示例#4
0
 public function widget($args, $instance)
 {
     extract($args);
     $image_id = $instance[$this->image_bg_field];
     $image = new WidgetImageField($this, $image_id);
     $tmp = $image->get_image_src('full');
     $style = 'style="background: url(\'' . $tmp . '\') no-repeat center center; -webkit-background-size: 100%; -moz-background-size: 100%; -o-background-size: 100%;"';
     $posts = get_posts(array('posts_per_page' => $instance['number'], 'post_type' => 'testimonial', 'meta_key' => 'show_on_homepage', 'meta_value' => 1));
     if ($posts) {
         $list_testimonial = '<div class="testimonials-box"  ' . $style . '>' . '<div class="mainslider">' . '<ul class="slides group">';
         foreach ($posts as $post) {
             $list_testimonial .= '<li>' . get_the_post_thumbnail($post->ID, 'thumbnail') . '<div class="slider-content">' . '<div class="slider-title">' . $post->customer_name . '</div>';
             if (strlen($post->post_content) >= 200) {
                 $list_testimonial .= '<span>' . substr(strip_tags($post->post_content), 0, 200) . '</span>';
                 $list_testimonial .= '<a class=\'more-link\' href="' . get_site_url() . '/testimonials">...read more</a>';
             } else {
                 $list_testimonial .= '<span>' . $post->post_content . '</span>';
             }
             $list_testimonial .= '</div>' . '</li>';
         }
         $list_testimonial .= '</ul>' . '</div>' . '</div>';
         echo $list_testimonial;
     }
 }
    function widget($args, $instance)
    {
        extract($args);
        $image_id = $instance[$this->image_field];
        $blurb = $instance['blurb'];
        $url = $instance['url'];
        $new = $instance['new'] ? 'true' : 'false';
        $image = new WidgetImageField($this, $image_id);
        echo $before_widget;
        ?>
            <a <?php 
        if (!empty($url)) {
            echo 'href="' . $url . '"';
            if ('on' == $instance['new']) {
                echo ' target="_blank"';
            }
        }
        ?>
/>
            <?php 
        if (!empty($image_id)) {
            ?>
                <img src="<?php 
            echo $image->get_image_src('full');
            ?>
"/>
            <?php 
        }
        ?>
            <?php 
        if (!empty($blurb)) {
            ?>
                <div><span><?php 
            echo $blurb;
            ?>
</span></div>
            <?php 
        }
        ?>
            </a>
            <?php 
        echo $after_widget;
    }
示例#6
0
    function widget($args, $instance)
    {
        extract($args);
        $title = $instance['title'];
        $codeembed = $instance['codeembed'];
        $image_id = $instance[$this->image_field];
        $textshowvideo = $instance['textshowvideo'];
        $linkshare = $instance['linkshare'];
        $link = $instance['link'];
        $image = new WidgetImageField($this, $image_id);
        //        if (empty($title)) {
        //            $title = 'Lorem ipsum doloret sit amet consultiteur';
        //        }
        if (empty($image_id)) {
            $url = get_template_directory_uri() . '/images/bg_homebn.png';
        } else {
            $url = $image->get_image_src('full');
        }
        if (empty($textshowvideo)) {
            $textshowvideo = 'watch video';
        }
        ?>
        <script type="text/javascript">
            jQuery(document).ready(function(){
                var w =  jQuery(window).width();
                var h = w*523/1024;
                jQuery('.homebn.jhome').css('height', h);
                jQuery('.homebn .homelinkimg').click(function(){
                    console.log(123);
                });
            })
        </script>
        
            <div class="homebn jhome" style="background: transparent url('<?php 
        echo $url;
        ?>
') no-repeat; background-size: cover;">
                <?php 
        if (!empty($link)) {
            ?>
                <a href="<?php 
            echo $link;
            ?>
"  class="homelinkimg"></a>
                <?php 
        }
        ?>
                <div class="homevideo">
                    <!--<span class="close homevideoclose" style="position: absolute;right: -20px;top: -15px;font-weight: bold;color: #FFF;">×</span>-->
                    <?php 
        echo $codeembed;
        ?>
                    <!--<iframe width="350" height="200" src="//www.youtube.com/embed/pa2IDTWvRls" frameborder="0" allowfullscreen></iframe>-->
                </div>
                <div class="homebn_right fr">
                    <h1 class="homebn_title">
                        <?php 
        echo $title;
        ?>
                    </h1>
                    <?php 
        if (!empty($linkshare)) {
            ?>
                        <a href="javascript:void(0)" id="watch-video"><?php 
            echo $textshowvideo;
            ?>
</a>
                    <?php 
        }
        ?>
                </div>
                <div class="clr"></div>
                <?php 
        if (!empty($linkshare)) {
            ?>
                    <div class="homesocial">
                        <fb:like href="<?php 
            echo $linkshare;
            ?>
" send="false" layout="button_count" width="450" show_faces="false" style="width: 100px;"></fb:like>
                        <a href="https://twitter.com/share" class="twitter-share-button" data-url="<?php 
            echo $linkshare;
            ?>
" data-text="<?php 
            echo get_title_des($linkshare);
            ?>
">Tweet</a>
                        <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
                        <a href="//pinterest.com/pin/create/button/?url=<?php 
            echo $linkshare;
            ?>
" data-pin-do="buttonPin" data-pin-config="beside"><img src="//assets.pinterest.com/images/pidgets/pin_it_button.png" /></a>
                        <script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>
                    </div>
                <?php 
        }
        ?>
            </div>
        
        <?php 
    }
示例#7
0
 function widget($args, $instance)
 {
     extract($args);
     // $logo = $instance['logo'];
     $logo = $instance[$this->image_field];
     $descricao = apply_filters('descricao', empty($instance['descricao']) ? '' : $instance['descricao'], $instance);
     $endereco = $instance['endereco'];
     $email = $instance['email'];
     $telefone = $instance['telefone'];
     $facebook = $instance['facebook'];
     $twitter = $instance['twitter'];
     $googleplus = $instance['googleplus'];
     $linkedin = $instance['linkedin'];
     $github = $instance['github'];
     $contato = $instance['contato'];
     $image = new WidgetImageField($this, $logo);
     // Display the widget
     echo $before_widget;
     if ($logo) {
         echo '<div class="logo-footer"><img id="logo-footer" src="' . $image->get_image_src('thumbnail') . '"  /></div>';
     }
     if ($descricao) {
         echo wpautop($descricao);
     }
     echo '<div class="row"><div class="col-md-6"><ul class="list-icons">';
     if ($email) {
         echo '<li><i class="fa fa-at pr-10"></i>' . $email . '</li>';
     }
     if ($telefone) {
         echo '<li><i class="fa fa-phone pr-10"></i>' . $telefone . '</li>';
     }
     if ($endereco) {
         echo '<li><i class="fa fa-map-marker pr-10"></i>' . $endereco . '</li>';
     }
     echo '</ul></div>';
     echo '<div class="col-md-6"><ul class="social-links circle">';
     if ($facebook) {
         echo '<li class="facebook"><a target="_blank" href="' . $facebook . '"><i class="fa fa-facebook"></i></a></li>';
     }
     if ($twitter) {
         echo '<li class="twitter"><a target="_blank" href="' . $twitter . '"><i class="fa fa-twitter"></i></a></li>';
     }
     if ($googleplus) {
         echo '<li class="googleplus"><a target="_blank" href="' . $googleplus . '"><i class="fa fa-google-plus"></i></a></li>';
     }
     if ($linkedin) {
         echo '<li class="linkedin"><a target="_blank" href="' . $linkedin . '"><i class="fa fa-linkedin"></i></a></li>';
     }
     if ($github) {
         echo '<li class="github"><a target="_blank" href="' . $github . '"><i class="fa fa-github"></i></a></li>';
     }
     echo '</ul></div></div>';
     if ($contato) {
         echo '<a href="' . get_site_url() . '/?page_id=' . $contato . '" class="link"><span>mais informações</span></a>';
     }
     echo $after_widget;
 }