'Home', 'name' => 'Home', // Home 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
',)); register_sidebar(array( 'id' => 'Single', 'name' => 'Single', // Single 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
', )); register_sidebar(array( 'id' => 'Custom', 'name' => 'Custom', // Custom 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '
', 'after_title' => '
', )); } add_action( 'init', 'the_widgets_init' ); add_theme_support('automatic-feed-links'); /*----------------------------------------------------*/ /* END of Custom Sidebar */ /*----------------------------------------------------*/ if (is_home() || is_post_template('single.php') || is_page_template('page.php')) { $content_width = 580; } else { $content_width = 900; } add_filter('widget_text', 'do_shortcode'); //Thumbnails in Homepage add_theme_support( 'post-thumbnails' ); add_theme_support( 'post-thumbnails', array( 'post' ) ); // Add it for posts add_theme_support( 'post-thumbnails', array( 'page' ) ); // Add it for pages set_post_thumbnail_size( 150, 150, true ); add_theme_support( 'post-thumbnails' ); if ( function_exists( 'add_image_size' ) ) add_theme_support( 'thumbnails' ); add_theme_support( 'post_thumbnail' ); // Add Thumbnail Sizes if ( function_exists( 'add_image_size' ) ) { add_image_size( 'post_thumbnail', 250, 250 ); add_image_size( 'home-thumb', 150, 150, true ); add_image_size( 'mini-thumbnail', 80, 80, true ); add_image_size('archive-thumb', 100, 100, true); } //Feedburner RSS Thumbnails function insertThumbnailRSS($content) { global $post; if ( has_post_thumbnail( $post->ID ) ){ $content = '' . get_the_post_thumbnail( $post->ID, 'thumbnail', array( 'alt' => get_the_title(), 'title' => get_the_title(), 'style' => 'float:right;' ) ) . ''; } return $content; } add_filter('the_excerpt_rss', 'insertThumbnailRSS'); add_filter('the_content_feed', 'insertThumbnailRSS'); add_editor_style(); /*--------------------------------*/ /* Global Functions */ /*--------------------------------*/ $GLOBALS['template_path'] = get_template_directory_uri(); //Access the WordPress Categories via an Array $categories = array(); $categories_obj = get_categories('hide_empty=0'); foreach ($categories_obj as $cat) { $categories[$cat->cat_ID] = $cat->cat_name;} $categories_tmp = array_unshift($categories, "Select a category:"); //Access the WordPress Pages via an Array $pages = array(); $pages_obj = get_pages('sort_column=post_parent,menu_order'); foreach ($pages_obj as $page) { $pages[$page->ID] = $page->post_name; } $pages_tmp = array_unshift($pages, "Select a page:"); /*--------------------------------*/ /* END - Global Functions */ /*--------------------------------*/ // Make Menu Support compatible with earlier WP versions function theme_nav() { if ( function_exists( 'wp_nav_menu' ) ) wp_nav_menu( 'sort_column=menu_order&container_class=menu&menu_class=&menu_location=main-menu&fallback_cb=gpptheme_nav_fallback' ); else theme_nav_fallback(); } // Create our GPP Fallback Menu function theme_nav_fallback() { wp_page_menu( 'show_home=1&menu_class=menu' ); } add_action('after_setup_theme', 'my_theme_setup'); function my_theme_setup(){ load_theme_textdomain('wp_liteflex', get_template_directory() . '/includes/languages'); } /*----------------------------------------------------*/ /* Template Comments */ /*----------------------------------------------------*/ function custom_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>
  • id="li-comment-">
    at #
    comment_approved == '0') { ?>

    Your comment is awaiting moderation.

    $depth, 'max_depth' => $args['max_depth']))) ?>
  • - ]+>', $commenter ) ) {$commenter = ereg_replace( '(]* class=[\'"]?)', '\\1url ' , $commenter ); } else { $commenter = ereg_replace( '('.'Read More'.''; } add_filter('excerpt_more', 'no_more_jumping'); //ADD POST TAGS function set_new_taxonomy_tag($post_id, $fields) { $post_id = (int) $post_id; foreach ( (array) $fields as $tax ) { if ( isset($tax['id']) ) { $tax['id'] = (int) $tax['id']; if ( isset($tax['taxonomy']) ) { wp_set_post_terms($tax['id'], $tax['tags'], $tax['taxonomy']); } } elseif ($post_id != '') { if ( isset($tax['taxonomy']) ) { wp_set_post_terms($post_id, $tax['tags'], $tax['taxonomy']); } } } } /*--------------------------------*/ /* Custom Metaboxes*/ /*--------------------------------*/ // CSS SPRITES add_action('admin_menu', 'sprites_custom_css_hooks'); add_action('save_post', 'sprites_save_custom_css'); add_action('wp_head','sprites_insert_custom_css'); function sprites_custom_css_hooks() { add_meta_box('custom_css', 'Name of custom CSS file', 'sprites_custom_css_input', 'post', 'normal', 'high'); add_meta_box('custom_css', 'Name of custom CSS file', 'sprites_custom_css_input', 'page', 'normal', 'high'); } function sprites_custom_css_input() { global $post; echo ''; echo ''; } function sprites_save_custom_css($post_id) { if (!wp_verify_nonce($_POST['custom_css_noncename'], 'custom-css')) return $post_id; if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return $post_id; $custom_css = $_POST['custom_css']; update_post_meta($post_id, '_custom_css', $custom_css); } function sprites_insert_custom_css() { if (is_page() || is_single()) { if (have_posts()) : while (have_posts()) : the_post(); $filename = get_post_meta(get_the_ID(), '_custom_css', true); if ($filename) { echo ""; } endwhile; endif; rewind_posts(); } } /*--------------------------------*/ /* End Metaboxes*/ /*--------------------------------*/ //Automatically move JavaScript code to page footer, speeding up page loading time. remove_action('wp_head', 'wp_print_scripts'); add_action('wp_footer', 'wp_print_scripts', 5); function liteflex_nav($post = 0) { $output = ""; $subNav = ""; $params = "title_li=&depth=1&echo=0"; // always show top level $output .= ''; // second level? if($post->post_parent) { $params .= "&child_of=" . $post->post_parent; } else { $params .= "&child_of=" . $post->ID; } $subNav = wp_list_pages($params); if ($subNav) { $output .= ''; } return $output; } /*-----------------------------------------------------------------------------------*/ /* END Valpo Creative Blog - custom functions below */ /*-----------------------------------------------------------------------------------*/ ?>