function widget($args, $instance)
    {
        // outputs the content of the widget
        extract($args);
        $this->category_JS();
        $title = apply_filters('widget_title', $instance['title']);
        if ($args['id'] == 'sidebar-footerwidgetarea') {
            $footer_width = 'span' . circleflip_calculate_widget_width();
        } else {
            $footer_width = '';
        }
        ?>
			 
			 
			<li class="categoryCount widget customWidget <?php 
        echo esc_attr($footer_width);
        ?>
">
			 	<?php 
        if ($title != null) {
            ?>
			 		<div class="widgetDot"></div>
					<h3 class="widgetTitle grid2"><?php 
            echo esc_html($title);
            ?>
</h3>
				
				<?php 
        }
        $category_ids = get_terms('category', array('fields' => 'ids', 'get' => 'all'));
        foreach ($category_ids as $cat_id) {
            $cat_name = get_cat_name($cat_id);
            if ($cat_name != 'Uncategorized') {
                ?>
					<p class="widgetcategory_with_count  textwidget">
					<span class="left"><a href="<?php 
                echo esc_url(get_category_link($cat_id));
                ?>
"><?php 
                echo esc_html($cat_name);
                ?>
</a></span>
					<?php 
                $postsInCat = get_term_by('name', $cat_name, 'category');
                $postsInCat = $postsInCat->count;
                ?>
 <span class="right"><?php 
                echo '(' . $postsInCat . ')';
                ?>
</span>
					</p> 
				 <?php 
            }
        }
        ?>
			</li>
			<?php 
    }
Exemplo n.º 2
0
    function widget($args, $instance)
    {
        // outputs the content of the widget
        extract($args);
        if ($args['id'] == 'sidebar-footerwidgetarea') {
            $footer_width = 'span' . circleflip_calculate_widget_width();
        } else {
            $footer_width = '';
        }
        $title = apply_filters('widget_title', $instance['title']);
        $testimonials_ = $instance['testimonials'];
        ?>
       		 <li class="testimonials widget customWidget <?php 
        echo esc_attr($footer_width);
        ?>
">
			 	<?php 
        if ($title != null) {
            ?>
			 		<div class="widgetDot"></div>
					<h3 class="widgetTitle grid2"><?php 
            echo esc_html($title);
            ?>
</h3>
				<?php 
        }
        ?>
				<div id="myCarousel-testimonials" class="carousel slide testimonialsSlider carousel-fade">
				<a class="left carousel-control" href="#myCarousel-testimonials" data-slide="prev"></a>
				<a class="right carousel-control" href="#myCarousel-testimonials" data-slide="next"></a>
					<div class="carousel-inner">
						<?php 
        wp_enqueue_style('Testimonial', get_template_directory_uri() . "/css/widgets/Testimonial.css", '2.0.3');
        wp_register_script('TestimonialJS', get_template_directory_uri() . "/scripts/widgets/Testimonials.js", array('jquery'), '2.0.3', false);
        wp_enqueue_script('TestimonialJS');
        $i = 0;
        foreach ($instance['testimonials'] as $testimonials_) {
            ?>
						<?php 
            $tab_selected = $i == 0 ? 'active' : '';
            $i++;
            ?>
						<div class="item <?php 
            echo esc_attr($tab_selected);
            ?>
">
							<div class="TContainer">
								<div class="textwidget">
									<?php 
            if ($testimonials_[0] != null) {
                ?>
									<p class="TText"><?php 
                echo esc_html($testimonials_[0]);
                ?>
</p> 
									<?php 
            }
            ?>
								</div>
								<div class="testmonialsBottom">
								<?php 
            if ($testimonials_[1] != null) {
                ?>
									<div class="image"><img src="<?php 
                echo esc_url($testimonials_[1]);
                ?>
" alt ="testimonials photo" /></div>
								<?php 
            }
            ?>
									<div class="testimonialspersonnal">
										<?php 
            if ($testimonials_[2] != null) {
                ?>
										<p class="TName"><?php 
                echo esc_html($testimonials_[2]);
                ?>
</p>
										<?php 
            }
            ?>
										<?php 
            if ($testimonials_[3] != null) {
                ?>
										<p class="TJob"><?php 
                echo esc_html($testimonials_[3]);
                ?>
</p>
										<?php 
            }
            ?>
									</div>
								</div>
							</div>
						</div>
						<?php 
        }
        ?>
					</div>
				</div>
			</li>
			<?php 
    }
    function widget($args, $instance)
    {
        // outputs the content of the widget
        wp_enqueue_style('top_post', get_template_directory_uri() . "/css/widgets/top_post.css", '2.0.3');
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        $number = apply_filters('widget_number', $instance['number']);
        if ($args['id'] == 'sidebar-footerwidgetarea') {
            $footer_width = 'span' . circleflip_calculate_widget_width();
        } else {
            $footer_width = '';
        }
        ?>
				<li class="topPost topPostwidth widget customWidget topPost_list_item <?php 
        echo esc_attr($footer_width);
        ?>
">
					<?php 
        if ($title != null) {
            ?>
						<div class="widgetDot"></div>
						<h3 class="widgetTitle grid2"><?php 
            echo esc_html($title);
            ?>
</h3>
						<div id="topPostPrev" class="topPostPrev topPostPrev"></div>
						<div id="topPostNext" class="topPostNext topPostNext"></div>
					<div class="carousel_topPost">
						
					<?php 
        }
        $posts_per_page = get_query_var('posts_per_page');
        $paged = intval(get_query_var('paged'));
        $paged = $paged ? $paged : 1;
        $args = array('posts_per_page' => $posts_per_page, 'paged' => $paged, 'more' => $more = 0, 'orderby' => 'comment_count', 'order' => 'DESC', 'suppress_filters' => false);
        $posts = get_posts($args);
        $x = 0;
        foreach ($posts as $post) {
            if (get_the_post_thumbnail($post->ID, 'cf-top-post') != null) {
                if ($number < count($posts)) {
                    if ($x == $number) {
                        break;
                    }
                    $x++;
                }
                ?>
								
							<div class="topPost carousel-inner">
								<a href="<?php 
                echo esc_url(get_the_permalink($post->ID));
                ?>
"><?php 
                echo get_the_post_thumbnail($post->ID, 'cf-top-post');
                ?>
</a>
							</div>
							<?php 
            }
            ?>
					<?php 
        }
        ?>
					</div>
				</li>
			<?php 
    }
Exemplo n.º 4
0
/**
 * Register the sidebars.
 *
 * @author	Creiden
 * @since	1.0.0 - 05.02.2012
 *
 * @return	void
 */
function circleflip_widgets_init()
{
    register_sidebar(array('name' => __('Main Sidebar', 'circleflip'), 'id' => 'main', 'before_widget' => '<li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widgetTitle">', 'after_title' => '</h3>'));
    register_sidebar(array('name' => __('Image Sidebar', 'circleflip'), 'description' => __('Shown on image attachment pages.', 'the-bootstrap'), 'id' => 'image', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widgetTitle">', 'after_title' => '</h3>'));
    register_sidebar(array('name' => __('Shop', 'circleflip'), 'description' => __('Shown on shop.', 'circleflip'), 'id' => 'shop', 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widgetTitle">', 'after_title' => '</h3>'));
    register_sidebar(array('name' => 'Footer Widget Area', 'id' => 'sidebar-footerwidgetarea', 'class' => '', 'before_widget' => '<li id="%1$s" class="widget %2$s grid4 span' . circleflip_calculate_widget_width() . '">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widgetTitle grid1">', 'after_title' => '</h3>'));
    $custom_sidebars = cr_get_option('sidebars', array());
    if (!empty($custom_sidebars)) {
        foreach ($custom_sidebars as $sidebar) {
            register_sidebar(array('name' => $sidebar, 'id' => 'sidebar-' . strtolower(str_replace(" ", '', $sidebar)), 'class' => '', 'before_widget' => '<li id="%1$s" class="widget %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widgetTitle grid1">', 'after_title' => '</h3>'));
        }
    }
}
Exemplo n.º 5
0
    function widget($args, $instance)
    {
        // outputs the content of the widget
        extract($args);
        $this->contactInformation();
        $title = apply_filters('widget_title', $instance['title']);
        $text = $instance['text'];
        $postalCode = $instance['postalCode'];
        $tel = $instance['tel'];
        $fax = $instance['fax'];
        $social = $instance['social'];
        if ($args['id'] == 'sidebar-footerwidgetarea') {
            $footer_width = 'span' . circleflip_calculate_widget_width();
        } else {
            $footer_width = '';
        }
        ?>
				<li class="informationWidget widget customWidget <?php 
        echo esc_attr($footer_width);
        ?>
">
					<?php 
        if ($title != null) {
            ?>
						<div class="widgetDot"></div>
						<h3 class="widgetTitle"><?php 
            echo esc_html($title);
            ?>
</h5>
					<?php 
        }
        ?>
					<?php 
        if ($text != null) {
            ?>
						<p><?php 
            echo esc_html($text);
            ?>
</p>
					<?php 
        }
        ?>
					<?php 
        if ($postalCode != null || $tel != null || $fax != null) {
            ?>
						<ul class="informationList <?php 
            if (count($instance['social']) != 0) {
                echo 'grid4';
            }
            ?>
">
							<?php 
            if ($postalCode != null) {
                ?>
								<li>
									<span><?php 
                _e('Postal Code: ', 'circleflip');
                ?>
</span><?php 
                echo esc_html($postalCode);
                ?>
								</li>
							<?php 
            }
            ?>
							<?php 
            if ($tel != null) {
                ?>
								<li>
									<span><?php 
                _e('Tel: ', 'circleflip');
                ?>
</span><?php 
                echo esc_html($tel);
                ?>
								</li>
							<?php 
            }
            ?>
							<?php 
            if ($fax != null) {
                ?>
								<li>
									<span><?php 
                _e('Fax: ', 'circleflip');
                ?>
</span><?php 
                echo esc_html($fax);
                ?>
								</li>
							<?php 
            }
            ?>
						</ul>
					<?php 
        }
        ?>
					<?php 
        if (count($instance['social']) != 0) {
            ?>
					<ul class="widgetSocials clearfix">
						<?php 
            foreach ($instance['social'] as $social_item) {
                ?>
							<li onMouseOut="this.style.backgroundColor='#494949'" onMouseOver="this.style.backgroundColor='<?php 
                echo esc_js($social_item[2]);
                ?>
'">
								<a href="<?php 
                echo esc_url($social_item[0]);
                ?>
">
									<div class="<?php 
                echo esc_attr($social_item[1]);
                ?>
"></div>
								</a>
							</li>
						<?php 
            }
            ?>
					</ul>
					<?php 
        }
        ?>
				</li>
			<?php 
    }
Exemplo n.º 6
0
    function widget($args, $instance)
    {
        // outputs the content of the widget
        if ($args['id'] == 'sidebar-footerwidgetarea') {
            $footer_width = 'span' . circleflip_calculate_widget_width();
        } else {
            $footer_width = '';
        }
        extract($args);
        $this->flickr_widget();
        $flickr_title = apply_filters('widget_title', $instance['title']);
        ?>
				<li class="flickrWidget widget customWidget <?php 
        echo esc_attr($footer_width);
        ?>
" id="flickrStream">
					<?php 
        if ($flickr_title != null) {
            ?>
						<div class="widgetDot"></div>
						<h3 class="widgetTitle grid2"><?php 
            echo esc_html($flickr_title);
            ?>
</h3>
					<?php 
        }
        ?>
					<ul class="flickrList clearfix"></ul>
				</li>
				<?php 
        wp_register_script('flickr', get_template_directory_uri() . '/js/flickr.js');
        wp_enqueue_script('flickr');
        wp_register_script('flickrCustom', get_template_directory_uri() . '/scripts/modules/flickr_custom.js');
        wp_enqueue_script('flickrCustom');
        wp_register_script('pretty', get_template_directory_uri() . '/js/prettyPhoto.js');
        wp_enqueue_script('pretty');
        wp_register_style('prettyStyle', get_template_directory_uri() . '/css/prettyphoto/style/prettyPhoto.css');
        wp_enqueue_style('prettyStyle');
        wp_localize_script('flickrCustom', 'global_flickr', array('limit' => $instance['flickr_no'], 'id' => $instance['id']));
        ?>
			<?php 
    }
Exemplo n.º 7
0
    function widget($args, $instance)
    {
        // outputs the content of the widget
        extract($args);
        $this->image_widget();
        $title = apply_filters('widget_title', $instance['title']);
        $images = isset($instance['images']) && !empty($instance['images']) ? $instance['images'] : array();
        if ($args['id'] == 'sidebar-footerwidgetarea') {
            $footer_width = 'span' . circleflip_calculate_widget_width();
        } else {
            $footer_width = '';
        }
        ?>
				<li class="imagesWidget widget customWidget <?php 
        echo esc_attr($footer_width);
        ?>
">
					<?php 
        if ($title != null) {
            ?>
						<div class="widgetDot"></div>
						<h3 class="widgetTitle grid2"><?php 
            echo esc_html($title);
            ?>
</h3>
					<?php 
        }
        ?>
					<ul class="imagesWidgetList">
						<?php 
        foreach ($images as $single_image) {
            ?>
							<li>
								<a href="<?php 
            echo esc_url($single_image[0]);
            ?>
" target="_blank">
									<img src="<?php 
            echo esc_url($single_image[1]);
            ?>
" alt=""/>
								</a>
							</li>
						<?php 
        }
        ?>
					</ul>
				</li>
			<?php 
    }
Exemplo n.º 8
0
    function widget($args, $instance)
    {
        // outputs the content of the widget
        extract($args);
        if ($args['id'] == 'sidebar-footerwidgetarea') {
            $footer_width = 'span' . circleflip_calculate_widget_width();
        } else {
            $footer_width = '';
        }
        $title = apply_filters('widget_title', $instance['title']);
        $firstLink = $instance['firstLink'];
        $firstImg = $instance['firstImg'];
        $text = $instance['text'];
        ?>
			 
			 <li class="imageTextWidget widget customWidget <?php 
        echo esc_attr($footer_width);
        ?>
">
			 	<?php 
        if ($title != null) {
            ?>
			 		<div class="widgetDot"></div>
					<h3 class="widgetTitle grid2"><?php 
            echo esc_html($title);
            ?>
</h3>
				<?php 
        }
        ?>
				<?php 
        if ($firstImg != null) {
            ?>
				<?php 
            if ($firstLink != null || $firstImg != null) {
                ?>
						<?php 
                if ($firstLink != null) {
                    ?>
							<a href="<?php 
                    echo esc_url($firstLink);
                    ?>
" target="_blank">
						<?php 
                }
                ?>
								<img class="grid2" src="<?php 
                echo esc_url($firstImg);
                ?>
" alt=""/>
						<?php 
                if ($firstLink != null) {
                    ?>
							</a>
						<?php 
                }
                ?>
				<?php 
            }
            ?>
				<?php 
        }
        ?>
				<?php 
        if ($text != null) {
            ?>
				<p class="textWidgetParagrph">
					<?php 
            echo $text;
            ?>
				</p>
				<?php 
        }
        ?>
			</li>
			<?php 
    }
    function widget($args, $instance)
    {
        // outputs the content of the widget
        wp_enqueue_style('recent_posts', get_template_directory_uri() . "/css/widgets/recent_posts.css", '2.0.3');
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        $number = apply_filters('widget_number', $instance['number']);
        if ($args['id'] == 'sidebar-footerwidgetarea') {
            $footer_width = 'span' . circleflip_calculate_widget_width();
        } else {
            $footer_width = '';
        }
        ?>
				<li class="recentPost widget customWidget <?php 
        echo esc_attr($footer_width);
        ?>
">
					<?php 
        if ($title != null) {
            ?>
						<div class="widgetDot"></div>
						<h3 class="widgetTitle grid2"><?php 
            echo esc_html($title);
            ?>
</h3>
						<div class="recentPostPrev"></div>
						<div class="recentPostNext"></div>
					<div class="Carousel_recent">
						
					<?php 
        }
        $args = array('numberposts' => -1, 'orderby' => 'date', 'order' => 'DESC', 'suppress_filters' => false);
        $posts = get_posts($args);
        $x = 0;
        $y = 0;
        $numberPost = 0;
        foreach ($posts as $post) {
            if (get_the_post_thumbnail($post->ID, 'cf-recent-posts') != null) {
                if ($number < count($posts)) {
                    if ($numberPost == $number) {
                        break;
                    }
                    $numberPost++;
                }
                if ($x == $y + 6 || $x == 0) {
                    $x = $y;
                    ?>
								<div class="container_Recent">
						 <?php 
                }
                ?>
								
							<div class="recent">
								<a href="<?php 
                echo esc_url(get_permalink($post->ID));
                ?>
"><?php 
                echo get_the_post_thumbnail($post->ID, 'cf-recent-posts');
                ?>
</a>
							</div>
							<?php 
                $x++;
                if ($x == $y + 6) {
                    ?>
							</div>
							<?php 
                }
            }
        }
        ?>
					</div>
					</li>
			<?php 
    }