__( 'Primary Menu', 'custom' ) ) ); // Post Formats add_theme_support( 'post-formats', array( 'video', 'image' ) ); // Adds Custom Background support in admin panel $args = array( 'default-color' => 'CCCCCC' ); add_theme_support( 'custom-background', $args ); /* ============================================================ Adds Post Thumbnail feature in admin panels =============================================================*/ add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size(75, 75, true); add_image_size('index-thumb', 620, 9999); add_image_size('single-thumb', 620, 9999); add_image_size('feature-slider', 930, 400, true); // Add custom image sizes (optional): // add_image_size('size-name', height, width, true); } // custom_setup endif; add_action( 'after_setup_theme', 'custom_setup' ); /* ============================================================ LOGO THEME CUSTOMIZER =============================================================*/ function themeslug_theme_customizer( $wp_customize ) { // create a new section for our logo upload $wp_customize->add_section( 'themeslug_logo_section' , array( 'title' => __( 'Logo', 'themeslug' ), 'priority' => 30, 'description' => 'Upload a logo to replace the default site name and description in the header' ) ); // register our new setting $wp_customize->add_setting( 'themeslug_logo', array ( 'default' => '', 'sanitize_callback' => 'esc_url_raw' )); // tell the Theme Customizer to let us use an image uploader for setting our logo $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'themeslug_logo', array( 'label' => __( 'Logo Image', 'themeslug' ), 'section' => 'themeslug_logo_section', 'settings' => 'themeslug_logo',) ) ); //---------- custom colors text and links $colors = array(); $colors[] = array( 'slug'=>'content_text_color', 'default' => '#333', 'label' => __('Content Text Color', 'custom') ); $colors[] = array( 'slug'=>'content_link_color', 'default' => '#88C34B', 'label' => __('Content Link Color', 'custom') ); foreach( $colors as $color ) { // SETTINGS $wp_customize->add_setting( $color['slug'], array( 'default' => $color['default'], 'type' => 'option', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_color_control' ) ); // CONTROLS $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, $color['slug'], array('label' => $color['label'], 'section' => 'colors', 'settings' => $color['slug']) ) ); } function sanitize_color_control ($input) { return strip_tags( stripslashes($input) ); } } add_action('customize_register', 'themeslug_theme_customizer'); /* ============================================================ wp_nav FALLBACK =============================================================*/ function custom_page_menu_args( $args ) { $args['show_home'] = true; return $args; } add_filter( 'wp_page_menu_args', 'custom_page_menu_args' ); /* ============================================================ ADD WIDGETIZED AREAS =============================================================*/ function custom_widgets_init() { register_sidebar( array( 'name' => __( 'Sidebar Widgets', 'custom' ), 'id' => 'sidebar-1', 'description' => __( 'Widgets displayed in the sidebar on category and archive pages. ', 'custom' ), 'before_widget' => '", 'before_title' => '