'#34495e')); add_theme_support('custom-header', array('width' => '200px', 'height' => '200px')); add_theme_support('html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption' ) ); add_theme_support('automatic-feed-links' ); load_theme_textdomain( 'blackcolors', get_template_directory() . '/languages' ); /*----- WP content width ------*/ global $content_width; if ( !isset( $content_width ) ){ $content_width = 640; } } add_action('after_setup_theme', 'blackcolors_setup'); /* Add customization settings and controls */ add_action('customize_register', 'blackcolors_customize'); function blackcolors_customize($wp_customize) { // Fixed bar background color /*--------------------------------------*/ $wp_customize->add_setting( 'blackcolors_barra_color', array( 'default' => '#2c3e50', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'blackcolors_barra_color', array( 'label' => __('Fixed Bar Background Color', 'blackcolors'), 'section' => 'colors', 'settings' => 'blackcolors_barra_color', ) ) ); // Text color /*--------------------------------------*/ $wp_customize->add_setting( 'blackcolors_texto_color', array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'blackcolors_texto_color', array( 'label' => __('Text Color', 'blackcolors'), 'section' => 'colors', 'settings' => 'blackcolors_texto_color', ) ) ); // Links color /*--------------------------------------*/ $wp_customize->add_setting( 'blackcolors_links_color', array( 'default' => '#e67e22', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'blackcolors_links_color', array( 'label' => __('Links Color', 'blackcolors'), 'section' => 'colors', 'settings' => 'blackcolors_links_color', ) ) ); // Links color when hover /*--------------------------------------*/ $wp_customize->add_setting( 'blackcolors_links_hover', array( 'default' => '#f1c40f', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'blackcolors_links_hover', array( 'label' => __('Links color when mouse is hover', 'blackcolors'), 'section' => 'colors', 'settings' => 'blackcolors_links_hover', ) ) ); // Galleries background color /*--------------------------------------*/ $wp_customize->add_setting( 'blackcolors_galeria_color', array( 'default' => '#34495e', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'blackcolors_galeria_color', array( 'label' => __('Gallery Background Color', 'blackcolors'), 'section' => 'colors', 'settings' => 'blackcolors_galeria_color', ) ) ); //Add Section for blackcolors Boxes /*--------------------------------------*/ $wp_customize->add_section( 'blackcolors_boxes', array( 'title' => __( 'blackcolors Boxes', 'blackcolors' ), 'priority' => 35, ) ); /* Text and URL for Box 1 /*-------------------------*/ $wp_customize->add_setting( 'blackcolors_box1_text', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box1_text', array( 'settings' => 'blackcolors_box1_text', 'label' => __( 'Text on Box 1: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'type' => 'text', 'priority' => 1, ) ) ); $wp_customize->add_setting( 'blackcolors_box1_url', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box1_url', array( 'settings' => 'blackcolors_box1_url', 'label' => __( 'URL on Box 1: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'type' => 'text', 'priority' => 2, ) ) ); /* Text and URL for Box 2 /*-------------------------*/ $wp_customize->add_setting( 'blackcolors_box2_text', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box2_text', array( 'settings' => 'blackcolors_box2_text', 'label' => __( 'Text on Box 2: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'type' => 'text', 'priority' => 3, ) ) ); $wp_customize->add_setting( 'blackcolors_box2_url', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box2_url', array( 'settings' => 'blackcolors_box2_url', 'label' => __( 'URL on Box 2: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'type' => 'text', 'priority' => 4, ) ) ); /* Text and URL for Box 3 /*-------------------------*/ $wp_customize->add_setting( 'blackcolors_box3_text', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box3_text', array( 'settings' => 'blackcolors_box3_text', 'label' => __( 'Text on Box 3: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'priority' => 5, 'type' => 'text', ) ) ); $wp_customize->add_setting( 'blackcolors_box3_url', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box3_url', array( 'settings' => 'blackcolors_box3_url', 'label' => __( 'URL on Box 3: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'type' => 'text', 'priority' => 6, ) ) ); /* Text and URL for Box 4 /*-------------------------*/ $wp_customize->add_setting( 'blackcolors_box4_text', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box4_text', array( 'settings' => 'blackcolors_box4_text', 'label' => __( 'Text on Box 4: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'priority' => 7, 'type' => 'text', ) ) ); $wp_customize->add_setting( 'blackcolors_box4_url', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box4_url', array( 'settings' => 'blackcolors_box4_url', 'label' => __( 'URL on Box 4: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'type' => 'text', 'priority' => 8, ) ) ); /* Text and URL for Box 5 /*-------------------------*/ $wp_customize->add_setting( 'blackcolors_box5_text', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box5_text', array( 'settings' => 'blackcolors_box5_text', 'label' => __( 'Text on Box 5: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'priority' => 9, 'type' => 'text', ) ) ); $wp_customize->add_setting( 'blackcolors_box5_url', array( 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'esc_url', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'blackcolors_box5_url', array( 'settings' => 'blackcolors_box5_url', 'label' => __( 'URL on Box 5: ', 'blackcolors' ), 'section' => 'blackcolors_boxes', 'type' => 'text', 'priority' => 10, ) ) ); } /*----- Write post or page title in posts and pages, and the blog title in home -----*/ add_filter( 'wp_title', 'blackcolors_title_for_home' ); function blackcolors_title_for_home( $title ) { if( empty( $title ) && ( is_home() || is_front_page() ) ) { return get_bloginfo( 'name' ); } return $title; } /*----- Creates a header-menu -----*/ function blackcolors_menu() { register_nav_menu('primary', __('Header Menu', 'blackcolors')); } add_action( 'init', 'blackcolors_menu' ); /*----- Creates three Widgets Areas called Footer %d -----*/ function blackcolors_sidebar_footer(){ register_sidebars(2, array('name' => __('Footer %d', 'blackcolors'), 'before_title' => '

', 'after_title' => '

',)); } add_action( 'widgets_init', 'blackcolors_sidebar_footer' ); /*----- Script enqueueing -----*/ function blackcolors_scripts() { if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); wp_enqueue_style( 'blackcolors-style', get_stylesheet_uri() ); wp_enqueue_style( 'font-awesome', get_template_directory_uri().'/fonts/font-awesome/css/font-awesome.min.css' ); wp_enqueue_script( 'menu.js', get_template_directory_uri() . '/js/menu.js', array("jquery"), '20130115', true ); } add_action( 'wp_enqueue_scripts', 'blackcolors_scripts' ); /*---- IE Compatibility ----*/ function blackcolors_wp_head(){ ?> body{ color: $colortexto ; } #barra-lateral{ color: $colortexto ; padding-top: $top_superior ; } #barra-superior{ top: $top_superior ; } a, a:link, a:visited{ color: $colorlinks ; text-decoration:none; } a:hover{ color: $colorhover ; } "; } add_action('wp_head', 'blackcolors_my_estilos'); ?>