__( 'Primary Menu', 'bootstrapcanvaswp' ),
) );
// Custom Header
$args = array(
'flex-width' => true,
'width' => 980,
'flex-height' => true,
'height' => 200,
'default-text-color' => '333',
);
add_theme_support( 'custom-header', $args );
// Custom Background
$args = array(
'default-color' => 'fff',
);
add_theme_support( 'custom-background', $args );
}
endif;
add_action( 'after_setup_theme', 'bootstrapcanvaswp_setup' );
/**
* Widget Areas
*/
function bootstrapcanvaswp_widgets_init() {
register_sidebar( array(
'name' => 'Right Sidebar',
'id' => 'sidebar-1',
'description' => 'Main sidebar that appears on the right.', 'bootstrapcanvaswp',
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '',
) );
register_sidebar( array(
'name' => 'Footer - Left',
'id' => 'footer-1',
'description' => 'Footer area that appears on the left.', 'bootstrapcanvaswp',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
register_sidebar( array(
'name' => 'Footer - Center',
'id' => 'footer-2',
'description' => 'Footer area that appears in the center.', 'bootstrapcanvaswp',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
register_sidebar( array(
'name' => 'Footer - Right',
'id' => 'footer-3',
'description' => 'Footer area that appears on the right.', 'bootstrapcanvaswp',
'before_widget' => '',
'after_widget' => '
',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'bootstrapcanvaswp_widgets_init' );
/**
* Active Class
*/
function bootstrapcanvaswp_nav_class($classes, $item){
if( in_array('current-menu-item', $classes) ){
$classes[] = 'active ';
}
return $classes;
}
add_filter( 'nav_menu_css_class' , 'bootstrapcanvaswp_nav_class' , 10 , 2 );
/**
* Excerpt More . . .
*/
function new_excerpt_more( $more ) {
return ' . . .';
}
add_filter( 'excerpt_more', 'new_excerpt_more' );
/**
* Comment Callback
*/
function bootstrapcanvaswp_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
extract($args, EXTR_SKIP);
if ( 'div' == $args['style'] ) {
$tag = 'div';
$add_below = 'comment';
} else {
$tag = 'li';
$add_below = 'div-comment';
}
?>
< id="comment-">
id="div-comment-">
comment_approved == '0' ) : ?>
$add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
add_setting( 'header_color' , array(
'default' => '#f9f9f9',
) );
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'header_color',
array(
'label' => __( 'Header', 'bootstrapcanvaswp' ),
'section' => 'colors',
'settings' => 'header_color',
'priority' => '1',
) )
);
// Footer Customizer
$wp_customize->add_setting( 'footer_color' , array(
'default' => '#f9f9f9',
) );
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'footer_color',
array(
'label' => __( 'Footer', 'bootstrapcanvaswp' ),
'section' => 'colors',
'settings' => 'footer_color',
'priority' => '2',
) )
);
// Header Text Customizer
$wp_customize->add_setting( 'header_textcolor' , array(
'default' => '#333',
) );
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'header_textcolor',
array(
'label' => __( 'Header Text Color', 'bootstrapcanvaswp' ),
'section' => 'colors',
'settings' => 'header_textcolor',
'priority' => '3',
) )
);
// Footer Text Customizer
$wp_customize->add_setting( 'footer_textcolor' , array(
'default' => '#999',
) );
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'footer_textcolor',
array(
'label' => __( 'Footer Text Color', 'bootstrapcanvaswp' ),
'section' => 'colors',
'settings' => 'footer_textcolor',
'priority' => '4',
) )
);
// Text Customizer
$wp_customize->add_setting( 'text_color' , array(
'default' => '#555',
) );
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'text_color',
array(
'label' => __( 'Text', 'bootstrapcanvaswp' ),
'section' => 'colors',
'settings' => 'text_color',
'priority' => '5',
) )
);
// Headings Customizer
$wp_customize->add_setting( 'headings_color' , array(
'default' => '#333',
) );
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'headings_color',
array(
'label' => __( 'Headings', 'bootstrapcanvaswp' ),
'section' => 'colors',
'settings' => 'headings_color',
'priority' => '6',
) )
);
// Tracks Customizer
$wp_customize->add_setting( 'tracks_color' , array(
'default' => '#999',
) );
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'tracks_color',
array(
'label' => __( 'Tracks (subtitles, captions, descriptions, chapters, or metadata)', 'bootstrapcanvaswp' ),
'section' => 'colors',
'settings' => 'tracks_color',
'priority' => '7',
) )
);
// Links Customizer
$wp_customize->add_setting( 'link_color' , array(
'default' => '#428bca',
) );
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'link_color',
array(
'label' => __( 'Links', 'bootstrapcanvaswp' ),
'section' => 'colors',
'settings' => 'link_color',
'priority' => '8',
) )
);
// Logo Customizer
$wp_customize->add_setting( 'logo' );
$wp_customize->add_section( 'bootstrapcanvaswp_logo' , array(
'title' => __( 'Logo', 'bootstrapcanvaswp' ),
) );
$wp_customize->add_control(
new WP_Customize_Image_Control(
$wp_customize,
'logo',
array(
'label' => __( 'Upload New', 'bootstrapcanvaswp' ),
'section' => 'bootstrapcanvaswp_logo',
'settings' => 'logo',
)
)
);
// Font Customizer
$wp_customize->add_setting( 'font_family' , array(
'default' => 'Georgia, serif',
) );
$wp_customize->add_section( 'bootstrapcanvaswp_font_family' , array(
'title' => __( 'Font Family', 'bootstrapcanvaswp' ),
) );
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
'font_family',
array(
'label' => __( 'Select', 'bootstrapcanvaswp' ),
'section' => 'bootstrapcanvaswp_font_family',
'settings' => 'font_family',
'type' => 'select',
'choices' => array(
'Arial, Helvetica, sans-serif' => 'Arial',
'"Arial Black", Gadget, sans-serif' => 'Arial Black',
'"Comic Sans MS", cursive, sans-serif' => 'Comic Sans MS',
'"Courier New", Courier, monospace' => 'Courier New',
'Georgia, serif' => 'Georgia',
'Impact, Charcoal, sans-serif' => 'Impact',
'"Lucida Console", Monaco, monospace' => 'Lucida Console',
'"Lucida Sans Unicode", "Lucida Grande", sans-serif' => 'Lucida Sans Unicode',
'"Palatino Linotype", "Book Antiqua", Palatino, serif' => 'Palatino Linotype',
'Tahoma, Geneva, sans-serif' => 'Tahoma',
'"Times New Roman", Times, serif' => 'Times New Roman',
'"Trebuchet MS", Helvetica, sans-serif' => 'Trebuchet MS',
'Verdana, Geneva, sans-serif' => 'Verdana',
)
)
)
);
// Copyright Customizer
$wp_customize->add_setting( 'copyright_text', array(
'default' => 'Blog template built for WordPress by Schon Garcia.',
) );
$wp_customize->add_section( 'bootstrapcanvaswp_copyright_text' , array(
'title' => __( 'Copyright', 'bootstrapcanvaswp' ),
) );
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
'copyright_text',
array(
'label' => __( 'Update', 'bootstrapcanvaswp' ),
'section' => 'bootstrapcanvaswp_copyright_text',
'settings' => 'copyright_text',
'type' => 'text',
)
)
);
}
add_action( 'customize_register', 'bootstrapcanvaswp_customize_register' );
/**
* Customization CSS
*/
function bootstrapcanvaswp_customize_css()
{
?>