*/ /* ======================================================================================================== * Set Up * ======================================================================================================== */ /* ---- load files ---------------*/ require(get_template_directory() . '/library/blogBox_options.php'); require(get_template_directory() . '/library/blogBox_post_functions.php'); require(get_template_directory() . '/widgets/blogBox_social_widget.php'); /* ---- Set content width --------*/ if(!isset( $content_width )) $content_width = 600; function blogBox_theme_supports(){ //enable translation load_theme_textdomain('blogBox', get_template_directory() . '/language'); /* ------------editor-style -------------------- */ add_editor_style(); // ADD POST FORMATS add_theme_support( 'post-formats', array( 'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video' ) ); //Custom Backgrounds add_theme_support('custom-background'); //custom header $bB_header_args = array( 'flex-width' => true, 'width' => 960, 'flex-height' => true, 'height' => 320, 'header-text' => false, 'default-image' => '', 'uploads' => true, ); add_theme_support('custom-header',$bB_header_args); //feeds add_theme_support('automatic-feed-links'); //thumbnails add_theme_support('post-thumbnails'); add_image_size('wide_thumbnail',180,120); } add_action('after_setup_theme', 'blogBox_theme_supports'); /* ********* Set up Menu in Dashboard under Appearance ************** */ function blogBox_register_menu() { register_nav_menu('primary-nav','Primary Menu'); } add_action( 'init', 'blogBox_register_menu' ); /** * Register Side bars * Thans to Justin Tadlock for the post on sidebars * @link http://justintadlock.com/archives/2010/11/08/sidebars-in-wordpress */ if (!function_exists ( 'blogBox_register_sidebars' )) { function blogBox_register_sidebars() { // Sidebars and footer areas register_sidebar(array( 'id' => 'blogbox_default_sidebar', 'name'=>'Default-Sidebar', 'description' => __( 'Default sidebar', 'blogBox' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); register_sidebar(array( 'id' => 'blogbox_header_sidebar', 'name'=>'Header-Sidebar', 'description' => __( 'Placed in upper right hand corner of header', 'blogBox' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); register_sidebar(array( 'id' => 'blogbox_feature', 'name'=>'Feature Area', 'description' => __( 'Feature widgetized area', 'blogBox' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); register_sidebar(array( 'id' => 'blogbox_left_sidebar', 'name'=>'Left-Sidebar', 'description' => __( 'Sidebar for left side of page', 'blogBox' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); register_sidebar(array( 'id' => 'blogbox_left_sidebar_2', 'name'=>'Left-Sidebar 2', 'description' => __( 'Sidebar for left side page 2', 'blogBox' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); register_sidebar(array( 'id' => 'blogbox_right_sidebar', 'name'=>'Right-Sidebar', 'description' => __( 'Sidebar for right side of page', 'blogBox' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); register_sidebar(array( 'id' => 'blogbox_right_sidebar_2', 'name'=>'Right-Sidebar 2', 'description' => __( 'Sidebar for right side page 2', 'blogBox' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); register_sidebar(array( 'id' => 'blogbox_contact_sidebar', 'name'=>'Contact-Sidebar', 'description' => __( 'Sidebar for contact page', 'blogBox' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); register_sidebar(array( 'id' => 'blogbox_404_sidebar', 'name'=>'Sidebar-404', 'description' => __( 'Sidebar for 404 page', 'blogBox' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); register_sidebar(array( 'id' => 'blogbox_footer_a', 'name'=>'Footer A', 'description' => __( 'Use this for the first footer column', 'blogBox' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); register_sidebar(array( 'id' => 'blogbox_footer_b', 'name'=>'Footer B', 'description' => __( 'Use this for the second footer column', 'blogBox' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); register_sidebar(array( 'id' => 'blogbox_footer_c', 'name'=>'Footer C', 'description' => __( 'Use this for the third footer column', 'blogBox' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); register_sidebar(array( 'id' => 'blogbox_footer_d', 'name'=>'Footer D', 'description' => __( 'Use this for the fourth footer column', 'blogBox' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); } add_action( 'widgets_init', 'blogBox_register_sidebars' ); } /* ======================================================================================================== * Scripts and Styles * ======================================================================================================== */ define('BLOGBOX_JS', get_template_directory_uri() . '/js' ); if ( !function_exists ('blogBox_load_js')){ function blogBox_load_js() { if(!is_admin()){ global $blogBox_option,$wp_version; $blogBox_option = blogBox_get_options(); wp_enqueue_script('jquery'); wp_enqueue_script( 'superfish', BLOGBOX_JS . '/superfish/superfish.min.js', array( 'jquery' ), '' ); wp_enqueue_script( 'easing', BLOGBOX_JS . '/jquery.easing.1.3.js', array( 'jquery' ), '' ); wp_enqueue_script( 'slides', BLOGBOX_JS . '/nivo-slider/jquery.nivo.slider.pack.js', array( 'jquery' ), '' ); wp_enqueue_script( 'blogBox_custom', BLOGBOX_JS . '/doc_ready_scripts.js', array( 'jquery' ), '' ); if ( $blogBox_option['bB_disable_fitvids'] != 1 ) { wp_enqueue_script( 'blogBox_fitvids', BLOGBOX_JS . '/jquery.fitvids.js', array( 'jquery' ), '' ); wp_enqueue_script( 'blogBox_fitvids_doc_ready', BLOGBOX_JS . '/fitvids-doc-ready.js', array( 'jquery' ), '' ); } if ( $blogBox_option['bB_include_mobile_design'] == 1 ) { wp_enqueue_script( 'mobile_doc_ready', get_template_directory_uri() . '/js/mobile-doc-ready.js', array( 'jquery' ), '' ); } if ( $wp_version < 3.6 ) { if ( $blogBox_option['bB_disable_audiojs'] != 1 ) { wp_enqueue_script( 'audiojs', get_template_directory_uri() . '/js/audiojs/audio.js', array( 'jquery' ), '' ); wp_enqueue_script( 'audiojs_doc_ready', get_template_directory_uri() . '/js/audiojs/audiojs-doc-ready.js', array( 'jquery' ), '' ); } } else { /*Put in a forum post in the beta section, in the GitHub, and stackoverflow regarding the problem of responsiveness. I got no response so I hacked the plugin myself.*/ wp_deregister_script('mediaelement'); wp_enqueue_script('mediaelement',get_template_directory_uri() . '/js/mediaelement-and-player-min.js', array( 'jquery' ), '' ,true); } if ( $blogBox_option['bB_disable_colorbox'] != 1 ) { wp_enqueue_script( 'colorbox', get_template_directory_uri() . '/js/colorbox/jquery.colorbox-min.js', array( 'jquery' ), '' ); wp_enqueue_script( 'colorbox_doc_ready', get_template_directory_uri() . '/js/colorbox/colorbox_doc_ready.js', array( 'jquery' ), '' ); } } } add_action('init', 'blogBox_load_js'); } if ( !function_exists ('blogBox_styles')) { function blogBox_styles() { global $blogBox_option,$wp_version; $blogBox_option = blogBox_get_options(); wp_register_style( 'main_style',get_stylesheet_directory_uri() . '/style.css',array() ); wp_enqueue_style( 'main_style' ); wp_register_style( 'nivo_style',get_template_directory_uri() . '/js/nivo-slider/nivo-slider.css',array() ); wp_enqueue_style( 'nivo_style' ); wp_register_style( 'nivo_style_theme',get_template_directory_uri() . '/js/nivo-slider/themes/default/default.css',array() ); wp_enqueue_style( 'nivo_style_theme' ); wp_register_style( 'superfish_style',get_template_directory_uri() . '/js/superfish/superfish.css',array() ); wp_enqueue_style( 'superfish_style' ); wp_register_style( 'font_awesome_style',get_template_directory_uri() . '/font-awesome/css/font-awesome.min.css',array() ); wp_enqueue_style( 'font_awesome_style' ); if ( $wp_version < 3.6 ) { if ( $blogBox_option['bB_disable_audiojs'] != 1 ) { wp_register_style( 'audiojs_style',get_template_directory_uri() . '/js/audiojs/audiojs.css',array() ); wp_enqueue_style( 'audiojs_style' ); } } if ( $blogBox_option['bB_disable_colorbox'] != 1 ) { wp_register_style( 'colorbox_style',get_template_directory_uri() . '/js/colorbox/colorbox.css',array() ); wp_enqueue_style( 'colorbox_style' ); } if ( $blogBox_option['bB_include_mobile_design'] == 1 ) { wp_register_style( 'mobile_style',get_template_directory_uri() . '/css/mobile.css',array() ); wp_enqueue_style( 'mobile_style' ); } } add_action('wp_enqueue_scripts', 'blogBox_styles'); } if ( !function_exists ('blogBox_setup')){// load custom styles and fonts function blogbox_setup(){ include( get_template_directory() . '/library/custom-fonts.php' ); include( get_template_directory() . '/library/custom-styles.php' ); } add_action( 'wp_print_styles', 'blogbox_setup' ); } if ( !function_exists ('blogBox_enqueue_ie_script')){//Script for loading js shiv for ie HTML5 function blogBox_enqueue_ie_script() { global $is_IE; if ( $is_IE ) { wp_register_script( 'ie_html5_shiv', BLOGBOX_JS.'/html5.js', array( 'jquery' ), ''); wp_enqueue_script('ie_html5_shiv'); } } add_action('wp_enqueue_scripts', 'blogBox_enqueue_ie_script'); } if ( !function_exists ('blogBox_title_filter')){ function blogBox_title_filter($title) { if(is_front_page()) { $return = 'home | '.get_bloginfo( 'name' ); } else { $return = $title.' | '.get_bloginfo( 'name' ); } return $return; } add_filter( 'wp_title', 'blogBox_title_filter', 10, 3 ); } /* ======================================================================================================== * Comments and Pingbacks * ======================================================================================================== */ /** * Javascript setup for threaded comments */ if ( !function_exists ('blogBox_enqueue_comment_reply_script')){//enque of enque reply script as per http://make.wordpress.org/themes/tag/guidelines/ function blogBox_enqueue_comment_reply_script() { if (is_singular() && comments_open() && (get_option('thread_comments') == 1)) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'blogBox_enqueue_comment_reply_script' ); } if ( !function_exists ('blogBox_cleanPings')){// clean pingbacks and trackbacks function blogBox_cleanPings($comment, $args, $depth) { $GLOBALS['comment'] = $comment; echo '
  • '; echo comment_author_link().'  '; edit_comment_link('Edit'); echo '

  • '; } } /** * Custom Comments Display * @link http://codex.wordpress.org/Function_Reference/wp_list_comments * * */ if (!function_exists ('blogBox_comment')){ function blogBox_comment($comment, $args, $depth) { global $blogBox_option; $blogBox_option = blogBox_get_options(); $exclude_mystery_gravatar = $blogBox_option['bB_exclude_mystery_gravatar']; $GLOBALS['comment'] = $comment; extract($args, EXTR_SKIP); if ( 'div' == $args['style'] ) { $tag = 'div'; $add_below = 'comment'; } else { $tag = 'li'; $add_below = 'div-comment'; } ?> < id="comment-">
    comment_ID)); If ( $has_valid_avatar == 1 ) { if ($args['avatar_size'] != 0) echo get_avatar( $comment, $args['avatar_size'] ); } } else { if ($args['avatar_size'] != 0) echo get_avatar( $comment, $args['avatar_size'] ); } ?> %s says:'), get_comment_author()) ?>
    comment_approved == '0') : ?>

    $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
    Verification Captcha Verification Captcha

    Verification Captcha Verification Captcha post_excerpt; if ( '' == $text ) { $text = get_the_content(''); $text = apply_filters('the_content', $text); $text = str_replace(']]>', ']]>', $text); } //I'm checking for my own conatct-pizazz plug-in here so that you can include the shortcodes I know about. if (function_exists('content_pizazz_list_func()')) { $text = do_shortcode($text); } else { strip_shortcodes($text); } $text = strip_tags($text,'



    1. '); $output = strlen($text); if($output > $length ) { $break_pos = strpos($text, ' ', $length);//find next space after desired length if($break_pos == '')$break_pos = $length; $text = substr($text,0,$break_pos); $text = $text.' [...]'; $text = force_balance_tags($text); } echo apply_filters('the_excerpt',$text); } } if ( !function_exists ('blogBox_portfolio_titles')){//function to limit characters in portfolio titles function blogBox_portfolio_titles($content,$limit){ $content = strip_tags($content); if(strlen($content) > $limit){ $visible = substr($content, 0, $limit); $visible = $visible.' ...'; } else { $visible = $content; } //return $visible; echo strip_tags(apply_filters('the_excerpt',$visible)); } } if ( !function_exists ('blogBox_portfolio_feature_description')){//function to limit characters in portfolio titles function blogBox_portfolio_feature_description($content,$limit){ $content = do_shortcode($content); $content = strip_tags($content,'


      1. '); if(strlen($content) > $limit){ $break_pos = strpos($content, ' ', $limit);//find next space after desired length if($break_pos == '')$break_pos = $limit; $visible = substr($content, 0, $break_pos); $visible = $visible.' ...'; $visible = force_balance_tags($visible); } else { $visible = $content; } echo apply_filters('the_content',$visible); } } /* * --------------------HTML Validation Filters ------------------------ * the rel tag does not validate it says it does not like the term category * Discussion at wordpess.org suggests it is an HTML/W#C issue.Browsers do * not use this attribute in any way. However, search engines can use this * attribute to get more information about a link. */ if ( !function_exists ('blogBox_html5_fix_the_category')){//rel tag validation fix function blogBox_html5_fix_the_category($content) { $pattern = '/rel="category tag"/'; $replacement = 'rel="tag"'; $content = preg_replace($pattern, $replacement, $content); return $content; } add_filter('the_category','blogBox_html5_fix_the_category'); } /* * Plugin Name: Shortcode Empty Paragraph Fix * Plugin URI: http://www.johannheyne.de/wordpress/shortcode-empty-paragraph-fix/ * Description: Fix issues when shortcodes are embedded in a block of content that is filtered by wpautop. * Author URI: http://www.johannheyne.de * Version: 0.1 * Put this in /wp-content/plugins/ of your Wordpress installation */ if ( !function_exists ('blogBox_shortcode_paragraph_insertion_fix')){//Empty Paragraph Fix function blogBox_shortcode_paragraph_insertion_fix($content) { $array = array ( '

        [' => '[', ']

        ' => ']', ']
        ' => ']', ']
        ' => ']' ); $content = strtr($content, $array); return $content; } add_filter('the_content', 'blogBox_shortcode_paragraph_insertion_fix'); } add_filter('widget_text', 'do_shortcode');// Allows shortcodes to be displayed in sidebar widgets /* ======================================================================================================== * Miscelaneous * ======================================================================================================== */ if ( !function_exists ('blogBox_validEmail')){ function blogBox_validEmail($email) { $isValid = true; $atIndex = strrpos($email, "@"); if (is_bool($atIndex) && !$atIndex) { $isValid = false; } else { $domain = substr($email, $atIndex+1); $local = substr($email, 0, $atIndex); $localLen = strlen($local); $domainLen = strlen($domain); if ($localLen < 1 || $localLen > 64) { // local part length exceeded $isValid = false; } else if ($domainLen < 1 || $domainLen > 255) { // domain part length exceeded $isValid = false; } else if ($local[0] == '.' || $local[$localLen-1] == '.') { // local part starts or ends with '.' $isValid = false; } else if (preg_match('/\\.\\./', $local)) { // local part has two consecutive dots $isValid = false; } else if (!preg_match('/^[A-Za-z0-9\\-\\.]+$/', $domain)) { // character not valid in domain part $isValid = false; } else if (preg_match('/\\.\\./', $domain)) { // domain part has two consecutive dots $isValid = false; } else if(!preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/', str_replace("\\\\","",$local))) { // character not valid in local part unless // local part is quoted if (!preg_match('/^"(\\\\"|[^"])+"$/', str_replace("\\\\","",$local))) { $isValid = false; } } if ($isValid && !(checkdnsrr($domain,"MX") || checkdnsrr($domain,"A"))) { // domain not found in DNS $isValid = false; } } return $isValid; } } /** * blogBox exclude categories * * This helper function is used in page-home-blog.php and index.php. * It returns an exclusion string for $wp-query, and is based on user settings to * eclude the Feature and Portfolio categories. * * @return $exclude_categories */ if ( !function_exists ('blogBox_exclude_categories')){//Exclude categories helper function blogBox_exclude_categories () { $blogBox_option = blogBox_get_options(); $exclude_categories = "'"; $feature_cat_ID = get_cat_ID('Feature'); $portfolioA_cat_ID = get_cat_ID(sanitize_text_field($blogBox_option['bB_portfolioA_category'])); $portfolioB_cat_ID = get_cat_ID(sanitize_text_field($blogBox_option['bB_portfolioB_category'])); $portfolioC_cat_ID = get_cat_ID(sanitize_text_field($blogBox_option['bB_portfolioC_category'])); $portfolioD_cat_ID = get_cat_ID(sanitize_text_field($blogBox_option['bB_portfolioD_category'])); $portfolioE_cat_ID = get_cat_ID(sanitize_text_field($blogBox_option['bB_portfolioE_category'])); if ($feature_cat_ID !== 0 && $blogBox_option['bB_showfeaturepost'] == 0) $exclude_categories = $exclude_categories . "-" . $feature_cat_ID; if ($portfolioA_cat_ID !== 0 && $blogBox_option['bB_showfeatureApost'] == 0 && $exclude_categories !== "'") { $exclude_categories = $exclude_categories . ",-" . $portfolioA_cat_ID; } elseif ($portfolioA_cat_ID !== 0 && $blogBox_option['bB_showfeatureApost'] == 0 && $exclude_categories == "'") { $exclude_categories = $exclude_categories . "-" . $portfolioA_cat_ID; } if ($portfolioB_cat_ID !== 0 && $blogBox_option['bB_showfeatureBpost'] == 0 && $exclude_categories !== "'") { $exclude_categories = $exclude_categories . ",-" . $portfolioB_cat_ID; } elseif ($portfolioB_cat_ID !== 0 && $blogBox_option['bB_showfeatureBpost'] == 0 && $exclude_categories == "'") { $exclude_categories = $exclude_categories . "-" . $portfolioB_cat_ID; } if ($portfolioC_cat_ID !== 0 && $blogBox_option['bB_showfeatureCpost'] == 0 && $exclude_categories !== "'") { $exclude_categories = $exclude_categories . ",-" . $portfolioC_cat_ID; } elseif ($portfolioC_cat_ID !== 0 && $blogBox_option['bB_showfeatureCpost'] == 0 && $exclude_categories == "'") { $exclude_categories = $exclude_categories . "-" . $portfolioC_cat_ID; } if ($portfolioD_cat_ID !== 0 && $blogBox_option['bB_showfeatureDpost'] == 0 && $exclude_categories !== "'") { $exclude_categories = $exclude_categories . ",-" . $portfolioD_cat_ID; } elseif ($portfolioD_cat_ID !== 0 && $blogBox_option['bB_showfeatureDpost'] == 0 && $exclude_categories == "'") { $exclude_categories = $exclude_categories . "-" . $portfolioD_cat_ID; } if ($portfolioE_cat_ID !==0 && $blogBox_option['bB_showfeatureEpost'] == 0 && $exclude_categories !== "'") { $exclude_categories = $exclude_categories . ",-" . $portfolioE_cat_ID; } elseif ($portfolioE_cat_ID !== 0 && $blogBox_option['bB_showfeatureEpost'] == 0 && $exclude_categories == "'") { $exclude_categories = $exclude_categories . "-" . $portfolioE_cat_ID; } $exclude_categories = $exclude_categories . "'" ; return $exclude_categories; } } /** * Custom WordPress Gallery code * * Remove Wordpress gallery shortcode and add our own. The purpose is to remove the css from * being injected into the post, and to fix the dd error. * Basis is from @link http://wpengineer.com/1802/a-solution-for-the-wordpress-gallery/ * * Note : This is not set up as a conditional load because it will not work. Therefore you can't * modify this function in a child theme * */ //deactivate WordPress function remove_shortcode('gallery', 'gallery_shortcode'); //activate own function add_shortcode('gallery', 'blogBox_gallery_shortcode'); //the own renamed function function blogBox_gallery_shortcode($attr) { $post = get_post(); static $instance = 0; $instance++; if ( ! empty( $attr['ids'] ) ) { // 'ids' is explicitly ordered, unless you specify otherwise. if ( empty( $attr['orderby'] ) ) $attr['orderby'] = 'post__in'; $attr['include'] = $attr['ids']; } // Allow plugins/themes to override the default gallery template. $output = apply_filters('post_gallery', '', $attr); if ( $output != '' ) return $output; // We're trusting author input, so let's at least make sure it looks like a valid orderby statement if ( isset( $attr['orderby'] ) ) { $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] ); if ( !$attr['orderby'] ) unset( $attr['orderby'] ); } extract(shortcode_atts(array( 'order' => 'ASC', 'orderby' => 'menu_order ID', 'id' => $post->ID, 'itemtag' => 'dl', 'icontag' => 'dt', 'captiontag' => 'dd', 'columns' => 3, 'size' => 'thumbnail', 'include' => '', 'exclude' => '' ), $attr)); $id = intval($id); if ( 'RAND' == $order ) $orderby = 'none'; if ( !empty($include) ) { $_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); $attachments = array(); foreach ( $_attachments as $key => $val ) { $attachments[$val->ID] = $_attachments[$key]; } } elseif ( !empty($exclude) ) { $attachments = get_children( array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); } else { $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) ); } if ( empty($attachments) ) return ''; if ( is_feed() ) { $output = "\n"; foreach ( $attachments as $att_id => $attachment ) $output .= wp_get_attachment_link($att_id, $size, true) . "\n"; return $output; } $itemtag = tag_escape($itemtag); $captiontag = tag_escape($captiontag); $columns = intval($columns); //$itemwidth = $columns > 0 ? floor(100/$columns) : 100; $float = is_rtl() ? 'right' : 'left'; $selector = "gallery-{$instance}"; $output = apply_filters('gallery_style', "\n"; return $output; } if ( !function_exists ('blogBox_feature_slider')){ function blogBox_feature_slider() { global $blogBox_option; $blogBox_option = blogBox_get_options(); $feature_option = sanitize_text_field($blogBox_option['bB_home1feature_options']); $use_feature_widget_area = $blogBox_option['bB_use_feature_widget']; echo '
        '; if( $feature_option == "Full feature slides" ) { echo '
        '; echo '
        '; echo '
        '; } elseif ( $feature_option == "Full feature slides-thumbnails" ) { echo '
        '; echo '
        '; echo '
        '; } elseif ( $feature_option == "Small slides and feature text box" ) { echo '
        '; echo '
        '; echo '
        '; } elseif ( $feature_option == "Small slides and feature text box-thumbnails" ) { echo '
        '; echo '
        '; echo '
        '; } elseif ( $feature_option == "Small single image and feature text box" ) { $category_ID = get_cat_ID('Feature'); global $post; $args = array('category'=>$category_ID,'numberposts'=>1); $custom_posts = get_posts($args); if ($category_ID !== 0 && $custom_posts){ $post = $custom_posts[0]; echo '
        '; if (has_post_thumbnail()) { $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID),'full') ; $image_url = $thumb[0]; $title = get_post(get_post_thumbnail_id())->post_excerpt; echo ''; echo ''.$title.''; echo ''; } else { echo '
        '; echo '

        '.__('Error: There were no feature images found?','blogBox').'

        '; echo '
        '; return; } echo '
        '; } else { echo ''; } } elseif ( $feature_option == "Full single image" ) { $category_ID = get_cat_ID('Feature'); global $post; $args = array('category'=>$category_ID,'numberposts'=>1); $custom_posts = get_posts($args); if ($category_ID !== 0 && $custom_posts){ $post = $custom_posts[0]; echo '
        '; if (has_post_thumbnail()) { $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID),'full') ; $image_url = $thumb[0]; $title = get_post(get_post_thumbnail_id())->post_excerpt; echo ''; echo ''.$title.''; echo ''; } else { echo '
        '; echo '

        '.__('Error: There were no feature images found?','blogBox').'

        '; echo '
        '; return; } echo '
        '; } else { echo 'Default Feature Slide'; } } if ( $feature_option != 'Small single image and feature text box' && $feature_option != 'Full single image') { $category_ID = get_cat_ID('Feature'); global $post; $args = array('category'=>$category_ID,'numberposts'=>999); $custom_posts = get_posts($args); if ($category_ID !== 0 && $custom_posts){ foreach($custom_posts as $post) : setup_postdata($post); if (has_post_thumbnail()) { if ($feature_option == 'Small slides and feature text box-thumbnails' || $feature_option == 'Full feature slides-thumbnails') { $thumb1 = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID),'wide_thumbnail') ; $thumb_url = $thumb1[0]; } $thumb2 = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID),'full') ; $image_url = $thumb2[0]; $title = get_post(get_post_thumbnail_id())->post_excerpt; echo ''; if( $feature_option == "Full feature slides" || $feature_option == "Small slides and feature text box" ) { echo ''.$title.''; } elseif( $feature_option == "Full feature slides-thumbnails" || $feature_option == "Small slides and feature text box-thumbnails" ) { echo ''.$title.''; } else { echo ''.$title.''; } echo ''; } endforeach; } else { if( $feature_option == "Full feature slides" || $feature_option == "Full feature slides-thumbnails" ) { echo 'Default Feature Slide'; } else { echo 'Default Feature Slide'; } } echo '
        '; echo '
        '; } if( $feature_option == "Small slides and feature text box" || $feature_option == "Small slides and feature text box-thumbnails" || $feature_option == "Small single image and feature text box" ) { echo '
        '; if( $use_feature_widget_area != 1 ) { echo "

        ".stripslashes($blogBox_option['bB_left_feature_title'])."

        "; echo wp_kses_post(stripcslashes($blogBox_option['bB_left_feature_text'])); } else { if ( !dynamic_sidebar('Feature Area') ) : endif; } echo '
        '; } echo '
        '; } } if ( !function_exists ('blogBox_home_sections')){ function blogBox_home_sections() { global $blogBox_option; $blogBox_option = blogBox_get_options(); if ($blogBox_option['bB_home1section1_onoroff'] == 1) { ?>

        ">
        '; ?> '.stripslashes($blogBox_option['bB_home1service1_title']).''; ?> '.wp_kses_post(stripslashes($blogBox_option['bB_home1service1_text'])).'

        '; ?>
        '; ?> '.stripslashes($blogBox_option['bB_home1service2_title']).''; ?> '.wp_kses_post(stripslashes($blogBox_option['bB_home1service2_text'])).'

        '; ?>
        '; ?> '.stripslashes($blogBox_option['bB_home1service3_title']).''; ?> '.wp_kses_post(stripslashes($blogBox_option['bB_home1service3_text'])).'

        '; ?>

        'primary-nav', 'container_class' => 'main-nav', 'container_id' => 'main-menu-right-noborder', 'menu_class' => 'sf-menu', 'menu_id' => 'main_menu_ul', 'fallback_cb' => 'wp_page_menu' ) ); } } else if ( $blogBox_option['bB_menu_loc'] == 'left' ) { if(has_nav_menu('primary-nav')){ wp_nav_menu( array( 'theme_location' => 'primary-nav', 'container_class' => 'main-nav', 'container_id' => 'main-menu-left-noborder', 'menu_class' => 'sf-menu', 'menu_id' => 'main_menu_ul', 'fallback_cb' => 'wp_page_menu' ) ); } } else { If ( $blogBox_option['bB_menu_border'] == 'menu only' ) { if(has_nav_menu('primary-nav')){ wp_nav_menu( array( 'theme_location' => 'primary-nav', 'container_class' => 'main-nav', 'container_id' => 'main-menu-center-border', 'menu_class' => 'sf-menu', 'menu_id' => 'main_menu_ul', 'fallback_cb' => 'wp_page_menu' ) ); } } else { if(has_nav_menu('primary-nav')){ wp_nav_menu( array( 'theme_location' => 'primary-nav', 'container_class' => 'main-nav', 'container_id' => 'main-menu-center-noborder', 'menu_class' => 'sf-menu', 'menu_id' => 'main_menu_ul', 'fallback_cb' => 'wp_page_menu' ) ); } } } } } ?>