'#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' ); /*-- Theme Setup Function --*/ function blackcolors_setup(){ 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) { $wp_customize->add_setting( 'blackcolors_barra_color', array( 'default' => '#2c3e50', 'sanitize_callback' => 'esc_html', ) ); $wp_customize->add_setting( 'blackcolors_texto_color', array( 'default' => '#ffffff', 'sanitize_callback' => 'esc_html', ) ); $wp_customize->add_setting( 'blackcolors_links_color', array( 'default' => '#e67e22', 'sanitize_callback' => 'esc_html', ) ); $wp_customize->add_setting( 'blackcolors_links_hover', array( 'default' => '#f1c40f', 'sanitize_callback' => 'esc_html', ) ); $wp_customize->add_setting( 'blackcolors_galeria_color', array( 'default' => '#34495e', 'sanitize_callback' => 'esc_html', ) ); $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', ) ) ); $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', ) ) ); $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', ) ) ); $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', ) ) ); $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', ) ) ); } /*----- Write post or page title in posts and pages, and the blog title in home -----*/ add_filter( 'wp_title', 'baw_hack_wp_title_for_home' ); function baw_hack_wp_title_for_home( $title ) { if( empty( $title ) && ( is_home() || is_front_page() ) ) { return get_bloginfo( 'name' ); } return $title; } show_admin_bar( true ); /*----- Creates a header-menu -----*/ function blackcolors_menu() { register_nav_menu('primary', 'Header Menu'); } add_action( 'init', 'blackcolors_menu' ); /*----- Creates one Widget Area called Main Sidebar -----*/ function blackcolors_sidebar_lateral() { register_sidebar( array( 'name' => 'Main Sidebar', 'Blackcolors', 'id' => 'sidebar-1', 'description' => __('Widgets in this area will be shown on all posts and pages.', 'Blackcolors'), 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'blackcolors_sidebar_lateral' ); /*----- Creates three Widgets Areas called Footer %d -----*/ function blackcolors_sidebar_footer(){ register_sidebars(3, array('name'=>'Footer %d', 'before_title' => '

', 'after_title' => '

',)); } add_action( 'widgets_init', 'blackcolors_sidebar_footer' ); /*----- Script enqueueing -----*/ function blackcolors_scripts() { wp_enqueue_script( 'jquery' ); 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(), '0', true ); } add_action( 'wp_enqueue_scripts', 'blackcolors_scripts' ); /*---- IE Compatibility ----*/ function blackcolors_wp_head(){ ?> URL $i: " . esc_html($url[$i]); } if(!empty($text_post = $_POST["text$i"])){ $text[$i] = $text_post; echo "
Text $i: " . esc_attr($text[$i]); } } update_option ("blackcolors_userurl", $url); update_option ("blackcolors_usertext", $text); echo __('Do not forget to refresh your site in your web browser to see the changes', 'Blackcolors'); }else{ for($i = 0; $i <= 4; $i++){ $url = get_option ("blackcolors_userurl"); $text = get_option ("blackcolors_usertext"); } echo '
'; echo '

' . __('Customize BlackColors', 'Blackcolors') . '

'; echo '

' . __('You can modify here the URL Address of every colorbox in the top-right bar', 'Blackcolors') . '

'; echo "

" . __('Go PRO if you also want to change the icons and colof of the Theme:', 'Blackcolors') . " Blackcolors PRO

"; echo "
"; for($i = 0; $i <= 4; $i++){ if(!empty($url[$i])){ $url_form = $url[$i]; }else{ $url_form = ""; } if(!empty($text[$i])){ $text_form = $text[$i]; }else{ $text_form = ""; } echo "
"; echo "

" . __('Box', 'Blackcolors') . " $i

"; echo "
"; echo "
"; echo "
"; echo "
"; echo "
"; } echo "
"; } } } function blackcolors_social(){ echo "

" . __('Go PRO to add social icons to the Theme:', 'Blackcolors') . " Blackcolors PRO

"; } function blackcolors_fonts(){ echo "

" . __('Go PRO to change the fonts of the Theme:', 'Blackcolors') . " Blackcolors PRO

"; } /*----- Select and modifies CSS Styles changed by the user ------*/ function blackcolors_my_estilos(){ if(is_admin_bar_showing()){ $top_superior = "28px"; }else{ $top_superior = "0"; } $colortexto = get_theme_mod( 'blackcolors_texto_color', '#ffffff'); $colorlinks = get_theme_mod( 'blackcolors_links_color', '#e67e22' ); $colorhover = get_theme_mod( 'blackcolors_links_hover', '#f1c40f' ); echo ""; } ?>