'.get_bloginfo('description').'

'; } } /** * Default menu to use if custom menu is not used */ function bizwiz_page_menu_args($args) { $args['show_home'] = false; $args['menu_class'] = 'primary-menu'; return $args; } add_filter('wp_page_menu_args', 'bizwiz_page_menu_args'); /** * Removing default gallery style */ add_filter('use_default_gallery_style', '__return_false'); /** * Filters Title for the Site */ function bizwiz_filter_wp_title($title) { $site_name = get_bloginfo('name'); if(trim($title) != '') { $title = str_replace('»','',$title); $filtered_title = $title.' | '.$site_name; } else $filtered_title = $site_name; if (is_front_page()) { $site_description = get_bloginfo('description'); if(trim($site_description) != '') $filtered_title .= ' | '.$site_description; } return $filtered_title; } add_filter('wp_title', 'bizwiz_filter_wp_title'); /** * Register sidebars and widgetized areas */ function bizwiz_widgets_init() { register_sidebar(array( 'name' => __('Primary Sidebar', 'bizwiz'), 'id' => 'sidebar-1', 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => __('Footer Widget Area 1', 'bizwiz'), 'id' => 'sidebar-2', 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => __('Footer Widget Area 2', 'bizwiz'), 'id' => 'sidebar-3', 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => __('Footer Widget Area 3', 'bizwiz'), 'id' => 'sidebar-4', 'before_widget' => '", 'before_title' => '

', 'after_title' => '

', )); } add_action('widgets_init', 'bizwiz_widgets_init'); /** * Count the number of footer widget areas to enable dynamic classes for the footer */ function bizwiz_footer_widget_class() { $count = 0; if(is_active_sidebar('sidebar-2')) $count++; if(is_active_sidebar('sidebar-3')) $count++; if(is_active_sidebar('sidebar-4')) $count++; $class = ''; switch($count) { case '1': $class = 'one'; break; case '2': $class = 'two'; break; case '3': $class = 'three'; break; } if($class) echo 'class="'.$class.'"'; } /** * Prints HTML with meta information for the current post-date/time and author. * Create your own bizwiz_posted_on to override in a child theme */ if (!function_exists('bizwiz_posted_on')): function bizwiz_posted_on() { printf(__('%3$s', 'bizwiz'), esc_url(get_permalink()), esc_attr(get_the_time()), esc_html(get_the_date('M j, Y')), esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_attr(sprintf(__('View all posts by %s', 'bizwiz'), get_the_author())), get_the_author() ); } endif; /** * Author Info */ function bizwiz_author_info() { global $bizwiz_options; $output = ""; if(is_singular() && get_the_author_meta('description') && is_multi_author() && $bizwiz_options['show_author_info']) { $output .= '
'; $output .= '
'; $output .= get_avatar(get_the_author_meta('user_email'), apply_filters('bizwiz_author_bio_avatar_size', 48)); $output .= '
'; $output .= '
'; $output .= '

'.__('About ', 'bizwiz').get_the_author().'

'; $output .= '

'.get_the_author_meta('description').'

'; $output .= '

'; $output .= '
'; $output .= '
'; } echo $output; } /** * Utility List */ function bizwiz_utility_list() { global $bizwiz_options; $output = ""; $categories_list = get_the_category_list(__(', ','bizwiz')); $tag_list = get_the_tag_list(__('Tags: ','bizwiz'),__(', ','bizwiz'),''); if($categories_list != "" and $bizwiz_options['show_categories']) $output .= '

'.__('Categories: ','bizwiz').''.$categories_list.'

'; if($tag_list != "" and $bizwiz_options['show_tags']) $output .= '

'.$tag_list.'

'; if($output != "") $output = '
'.$output.'
'; echo $output; } /** * Sets the post excerpt length to 40 words. * * To override this length in a child theme, remove the filter and add your own * function tied to the excerpt_length filter hook. */ function bizwiz_excerpt_length($length) { return 60; } add_filter('excerpt_length', 'bizwiz_excerpt_length'); /** * Returns a Read more link for excerpts */ function bizwiz_continue_reading_link() { return '...'; } /** * Replaces "[...]" (appended to automatically generated excerpts) with a bizwiz_continue_reading_link(). * * To override this in a child theme, remove the filter and add your own * function tied to the excerpt_more filter hook. */ function bizwiz_auto_excerpt_more($more) { return bizwiz_continue_reading_link(); } add_filter('excerpt_more', 'bizwiz_auto_excerpt_more'); /** * Adds a pretty "Continue Reading" link to custom post excerpts. * * To override this link in a child theme, remove the filter and add your own * function tied to the get_the_excerpt filter hook. */ function bizwiz_custom_excerpt_more( $output ) { if(has_excerpt() && !is_attachment()) { $output .= bizwiz_continue_reading_link(); } return $output; } add_filter('get_the_excerpt', 'bizwiz_custom_excerpt_more'); /** * Get Post Thumbnail images or first attachment in post */ function bizwiz_get_post_image($postid = "", $title = '', $defaultsize = "", $arraysize = array()) { global $post, $posts; if($postid == "") $postid = $post->ID; if($defaultsize == '' and empty($arraysize)) $defaultsize = 'thumbnail'; $attachmentid = 0; $thumbattr = array('title' => esc_html($title)); if(has_post_thumbnail($postid)) { $attachmentid = get_post_thumbnail_id($postid); if($defaultsize == "") $postimage = get_the_post_thumbnail($postid,$arraysize,$thumbattr); else $postimage = get_the_post_thumbnail($postid,$defaultsize,$thumbattr); } else { $contentimages = get_posts(array('post_type'=>'attachment', 'post_parent'=>$postid)); foreach($contentimages as $entry) { $attachmentid = $entry->ID; break; } if($attachmentid != "" and $attachmentid > 0) { if($defaultsize == "") $postimage = wp_get_attachment_image($attachmentid,$arraysize,false,$thumbattr); else $postimage = wp_get_attachment_image($attachmentid,$defaultsize,false,$thumbattr); } else $postimage = ""; } return $postimage; } if(!function_exists('bizwiz_comment')): /** * Template for comments and pingbacks. * * To override this walker in a child theme without modifying the comments template * simply create your own bizwiz_comment(), and that function will be used instead. * * Used as a callback by wp_list_comments() for displaying the comments. * */ function bizwiz_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; switch($comment->comment_type): case 'pingback': case 'trackback': ?>
  • id="li-comment-">
  • id="li-comment-">
    ', ', 'reply_text' => __('Reply', 'bizwiz'), 'depth' => $depth, 'max_depth' => $args['max_depth']))); ?>
    comment_approved == '0'): ?>

    max_num_pages; } if($max_page > 1){ echo ''."\n"; } } /** * Displays breadcrumbs */ function bizwiz_breadcrumbs() { $delimiter = '»'; $home = __('Home','bizwiz'); // text for the 'Home' link $before = ''; // tag before the current crumb $after = ''; // tag after the current crumb if (!is_home() && !is_front_page() || is_paged()) { echo '
    '; global $post; $homeLink = home_url(); echo ''.$home.' '.$delimiter.' '; if (is_category()) { global $wp_query; $cat_obj = $wp_query->get_queried_object(); $thisCat = $cat_obj->term_id; $thisCat = get_category($thisCat); $parentCat = get_category($thisCat->parent); if ($thisCat->parent != 0) echo(get_category_parents($parentCat, TRUE, ' '.$delimiter.' ')); echo $before.__('Archive by category','bizwiz').' "'.single_cat_title('', false).'"'.$after; } elseif (is_day()) { echo ''.get_the_time('Y').' '.$delimiter.' '; echo ''.get_the_time('F').' '.$delimiter.' '; echo $before.get_the_time('d').$after; } elseif (is_month()) { echo ''.get_the_time('Y').' '.$delimiter.' '; echo $before.get_the_time('F').$after; } elseif (is_year()) { echo $before.get_the_time('Y').$after; } elseif (is_single() && !is_attachment()) { if (get_post_type() != 'post') { $post_type = get_post_type_object(get_post_type()); $slug = $post_type->rewrite; echo ''.$post_type->labels->singular_name.' '.$delimiter.' '; echo $before.get_the_title().$after; } else { $cat = get_the_category(); $cat = $cat[0]; echo get_category_parents($cat, TRUE, ' '.$delimiter.' '); echo $before.get_the_title().$after; } } elseif (is_attachment()) { $parent = get_post($post->post_parent); $cat = get_the_category($parent->ID); $cat = $cat[0]; echo get_category_parents($cat, TRUE, ' '.$delimiter.' '); echo ''.$parent->post_title.' '.$delimiter.' '; echo $before.get_the_title().$after; } elseif (is_page() && !$post->post_parent) { echo $before.get_the_title().$after; } elseif (is_page() && $post->post_parent) { $parent_id = $post->post_parent; $breadcrumbs = array(); while ($parent_id) { $page = get_page($parent_id); $breadcrumbs[] = ''.get_the_title($page->ID).''; $parent_id = $page->post_parent; } $breadcrumbs = array_reverse($breadcrumbs); foreach ($breadcrumbs as $crumb) echo $crumb.' '.$delimiter.' '; echo $before.get_the_title().$after; } elseif (is_search()) { echo $before.__('Search results for','bizwiz').' "'.get_search_query().'"'.$after; } elseif (is_tag()) { echo $before.__('Posts tagged','bizwiz').' "'.single_tag_title('', false).'"'.$after; } elseif (is_author()) { global $author; $userdata = get_userdata($author); echo $before.__('Articles posted by','bizwiz').' '.$userdata->display_name.$after; } elseif (is_404()) { echo $before.__('Error 404','bizwiz').' '. $after; } if (get_query_var('paged')) { if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()) echo ' ('; echo __('Page','bizwiz').' '.get_query_var('paged'); if (is_category() || is_day() || is_month() || is_year() || is_search() || is_tag() || is_author()) echo ')'; } echo '
    '; } } /** * Function to return darker color shade */ function bizwiz_color_darken($color, $dif=80){ $color = str_replace('#', '', $color); if (strlen($color) != 6){ return '000000'; } $rgb = ''; for ($x=0;$x<3;$x++){ $c = hexdec(substr($color,(2*$x),2)) - $dif; $c = ($c < 0) ? 0 : dechex($c); $rgb .= (strlen($c) < 2) ? '0'.$c : $c; } return $rgb; } /** * Function to trim words */ function bizwiz_trim_text($input, $length, $ellipses = true, $strip_html = true) { if($strip_html) { $input = strip_tags($input); } if(strlen($input) <= $length) { return $input; } $last_space = strrpos(substr($input, 0, $length), ' '); $trimmed_text = substr($input, 0, $last_space); if($ellipses) { $trimmed_text .= '...'; } return $trimmed_text; } ?>