'Top-menu', // 'bottom' => 'Footer', )); add_theme_support('post-thumbnails'); add_image_size( 'portfolio-thumb', 460, 300, true ); // excerpt length function new_excerpt_length($length) { return 20; } add_filter('excerpt_length', 'new_excerpt_length'); // new excerpt more function new_excerpt_more($more) { return '...'; } add_filter('excerpt_more', 'new_excerpt_more'); // register dynamic sidebars if(function_exists('register_sidebar')) { register_sidebar(array( 'name' => 'Blog left Sidebar', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Blog right Sidebar', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar( array( 'name' => 'Before Header Sidebar', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); register_sidebar( array( 'name' => 'Header Sidebar', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' ) ); register_sidebar(array( 'name' => 'Blog Post left Sidebar', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Blog Post right Sidebar', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Page Sidebar', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Footer Widget 1', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Footer Widget 2', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Footer Widget 3', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Footer Widget 4', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Custom Sidebar', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Custom Sidebar1', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => 'Custom Sidebar2', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } /** * show a home link at menu */ function home_page_menu_args( $args ) { $args['show_home'] = true; return $args; } add_filter( 'wp_page_menu_args', 'home_page_menu_args' ); function searchform() { ?> 'Portfolio', 'singular_name' => 'Portfolio', ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'portfolio' ), 'capability_type' => 'post', 'has_archive' => true, 'taxonomies' => array( 'category '), 'hierarchical' => false, 'menu_position' => null, 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ) ); register_post_type( 'portfolio', $args ); } add_action( 'init', 'create_portfolio' ); // Add new taxonomy, make it hierarchical (like categories) add_action( 'init', 'create_portfolio_taxonomies' ); function create_portfolio_taxonomies() { $labels = array( 'name' => _x( 'Portfolio Categories', 'taxonomy general name' , 'black-fusion'), 'singular_name' => _x( 'Category', 'taxonomy singular name' , 'black-fusion'), 'search_items' => __( 'Search Categories' , 'black-fusion'), 'all_items' => __( 'All Categories' , 'black-fusion'), 'parent_item' => __( 'Parent Category' , 'black-fusion'), 'parent_item_colon' => __( 'Parent Category:' , 'black-fusion'), 'edit_item' => __( 'Edit Category' , 'black-fusion'), 'update_item' => __( 'Update Category' , 'black-fusion'), 'add_new_item' => __( 'Add New Category' , 'black-fusion'), 'new_item_name' => __( 'New Category Name' , 'black-fusion'), 'menu_name' => __( 'Portfolio Categories' , 'black-fusion'), ); register_taxonomy('portfolio_categories',array('portfolio'), array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => true, )); } // theme options activate require_once ('admin/index.php'); require_once ('functions/data_options.php'); if ( is_admin() ) {include('tinymce-kit/tinymce-kit.php');} include_once('functions/breadcrumbs.php'); // dimox_breadcrumbs include_once('functions/shortcodes.php'); include_once('widgets/widgets.php'); // include_once('bootstrap-shortcodes.php'); function unhide_kitchensink( $args ) { $args['wordpress_adv_hidden'] = false; return $args; } add_filter( 'tiny_mce_before_init', 'unhide_kitchensink' ); function wp_corenavi() { global $wp_query, $wp_rewrite; $pages = ''; $max = $wp_query->max_num_pages; if (!$current = get_query_var('paged')) $current = 1; $a['base'] = str_replace(999999999, '%#%', get_pagenum_link(999999999)); $a['total'] = $max; $a['current'] = $current; $total = 0; $a['mid_size'] = 2; $a['end_size'] = 1; $a['prev_text'] = 'previous'; $a['next_text'] = 'next'; if ($max > 1) echo ''; } function hex2rgb($hex) { $hex = str_replace("#", "", $hex); if(strlen($hex) == 3) { $r = hexdec(substr($hex,0,1).substr($hex,0,1)); $g = hexdec(substr($hex,1,1).substr($hex,1,1)); $b = hexdec(substr($hex,2,1).substr($hex,2,1)); } else { $r = hexdec(substr($hex,0,2)); $g = hexdec(substr($hex,2,2)); $b = hexdec(substr($hex,4,2)); } $rgb = array($r, $g, $b); return implode(",", $rgb); // returns the rgb values separated by commas // return $rgb; // returns an array with the rgb values } function list_categories($tax) { $categories = wp_list_categories( array( 'title_li' => '', 'echo' => '0', 'taxonomy' => $tax, 'hierarchical' => 0, ) ); $categories = explode('', $categories); //create array from string returned by wp_list_categories array_pop($categories); //pop last element off array $categories = implode(' /  ', $categories); echo $categories; } function kama_excerpt($args=''){ global $post; parse_str($args, $i); $maxchar = isset($i['maxchar']) ? (int)trim($i['maxchar']) : 250; $text = isset($i['text']) ? trim($i['text']) : ''; $save_format = isset($i['save_format']) ? trim($i['save_format']) : false; $echo = isset($i['echo']) ? false : true; if (!$text){ $out = $post->post_excerpt ? $post->post_excerpt : $post->post_content; $out = preg_replace ('!\[/?.*\]!U', '', $out ); //delete shortcodes, for example [singlepic id=3] $out = preg_replace ('/]+./', '', $out ); //delete images // $content = str_replace(']]>', ']]>', $content); } $out = $text.$out; if (!$post->post_excerpt) $out = strip_tags($out, $save_format); if ( iconv_strlen($out, 'utf-8') > $maxchar ){ $out = iconv_substr( $out, 0, $maxchar, 'utf-8' ); } if($save_format){ $out = str_replace( "\r", '', $out ); $out = preg_replace( "!\n\n+!", "

", $out ); $out = "

". str_replace ( "\n", "
", trim($out) ) ."

"; } return $out; } add_filter( 'the_category', 'replace_cat_tag' ); function replace_cat_tag ( $text ) { $text = str_replace('rel="category tag"', 'rel="tag"', $text); return $text; } /** * Sets up the content width value based on the theme's design and stylesheet. */ if ( ! isset( $content_width ) ) $content_width = 625; add_theme_support( 'custom-header' ); add_theme_support( 'custom-background' ); add_editor_style(); /* * Adds JavaScript to pages with the comment form to support * sites with threaded comments (when in use). */ if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); // Adds RSS feed links to for posts and comments. add_theme_support( 'automatic-feed-links' ); ?>