function widget($args, $instance) { extract($args); extract($instance); $title = apply_filters('widget_title', empty($title) ? '' : $title, $instance, $this->id_base); $text = apply_filters('widget_text', empty($text) ? '' : $text, $instance); $link = $instance['link']; $button = $instance['button']; echo $before_widget; /* ICON OUTPUT */ $args = array("title_select" => $title_select, "title_fa" => $title_fa, "title_img" => $title_img); cws_widget_icon_rendering($args); /* ICON OUTPUT */ ?> <div class="cws-widget-content benefits_widget"> <?php if (isset($title)) { echo $before_title . $title . $after_title; } ?> <section class="text_part"><?php echo !empty($instance['filter']) ? wpautop($text) : $text; ?> </section> <?php echo !empty($link) ? do_shortcode('[cws_button type=default size=medium link="' . $link . '"]' . $button . '[/cws_button]') : ""; ?> </div> <?php echo $after_widget; }
function widget($args, $instance) { extract($args); extract($instance); $title = apply_filters('widget_title', empty($title) ? '' : $title, $instance, $this->id_base); $text = apply_filters('widget_text', empty($text) ? '' : $text, $instance); $link = $instance['link']; echo $before_widget; /* ICON OUTPUT */ $args = array("title_select" => $title_select, "title_fa" => $title_fa, "title_img" => $title_img); cws_widget_icon_rendering($args); /* ICON OUTPUT */ ?> <div class="cws-widget-content benefits_widget"> <?php if (isset($title)) { echo $before_title . $title . $after_title; } ?> <section class="text_part"><?php echo !empty($instance['filter']) ? wpautop($text) : $text; ?> </section> <?php echo !empty($link) ? "<a class='benefits_more' href='{$link}'></a>" : ""; ?> </div> <?php echo $after_widget; }
function widget($args, $instance) { extract($args); extract($instance); $title = apply_filters('widget_title', empty($title) ? '' : $title, $instance, $this->id_base); $text = apply_filters('widget_text', empty($text) ? '' : $text, $instance); echo $before_widget; /* ICON OUTPUT */ $args = array("title_select" => $title_select, "title_fa" => $title_fa, "title_img" => $title_img); cws_widget_icon_rendering($args); /* ICON OUTPUT */ ?> <div class="cws-widget-content <?php echo isset($backlight) && $backlight == 'on' ? 'backlight' : ''; ?> "> <?php if (isset($title) && !empty($title)) { echo $before_title . $title . $after_title; } ?> <section class="textwidget"><?php echo !empty($instance['filter']) ? wpautop(do_shortcode($text)) : do_shortcode($text); ?> </section> </div> <?php echo $after_widget; }
function widget($args, $instance) { extract($args); extract($instance); $title = apply_filters('widget_title', empty($title) ? '' : $title, $this->id_base); ob_start(); echo $before_widget; /* ICON OUTPUT */ $args = array("title_select" => $title_select, "title_fa" => $title_fa, "title_img" => $title_img); cws_widget_icon_rendering($args); /* ICON OUTPUT */ ?> <div class="cws-widget-content <?php echo isset($backlight) && $backlight == 'on' ? 'backlight' : ''; ?> "> <?php if (!empty($title)) { echo $before_title . $title . $after_title; } $icons = cws_get_option('social-group'); if (count($icons) > 0) { echo "<div class='social-icons'>"; foreach ($icons as $i => $icon) { if ($this->not_empty($icon['soc-select-fa']) && $this->not_empty($icon['soc-url'])) { $url = filter_var($icons[$i]['soc-url'], FILTER_VALIDATE_URL) ? $icons[$i]['soc-url'] : 'http://' . $icons[$i]['soc-url']; ?> <span class="icon"> <a href="<?php echo $url; ?> "> <i class="fa fa-<?php echo $icons[$i]['soc-select-fa']; ?> "></i> </a> </span> <?php } } echo "</div>"; } ?> </div> <?php echo $after_widget; ob_end_flush(); }
function widget($args, $instance) { extract($args); extract($instance); $title = !empty($instance['title']) ? $instance['title'] : __('Latest Posts', THEME_SLUG); $title = apply_filters('widget_title', $title, $instance, $this->id_base); $number = !empty($instance['number']) ? absint($instance['number']) : 4; // default value $visible_num = isset($instance['visible_num']) ? absint($instance['visible_num']) : 2; echo $before_widget; /* ICON OUTPUT */ $args = array("title_select" => $title_select, "title_fa" => $title_fa, "title_img" => $title_img); cws_widget_icon_rendering($args); /* ICON OUTPUT */ $shortcode = "[twitter tweets='{$number}' visible='{$visible_num}' title='{$title}' before_title='{$before_title}' after_title='{$after_title}' sidebar='true' "; $shortcode .= isset($backlight) && $backlight == 'on' ? "backlight='on' ]" : "" . "]"; echo do_shortcode($shortcode); echo $after_widget; }
function widget($args, $instance) { extract($args); extract($instance); $title = apply_filters('widget_title', empty($title) ? '' : $title, $instance, $this->id_base); $text = apply_filters('widget_text', empty($text) ? '' : $text, $instance); echo $before_widget; /* ICON OUTPUT */ $args = array("title_select" => $title_select, "title_fa" => $title_fa, "title_img" => $title_img); cws_widget_icon_rendering($args); /* ICON OUTPUT */ ?> <div class="cws-widget-content <?php echo isset($backlight) && $backlight == 'on' ? 'backlight' : ''; ?> "> <?php if (isset($title)) { echo $before_title . $title . $after_title; } ?> <div class='archives'> <?php $archives_args = array('format' => 'custom', 'before' => '<div class="archive_item">', 'after' => '</div>'); if ($show_post_count) { $archives_args["show_post_count"] = true; } wp_get_archives($archives_args); ?> </div> </div> <?php echo $after_widget; }
function widget($args, $instance) { extract($args); extract($instance); $query_args = array('posts_per_page' => $post_count, 'cat' => $category, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'nopaging' => true); $tech_cat = cws_get_option('tech-category'); $tech_cat = isset($tech_cat) ? $tech_cat : array(); if (count($tech_cat) > 0) { for ($i = 0; $i < count($tech_cat); $i++) { $tech_cat[$i] = '-' . $tech_cat[$i]; } $tech_cat = implode(',', $tech_cat); $query_args["cat"] = $tech_cat . "," . $query_args["cat"]; } $r = new WP_Query(apply_filters('widget_posts_args', $query_args)); if ($r->have_posts()) { ?> <?php echo $before_widget; /* ICON OUTPUT */ $args = array("title_select" => $title_select, "title_fa" => $title_fa, "title_img" => $title_img); cws_widget_icon_rendering($args); /* ICON OUTPUT */ $outer_num = $r->post_count < $post_count ? $r->post_count : $post_count; $number = $number || $outer_num; $carousel = $outer_num <= $number ? false : true; ?> <div class="cws-widget-content <?php echo isset($backlight) && $backlight == 'on' ? 'backlight' : ''; ?> "> <?php if ($carousel) { echo "<div class='carousel_header clearfix'>"; echo $r->post_count ? "<div class='widget_carousel_nav'><i class='prev fa fa-angle-left'></i><i class='next fa fa-angle-right'></i><div class='clearfix'></div></div>" : ""; } echo !empty($title) ? $before_title . $title . $after_title : ""; if ($carousel) { echo "</div>"; } if ($carousel) { echo "<div class='carousel_content clearfix'>"; } ?> <section class="<?php echo $carousel ? 'widget_carousel' : ''; ?> "> <?php while ($r->have_posts() && $outer_num > 0) { ?> <div> <ul class="post-list"> <?php $inner_num = $number; while ($inner_num > 0 && $outer_num > 0) { $r->the_post(); $current_post = get_permalink(); ?> <li> <figure> <?php $image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full'); if ($image) { ?> <img src="<?php echo bfi_thumb($image[0], array('width' => 70, 'height' => 70)); ?> " alt="<?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?> "> <?php } ?> <a href="<?php echo $current_post; ?> " class="post-title"> <?php $title = esc_attr(get_the_title() ? get_the_title() : get_the_ID()); $sep_pos = stripos($title, '|'); if ($sep_pos) { echo substr($title, 0, $sep_pos); } else { echo $title; } ?> </a> <p> <?php $content = strip_shortcodes(strip_tags(get_the_content('', false))); $visible_content = substr($content, 0, (int) $count_chars); echo $visible_content; if (strlen($visible_content) < strlen($content)) { echo " <a class='more' href='{$current_post}'></a>"; } ?> </p> <?php if ($show_date) { ?> <p class="time-post"><?php echo get_the_date(); ?> </p> <?php } ?> </figure> </li> <?php if ($inner_num === 1) { ?> <?php } ?> <?php $inner_num--; $outer_num--; ?> <?php } ?> </ul> </div> <?php } ?> </section> <?php if ($carousel) { echo "</div>"; } ?> </div> <?php echo $after_widget; // Reset the global $the_post as this query will have stomped on it wp_reset_postdata(); } }
function widget($args, $instance) { extract($args); extract($instance); $title = !empty($instance['title']) ? $instance['title'] : __('Latest Pictures', THEME_SLUG); $title = apply_filters('widget_title', $title, $instance, $this->id_base); $number = !empty($instance['number']) ? absint($instance['number']) : 4; // default value ob_start(); echo $before_widget; /* ICON OUTPUT */ $args = array("title_select" => $title_select, "title_fa" => $title_fa, "title_img" => $title_img); cws_widget_icon_rendering($args); /* ICON OUTPUT */ $cat_name = !empty($category) ? get_term_by("id", $category, "cws-portfolio-type")->name : ""; $query_args = array('post_type' => 'portfolio', 'cws-portfolio-type' => $cat_name, 'post_status' => 'published', 'posts_per_page' => -1); $items = new WP_Query($query_args); $carousel = $items->post_count > 1 ? true : false; ?> <div class="cws-widget-content <?php echo isset($backlight) && $backlight == 'on' ? 'backlight' : ''; ?> "> <div class='carousel_header clearfix'> <?php echo $carousel ? "<div class='widget_carousel_nav'><i class='prev fa fa-angle-left'></i><i class='next fa fa-angle-right'></i><div class='clearfix'></div></div>" : ""; ?> <?php if (!empty($title)) { echo $before_title . $title . $after_title; } ?> </div> <div class='photo_tour carousel_content'> <?php echo $carousel ? "<section class='widget_carousel'>" : ""; $counter = 0; if ($items->have_posts()) { $gallery_id = uniqid('cws-gallery-'); while ($items->have_posts() && $counter < $number) { $items->the_post(); $full = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_id()), 'full'); $full_url = $full[0]; if (!empty($full_url)) { $cws_stored_meta = get_post_meta(get_the_id(), 'cws-portfolio'); $thumb_url = bfi_thumb($full_url, array('width' => 270, 'height' => 270, 'crop' => true)); $counter++; ?> <div class='item'> <div class="pic"> <?php echo "<img src='{$thumb_url}' alt /><div class='hover-effect'></div><div class='links'><a" . ($carousel ? " data-fancybox-group='{$gallery_id}'" : "") . " href='{$full_url}' class='fancy" . ($carousel ? " fancy_gallery" : "") . " fa fa-photo'></a></div>"; ?> </div> <div class='portfolio_item_info'> <?php $title = get_the_title(); $link = get_the_permalink(); echo !empty($title) ? "<div class='name'><a href='{$link}'>{$title}</a></div>" : ""; $short_desc = !empty($cws_stored_meta[0]['cws-portfolio-short_desc']) ? $cws_stored_meta[0]['cws-portfolio-short_desc'] : ""; echo !empty($short_desc) ? substr($short_desc, 0, 60) : cws_post_content_output(60); ?> </div> </div> <?php } } } echo $carousel ? "</section>" : ""; ?> </div> </div> <?php echo $after_widget; ob_end_flush(); }
function widget($args, $instance) { extract($args); extract($instance); $title = apply_filters('widget_title', empty($title) ? '' : $title, $instance, $this->id_base); $text = apply_filters('widget_text', empty($text) ? '' : $text, $instance); echo $before_widget; /* ICON OUTPUT */ $args = array("title_select" => $title_select, "title_fa" => $title_fa, "title_img" => $title_img); cws_widget_icon_rendering($args); /* ICON OUTPUT */ ?> <div class="cws-widget-content doc_search <?php echo isset($backlight) && $backlight == 'on' ? 'backlight' : ''; ?> "> <?php if (!empty($title)) { echo $before_title . $title . $after_title; } global $wpdb; $docs = $wpdb->get_col("SELECT post_title FROM {$wpdb->posts} WHERE post_type = 'staff'"); wp_enqueue_script('jquery-ui-autocomplete'); $docs_arr_js = "var docs = ['" . implode("','", $docs) . "'];"; ?> <script> jQuery(function(){ <?php echo $docs_arr_js; ?> jQuery("#docname").autocomplete({ source: docs, messages: {noResults: '', results: function() {} }, appendTo: '.search_field.by_name' }) }); </script> <section class="find_a_doctor"> <form role="search" method="get" class="doctors-search-form" id="quick-search" action="<?php echo home_url(); ?> "> <input type="hidden" name="asearch" value="1"> <div class="search_field by_name"> <input type="text" placeholder="<?php _e('Search by name', THEME_SLUG); ?> " id="docname" name="docname"> </div> <div class="search_field by_treatment"> <select name="cws-stafftreatments"> <?php $depts = get_terms('cws-staff-treatments'); echo '<option value="" disabled selected>' . __("Select treatment", THEME_SLUG) . '</option>'; foreach ($depts as $dept => $v) { echo '<option value="' . $v->slug . '">' . $v->name . '</option>'; } ?> </select> </div> <div class='submit_field'> <button type="submit">Search</button> </div> </form> </section> </div> <?php echo $after_widget; }