__( 'Primary Navigation', 'woothemes' ), ) ); // Thumbnails add_theme_support( 'post-thumbnails', array( 'post' ) ); set_post_thumbnail_size( 490, 200, true ); // Add support for the aside post format add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) ); $options = get_option('bueno_theme_options'); if ( ! isset( $options['colorscheme'] ) ) { $colorscheme = 'default'; } else { $colorscheme = esc_attr( strtolower( $options['colorscheme'] ) ); } // This theme allows users to set a custom background add_theme_support( 'custom-background', apply_filters( 'bueno_custom_background_args', array( 'default-color' => 'ffffff', 'default-image' => get_template_directory_uri() . '/styles/' . $colorscheme . '/bodytile.jpg', ) ) ); add_theme_support( 'print-style' ); /** * Enqueue scripts and styles */ function bueno_scripts() { wp_enqueue_style( 'bueno', get_stylesheet_uri() ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); } add_action( 'wp_enqueue_scripts', 'bueno_scripts' ); // Allow custom colors to clear the background image function bueno_custom_background_color() { if ( get_background_image() == '' && get_background_color() != '' ) { ?> '', 'default-text-color' => '000', 'width' => 930, 'height' => 198, 'flex-height' => true, 'wp-head-callback' => 'bueno_header_style', 'admin-head-callback' => 'bueno_admin_header_style', ) ) ); /** * Styles the header image and text displayed on the blog * */ function bueno_header_style() { // If no custom options for text are set, let's bail if ( HEADER_TEXTCOLOR == get_header_textcolor() ) return; // If we get this far, we have custom styles. Let's do this. ?> post_parent ) { $attachments = array_values(get_children( array('post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') )); foreach ( $attachments as $k => $attachment ) if ( $attachment->ID == $post->ID ) break; $k = $k + 1; if ( isset($attachments[$k]) ) { return get_attachment_link($attachments[$k]->ID); } else { return get_permalink($post->post_parent); } } } endif; // Load the theme options page require_once ( get_template_directory() . '/includes/options-page.php' ); function theme_alt_styles() { $options = get_option('bueno_theme_options'); if ( ! isset( $options['colorscheme'] ) ) { echo ''."\n"; } else { echo ''."\n"; } } add_action('wp_head', 'theme_alt_styles', 9); // Filter wp_nav_menu() to add homelink and rsslink function bueno_nav_menu_items($items) { $options = get_option('bueno_theme_options'); if ( ! is_front_page()) { $highlight = "page_item"; } else {$highlight = "page_item current_page_item"; } $homelink = '
  • ' . __('Home', 'woothemes') . '
  • '; $feedlink = '
  • ' . __('RSS', 'woothemes') . '
  • '; if ( isset( $options['homelink'] ) && $options['homelink'] == 1 ) { $items = $homelink . $items; } if ( isset( $options['feedlink'] ) && $options['feedlink'] == 1 ) { $items = $items . $feedlink; } return $items; } add_filter( 'wp_nav_menu_items', 'bueno_nav_menu_items' ); // Fallback for the nav menu function bueno_page_menu() { $options = get_option('bueno_theme_options'); ?> 'ffffff', 'border' => '9fcef1', 'text' => '7a7a7a', 'link' => '17517b', 'url' => '7ebdec', ); break; case 'Brown': $themecolors = array( 'bg' => 'ffffff', 'border' => 'd3975d', 'text' => '7a7a7a', 'link' => '472300', 'url' => '824b15', ); break; case 'Default': default: $themecolors = array( 'bg' => 'ffffff', 'border' => 'fbdddf', 'text' => '7a7a7a', 'link' => 'f3686d', 'url' => 'fbdddf', ); break; case 'Green': $themecolors = array( 'bg' => 'ffffff', 'border' => '9bd28e', 'text' => '7a7a7a', 'link' => '115900', 'url' => '585858', ); break; case 'Grey': $themecolors = array( 'bg' => 'ffffff', 'border' => 'b0b0b0', 'text' => '7a7a7a', 'link' => '333333', 'url' => '585858', ); break; case 'Purple': $themecolors = array( 'bg' => 'ffffff', 'border' => 'd7bced', 'text' => '7a7a7a', 'link' => '3b0466', 'url' => '585858', ); break; case 'Red': $themecolors = array( 'bg' => 'ffffff', 'border' => 'ffc1c1', 'text' => '7a7a7a', 'link' => 'c40000', 'url' => 'bd2828', ); break; } /** * Filters wp_title to print a neat tag based on what is being viewed. * * @since Bueno 1.0 */ function bueno_wp_title( $title, $sep ) { global $page, $paged; if ( is_feed() ) return $title; // Add the blog name $title .= get_bloginfo( 'name' ); // Add the blog description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title .= " $sep $site_description"; // Add a page number if necessary: if ( $paged >= 2 || $page >= 2 ) $title .= " $sep " . sprintf( __( 'Page %s', 'bueno' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'bueno_wp_title', 10, 2 );