'#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' );
function my_theme_setup(){
load_theme_textdomain( 'Blackcolors', get_template_directory() . '/languages' );
}
add_action('after_setup_theme', 'my_theme_setup');
add_action('customize_register', 'themedemo_customize');
function themedemo_customize($wp_customize) {
$wp_customize->add_setting( 'bc_barra_color', array(
'default' => '#2c3e50',
'sanitize_callback' => 'esc_html',
) );
$wp_customize->add_setting( 'bc_texto_color', array(
'default' => '#ffffff',
'sanitize_callback' => 'esc_html',
) );
$wp_customize->add_setting( 'bc_links_color', array(
'default' => '#e67e22',
'sanitize_callback' => 'esc_html',
) );
$wp_customize->add_setting( 'bc_links_hover', array(
'default' => '#f1c40f',
'sanitize_callback' => 'esc_html',
) );
$wp_customize->add_setting( 'bc_galeria_color', array(
'default' => '#34495e',
'sanitize_callback' => 'esc_html',
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bc_texto_color', array(
'label' => __('Text Color', 'Blackcolors'),
'section' => 'colors',
'settings' => 'bc_texto_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bc_barra_color', array(
'label' => __('Fixed Bar Background Color', 'Blackcolors'),
'section' => 'colors',
'settings' => 'bc_barra_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bc_links_color', array(
'label' => __('Links Color', 'Blackcolors'),
'section' => 'colors',
'settings' => 'bc_links_color',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bc_links_hover', array(
'label' => __('Links color when mouse is hover', 'Blackcolors'),
'section' => 'colors',
'settings' => 'bc_links_hover',
) ) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bc_galeria_color', array(
'label' => __('Gallery Background Color', 'Blackcolors'),
'section' => 'colors',
'settings' => 'bc_galeria_color',
) ) );
}
/*----- WP content width ------*/
if ( !isset( $content_width ) ){
$content_width = 600;
}
/*----- 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 register_my_menu() {
register_nav_menu('primary', 'Header Menu');
}
add_action( 'init', 'register_my_menu' );
/*----- Creates one Widget Area called Main Sidebar -----*/
function regyster_my_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', 'regyster_my_sidebar_lateral' );
/*----- Creates three Widgets Areas called Footer %d -----*/
function regyster_my_sidebar_footer(){
register_sidebars(3, array('name'=>'Footer %d',
'before_title' => '',
'after_title' => '
',));
}
add_action( 'widgets_init', 'regyster_my_sidebar_footer' );
/*----- Script enqueueing -----*/
function temauno_scripts() {
wp_enqueue_style( 'font-awesome', get_template_directory_uri().'/fonts/font-awesome/css/font-awesome.min.css' );
wp_enqueue_script( 'jquery-2.1.1.min.js', get_template_directory_uri() . '/js/jquery-2.1.1.min.js', array(), '2.1.1', true );
wp_enqueue_script( 'menu.js', get_template_directory_uri() . '/js/menu.js', array(), '0', true );
}
add_action( 'wp_enqueue_scripts', 'temauno_scripts' );
/*----- Creates Various Custom Admin Menus -----*/
add_action('admin_menu', 'blackcolors_box_menu');
function blackcolors_box_menu() {
add_theme_page( 'BC Boxes', 'BC Boxes', 'edit_theme_options', 'customize-blackcolors', 'my_plugin_boxes' );
wp_enqueue_style( 'estilo', get_template_directory_uri().'/css/estilo.css');
wp_enqueue_style( 'font-awesome', get_template_directory_uri().'/fonts/font-awesome/css/font-awesome.min.css' );
}
add_action('admin_menu', 'blackcolors_social_menu');
function blackcolors_social_menu() {
add_theme_page( 'BC Social', 'BC Social', 'edit_theme_options', 'customize-bc-social', 'my_plugin_social' );
wp_enqueue_style( 'bc-estilo', get_template_directory_uri().'/css/bc-estilo.css');
}
add_action('admin_menu', 'blackcolors_fonts_menu');
function blackcolors_fonts_menu() {
add_theme_page( 'BC Fonts', 'BC Fonts', 'edit_theme_options', 'customize-bc-fonts', 'my_plugin_fonts' );
}
/*----- Color Boxes in Top ------*/
function my_plugin_boxes(){
if ( !current_user_can( 'manage_options' ) ) {
wp_die( 'You do not have sufficient permissions to access this page.' );
}else{
$url = array();
$text = array();
if(isset($_POST['customurl'])){
for($i = 0; $i <= 4; $i++){
if(!empty($url_post = $_POST["url$i"])){
$url[$i] = $url_post;
echo "
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("userurl", $url);
update_option("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("userurl");
$text = get_option("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 "
";
}
}
}
function my_plugin_social(){
echo "
" . __('Go PRO to add social icons to the Theme:', 'Blackcolors') . " Blackcolors PRO
";
}
function my_plugin_fonts(){
echo "
" . __('Go PRO to change the fonts of the Theme:', 'Blackcolors') . " Blackcolors PRO
";
}
/*----- Select and modifies CSS Styles changed by the user ------*/
function my_estilos(){
if(is_admin_bar_showing()){
$top_superior = "28px";
}else{
$top_superior = "0";
}
$colortexto = get_theme_mod( 'bc_texto_color', '#ffffff');
$colorlinks = get_theme_mod( 'bc_links_color', '#e67e22' );
$colorhover = get_theme_mod( 'bc_links_hover', '#f1c40f' );
echo "";
}
?>