function woocommerce_body_font_filter() { $out = ""; $font_array = cws_get_option('body-font'); if (isset($font_array)) { $out .= 'ul.product_list_widget li>*, .woocommerce .toggle_sidebar .switcher{line-height:' . $font_array["line-height"] . '}'; } echo $out; }
function cws_custom_type_register() { $labels = array('name' => __('Staff Members', THEME_SLUG), 'singular_name' => __('Staff Member', THEME_SLUG), 'add_new' => __('Add Staff Member', THEME_SLUG), 'add_new_item' => __('Add New Staff Member', THEME_SLUG), 'edit_item' => __('Edit Staff Member', THEME_SLUG), 'new_item' => __('New Staff Member', THEME_SLUG), 'view_item' => __('View Staff Member', THEME_SLUG), 'search_items' => __('Search Staff Member', THEME_SLUG), 'not_found' => __('No Staff Members found', THEME_SLUG), 'not_found_in_trash' => __('No Staff Members found in Trash', THEME_SLUG), 'parent_item_colon' => '', 'menu_name' => __('Staff', THEME_SLUG)); $args = array('labels' => $labels, 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'hierarchical' => true, 'rewrite' => array('slug' => 'staff'), 'supports' => array('title', 'editor', 'thumbnail'), 'menu_position' => 24, 'taxonomies' => array('cws-staff-dept', 'cws-staff-procedures', 'cws-staff-position')); register_post_type('staff', $args); // Portfolio $labels = array('name' => __('Portfolio Items', THEME_SLUG), 'singular_name' => __('Portfolio Item', THEME_SLUG), 'add_new' => __('Add Portfolio Item', THEME_SLUG), 'add_new_item' => __('Add New Portfolio Item', THEME_SLUG), 'edit_item' => __('Edit Portfolio Item', THEME_SLUG), 'new_item' => __('New Portfolio Item', THEME_SLUG), 'view_item' => __('View Portfolio Item', THEME_SLUG), 'search_items' => __('Search Portfolio Item', THEME_SLUG), 'not_found' => __('No Portfolio Items found', THEME_SLUG), 'not_found_in_trash' => __('No Portfolio Items found in Trash', THEME_SLUG), 'parent_item_colon' => '', 'menu_name' => __('Portfolio', THEME_SLUG)); $portfolio_slug = cws_get_option('portfolio_slug'); $portfolio_slug = !empty($portfolio_slug) ? $portfolio_slug : 'portfolio'; $args = array('labels' => $labels, 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'hierarchical' => true, 'rewrite' => array('slug' => $portfolio_slug), 'supports' => array('title', 'editor', 'thumbnail'), 'menu_position' => 23, 'taxonomies' => array('cws-portfolio-type', 'post_tag')); register_post_type('portfolio', $args); cws_portfolio_register_taxonomies(); }
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(); }
$blogtype = "medium"; $category = !empty($cat) ? array($cat) : cws_get_option("def-home-category"); $posts_per_page = (int) get_option('posts_per_page'); $paged = !empty($_POST['paged']) ? (int) $_POST['paged'] : (!empty($_GET['paged']) ? (int) $_GET['paged'] : (get_query_var("paged") ? get_query_var("paged") : 1)); $sticky = 1 === $paged ? array() : get_option('sticky_posts'); $post_type_array = array("post"); $events_in_blog = false; if (function_exists('tribe_get_option')) { $events_in_blog = tribe_get_option("showEventsInMainLoop"); } if ($events_in_blog) { array_push($post_type_array, "tribe_events"); } $args = array("post_type" => $post_type_array, 'post_status' => 'publish', 'ignore_sticky_posts' => false, 'post__not_in' => $sticky, 'posts_per_page' => $posts_per_page, 'paged' => $paged); /***************** Techinical Category *****************/ $tech_cat = cws_get_option('tech-category'); $tech_cat_array = $tech_cat; // copy if (count($tech_cat) > 0) { for ($i = 0; $i < count($tech_cat); $i++) { $tech_cat[$i] = '-' . $tech_cat[$i]; } $tech_cat = implode(',', $tech_cat); $args["cat"] = $tech_cat; } if (count($category) > 0) { for ($i = 0; $i < count($category); $i++) { if (in_array($category[$i], $tech_cat_array)) { array_splice($category, $i, 1); } }
/** * The Template for displaying product archives, including the main shop page which is a post type archive. * * Override this template by copying it to yourtheme/woocommerce/archive-product.php * * @author WooThemes * @package WooCommerce/Templates * @version 2.0.0 */ if (!defined('ABSPATH')) { exit; } // Exit if accessed directly get_header('shop'); $class_container = 'page-content'; $woo_sb_layout = cws_get_option('def-woo-layout'); $woo_sidebar = ''; if ($woo_sb_layout != 'none') { ob_start(); do_action('woocommerce_sidebar'); $woo_sidebar = ob_get_clean(); $class_container .= !empty($woo_sidebar) ? ' single-sidebar' : ''; } ?> <div class="<?php echo $class_container; ?> "> <div class="container"> <?php
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 cws_pb_icon_selection() { if (function_exists('cws_get_option')) { $font_array = cws_get_option('body-font'); $icon_img_size = $font_array['font-size'] * 1.14 * 1.5; } else { $icon_img_size = 48; } ob_start(); ?> <section class="icon-options"> <div class="row"> <ul class="redux-image-select"> <li class="redux-image-select selected"> <input name="fa" type="radio" value="fa"><i class="fa fa-flag fa-2x"></i> </li> <li class="redux-image-select"> <input name="img" type="radio" value="img"><i class="fa fa-picture-o fa-2x"></i> </li> </ul> </div> <div class="row"> <div class='image-part'> <div class="img-wrapper"> <label for="cws-pb-icons"><?php _e('Tab icon:', THEME_SLUG); ?> </label> <select id="cws-pb-icons" placeholder="Pick an icon for this module" data-placeholder="Pick an icon for this module" name=""> <?php echo cws_pb_print_fa_select(true); ?> </select> </div> <div class="img-wrapper" style="display:none"> <a id="pb-media-cws-pb"><?php _e('Click to select image', THEME_SLUG); ?> </a> <a id="pb-remov-cws-pb" style="display:none"><?php _e('Remove this image', THEME_SLUG); ?> </a> <!-- <input class="image" readonly id="" name="" type="hidden" value /> --> <input class="widefat" readonly id="cws-pb-row-img" name="p_cws-pb-row-img" type="hidden" value="" /> <input class="widefat" readonly id="cws-pb-row-img-id" name="p_cws-pb-row-img-id" type="hidden" value="" /> <img width="<?php echo $icon_img_size; ?> " height="<?php echo $icon_img_size; ?> " id="img-cws-pb" src alt /> </div> </div> </div> </section> <?php ob_end_flush(); }
"> <div class="container"> <div class="benefits_area"> <?php echo $benefits_sb_content; ?> </div> </div> </section> <?php } } } ?> <?php $is_user_logged = is_user_logged_in(); $stick_menu = cws_get_option('menu-stick'); ?> <script type="text/javascript"> var stick_menu = <?php echo isset($stick_menu) ? $stick_menu : true; ?> ; var is_user_logged = <?php echo $is_user_logged ? 'true' : 'false'; ?> ; </script> <!-- HEADER END --> <!--Start main content-->
function cws_accordion_item_renderer($title, $content, $open, $iconfa, $iconimg) { $featured = !empty($iconfa) || !empty($iconimg); $font_array = cws_get_option('body-font'); $iconimg_size = round($font_array['font-size'] * 1.14 * 1.5); $out = "<div class='accordion_section" . ($open ? " active" : "") . ($featured ? " featured" : "") . "'>"; $out .= "<div class='accordion_title'>" . ($featured ? !empty($iconfa) ? "<i class='acc_featured_icon fa fa-{$iconfa}'></i>" : (!empty($iconimg) ? "<span class='acc_featured_img'><img width='{$iconimg_size}' height='{$iconimg_size}' src='" . bfi_thumb($iconimg, array('width' => $iconimg_size . 'px', 'height' => $iconimg_size . 'px')) . "' /></span>" : "") : "") . "{$title}<i class='accordion_icon'></i></div>"; // TITLE $out .= "<div class='accordion_content'" . ($open ? "" : " style='display: none;'") . ">" . do_shortcode($content) . "</div>"; $out .= "</div>"; return $out; }
function cws_put_ganalytics_code() { $gac = cws_get_option('ga-code'); if (!empty($gac)) { echo '<script type="text/javascript">' . $gac . '</script>'; } $gat = cws_get_option('ga-event-tracking'); if (!empty($gat)) { echo '<script type="text/javascript">' . $gat . '</script>'; } }
<?php /** * Sidebar * * @author WooThemes * @package WooCommerce/Templates * @version 1.6.4 */ if (!defined('ABSPATH')) { exit; } // Exit if accessed directly $woo_sidebar = cws_get_option('def-woo-sidebar'); dynamic_sidebar($woo_sidebar);
<?php if (post_password_required()) { ?> <p class="no-comments"><?php __('Sorry, this post is password protected.', THEME_SLUG); ?> </p> <?php return; } $show_comments = cws_get_option('show_comments'); $bIsCommentAllowed = is_page() ? isset($show_comments['pages']) : isset($show_comments['posts']); if ($bIsCommentAllowed) { $comment_form_args = array('comment_notes_before' => '', 'comment_notes_after' => '', 'title_reply' => __('Leave a Comment', THEME_SLUG)); $comment_list_args = array('type' => 'comment', 'avatar_size' => '70', 'callback' => 'cws_clinico_comment_callback', 'style' => 'div'); ob_start(); echo "<div class='grid-row'>"; if (have_comments()) { ?> <section class="comments-part"> <div class='widget-title'><?php echo __('Comments (', THEME_SLUG) . get_comments_number() . ')'; ?> </div> <div class="comments"> <?php wp_list_comments($comment_list_args); ?>
$cont = preg_replace($pattern, $replace, $cont); $cont = preg_replace('/(' . implode('|', $search_terms) . ')/iu', '<mark>\\0</mark>', $cont); if (get_the_title()) { ?> <div class="widget-title"> <?php echo (!isset($post) ? "<a href='" . get_permalink() . "'>" : "") . get_the_title() . (!isset($post) ? "</a>" : ""); ?> </div> <?php } $cont = apply_filters('the_content', $cont); echo $cont; echo "<div class='cats'>" . __("Posted", THEME_SLUG); $categories = get_the_category($post->ID); $show_author = cws_get_option("blog_author"); if (!empty($categories) || $show_author) { if (!empty($categories)) { echo " " . __("in", THEME_SLUG) . " "; for ($i = 0; $i < count($categories); $i++) { echo "<a href='" . get_category_link($categories[$i]->cat_ID) . "'>" . $categories[$i]->name . "</a>"; echo $i < count($categories) - 1 ? ", " : ""; } } if ($show_author) { echo " " . __("by", THEME_SLUG) . " "; $author = get_the_author(); echo !empty($author) ? $author : ""; } } echo "<a href='" . get_permalink() . "' class='more fa fa-long-arrow-right'></a>";
if ($footer_sb_top) { echo "<div class='footer-top-part {$footer_section_class}'><div class='container'><div class='footer_sb_container'><div class='{$sidebar_area_class}'>"; dynamic_sidebar($footer_sb_top); echo "</div></div></div></div>"; } ?> <?php if ($footer_sb_bottom) { echo "<div class='footer-bottom-part {$footer_section_class}'><div class='container'><div class='{$sidebar_area_class}" . (cws_is_wpml_active() && cws_show_flags_in_footer() ? " with_flags" : "") . " clearfix'>"; if (cws_is_wpml_active() && cws_show_flags_in_footer()) { echo "<div class='footer_language_bar'>"; do_action('icl_language_selector'); echo "</div>"; } dynamic_sidebar($footer_sb_bottom); echo "</div></div></div>"; } ?> </footer> <!--End Footer--> <?php // Google Analytics' code $ga_event = cws_get_option('ga-event-tracking'); echo !empty($ga_event) ? '<script type="text/javascript">' . $ga_event . '</script>' : ''; $boxed_layout = '0' != cws_get_option('boxed-layout') ? 'boxed' : ''; echo $boxed_layout ? "</div>" : ""; wp_footer(); ?> </body> </html>
function cws_shortcode_blog($attr, $content) { extract(shortcode_atts(array('title' => '', 'post_count' => '9', 'columns' => '3', 'cats' => ''), $attr)); $args = array('post_type' => 'post', 'post_status' => 'publish', 'ignore_sticky_posts' => false, 'posts_per_page' => $post_count); $tech_cat = cws_get_option('tech-category'); $tech_cat = isset($tech_cat) ? $tech_cat : array(); $tech_cat_array = $tech_cat; // copy if (count($tech_cat) > 0) { for ($i = 0; $i < count($tech_cat); $i++) { $tech_cat[$i] = '-' . $tech_cat[$i]; } $tech_cat = implode(',', $tech_cat); $args["cat"] = $tech_cat; } if (!empty($cats)) { $cats = explode(",", $cats); for ($i = 0; $i < count($cats); $i++) { $cats[$i] = get_category_by_slug($cats[$i])->term_id; } for ($i = 0; $i < count($cats); $i++) { if (in_array($cats[$i], $tech_cat_array)) { array_splice($cats, $i, 1); } } if (count($cats) > 0) { $cats = implode(",", $cats); if (isset($args["cat"])) { $args["cat"] .= "," . $cats; } else { $args["cat"] = $cats; } } } $r = new WP_Query($args); ob_start(); ?> <div class="cws_widget"> <div class="cws_widget_content blog"> <?php echo !empty($title) ? "<div class='widget-title'>{$title}</div>" : ""; ?> <section class="news news-pinterest <?php echo 'news-' . $columns; ?> "> <div class="grid isotope"> <?php cws_blog_output($r, $post_count, $post_count, 'pinterest', $columns, 'none', 1); ?> </div> </section> </div> </div> <?php return ob_get_clean(); }
$blogtype = 'small'; $posts_per_page = (int) get_option('posts_per_page'); $paged = !empty($_GET['paged']) ? (int) $_GET['paged'] : 1; $args = array('post_type' => 'staff', 'post_status' => 'publish', 'ignore_sticky_posts' => false, 'posts_per_page' => $posts_per_page, 'paged' => $paged); if (!empty($_GET['docname'])) { $args['cws_search_title'] = $_GET['docname']; } if (!empty($_GET['cws-stafftreatments'])) { $args['tax_query'] = array(array('taxonomy' => 'cws-staff-treatments', 'field' => 'slug', 'terms' => $_GET['cws-stafftreatments'])); } add_filter('posts_where', 'title_filter', 10, 2); $r = new WP_Query($args); remove_filter('posts_where', 'title_filter', 10, 2); $total_post_count = $r->found_posts; $max_page = $total_post_count % $posts_per_page ? ceil($total_post_count / $posts_per_page) : $total_post_count / $posts_per_page; $sb = array('sidebar_pos' => cws_get_option("def-page-layout"), 'sidebar1' => cws_get_option("def-page-sidebar1"), 'sidebar2' => cws_get_option("def-page-sidebar2")); $sb_block = $sb['sidebar_pos']; get_header(); $class_container = 'page-content' . (cws_has_sidebar_pos($sb_block) ? 'both' == $sb_block ? ' double-sidebar' : ' single-sidebar' : ''); ?> <div class="<?php echo $class_container; ?> "> <div class="container"> <?php if (cws_has_sidebar_pos($sb_block)) { if ('both' == $sb_block) { echo '<aside class="sbleft">'; dynamic_sidebar($sb['sidebar1']); echo '</aside>';