__( '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' ); /** * Scripts and Styles */ function bootstrapcanvaswp_scripts() { // Main Stylesheet wp_enqueue_style( 'bootstrapcanvaswp-style', get_stylesheet_uri() ); if ( is_rtl() ) { wp_enqueue_style( 'bootstrapcanvaswp-style-rtl', get_template_directory_uri() . '/css/style-rtl.css' ); } // Blog Stylesheet wp_enqueue_style( 'bootstrapcanvaswp-blog', get_template_directory_uri() . '/css/blog.css' ); // Bootstrap CSS wp_enqueue_style( 'bootstrap.css', get_template_directory_uri() . '/css/bootstrap.css', '3.2.0' ); // Optional Theme wp_enqueue_style( 'bootstrap-theme.css', get_template_directory_uri() . '/css/bootstrap-theme.css', '3.2.0' ); // Bootstrap JavaScript wp_enqueue_script( 'bootstrap.js', get_template_directory_uri() . '/js/bootstrap.js', array( 'jquery' ), '3.2.0', true ); wp_enqueue_script( 'html5shiv.js', get_template_directory_uri() . '/js/html5shiv.js', array( 'jquery' ), '3.7.2' ); wp_enqueue_script( 'respond.js', get_template_directory_uri() . '/js/respond.js', array( 'jquery' ), '1.4.2' ); // Comment Reply Script wp_enqueue_script( "comment-reply" ); } add_action( 'wp_enqueue_scripts', 'bootstrapcanvaswp_scripts' ); /** * 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' => '

', 'after_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' => '

', 'after_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' => '

', 'after_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' => '

', 'after_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 bootstrapcanvaswp_new_excerpt_more( $more ) { return ' . . .'; } add_filter( 'excerpt_more', 'bootstrapcanvaswp_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-">
%s says:' ), get_comment_author_link() ); ?>
comment_approved == '0' ) : ?>
$add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
add_section( 'header_image' , array( 'title' => __( 'Header', 'bootstrapcanvaswp' ), ) ); $wp_customize->add_setting( 'logo', array( 'default' => '', 'sanitize_callback' => 'sanitize_file_name', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'logo', array( 'label' => __( 'Logo', 'bootstrapcanvaswp' ), 'section' => 'header_image', 'settings' => 'logo', 'priority' => '1', ) ) ); $wp_customize->add_setting( 'header_textcolor' , array( 'default' => '#333', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_textcolor', array( 'label' => __( 'Header Text Color', 'bootstrapcanvaswp' ), 'section' => 'header_image', 'settings' => 'header_textcolor', 'priority' => '2', ) ) ); $wp_customize->add_setting( 'header_color' , array( 'default' => '#f9f9f9', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'header_color', array( 'label' => __( 'Background Color', 'bootstrapcanvaswp' ), 'section' => 'header_image', 'settings' => 'header_color', 'priority' => '3', ) ) ); // Footer Customizer $wp_customize->add_section( 'bootstrapcanvaswp_footer' , array( 'title' => __( 'Footer', 'bootstrapcanvaswp' ), ) ); $wp_customize->add_setting( 'copyright_text', array( 'default' => 'Bootstrap Canvas WP WordPress theme, Copyright 2014 Schon Garcia', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'copyright_text', array( 'label' => __( 'Copyright', 'bootstrapcanvaswp' ), 'section' => 'bootstrapcanvaswp_footer', 'settings' => 'copyright_text', 'type' => 'text', 'priority' => '1', ) ) ); $wp_customize->add_setting( 'footer_textcolor' , array( 'default' => '#999', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_textcolor', array( 'label' => __( 'Footer Text Color', 'bootstrapcanvaswp' ), 'section' => 'bootstrapcanvaswp_footer', 'settings' => 'footer_textcolor', 'priority' => '2', ) ) ); $wp_customize->add_setting( 'footer_color' , array( 'default' => '#f9f9f9', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'footer_color', array( 'label' => __( 'Background Color', 'bootstrapcanvaswp' ), 'section' => 'bootstrapcanvaswp_footer', 'settings' => 'footer_color', 'priority' => '3', ) ) ); // Text Customizer $wp_customize->add_section( 'bootstrapcanvaswp_text' , array( 'title' => __( 'Text', 'bootstrapcanvaswp' ), ) ); $wp_customize->add_setting( 'font_family' , array( 'default' => 'Georgia, serif', 'sanitize_callback' => 'bootstrapcanvaswp_sanitize_font_selection', ) ); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'font_family', array( 'label' => __( 'Font Family', 'bootstrapcanvaswp' ), 'section' => 'bootstrapcanvaswp_text', 'settings' => 'font_family', 'priority' => '1', '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', ) ) ) ); $wp_customize->add_setting( 'text_color' , array( 'default' => '#555', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'text_color', array( 'label' => __( 'Text color', 'bootstrapcanvaswp' ), 'section' => 'bootstrapcanvaswp_text', 'settings' => 'text_color', 'priority' => '2', ) ) ); $wp_customize->add_setting( 'headings_color' , array( 'default' => '#333', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'headings_color', array( 'label' => __( 'Headings', 'bootstrapcanvaswp' ), 'section' => 'bootstrapcanvaswp_text', 'settings' => 'headings_color', 'priority' => '3', ) ) ); $wp_customize->add_setting( 'tracks_color' , array( 'default' => '#999', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'tracks_color', array( 'label' => __( 'Tracks (subtitles, captions, descriptions, chapters, or metadata)', 'bootstrapcanvaswp' ), 'section' => 'bootstrapcanvaswp_text', 'settings' => 'tracks_color', 'priority' => '4', ) ) ); $wp_customize->add_setting( 'link_color' , array( 'default' => '#428bca', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_color', array( 'label' => __( 'Links', 'bootstrapcanvaswp' ), 'section' => 'bootstrapcanvaswp_text', 'settings' => 'link_color', 'priority' => '5', ) ) ); // Navigation Customizer $wp_customize->add_setting( 'nav_menu_color' , array( 'default' => '#428bca', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'nav_menu_color', array( 'label' => __( 'Navigation Menu', 'bootstrapcanvaswp' ), 'section' => 'nav', 'settings' => 'nav_menu_color', ) ) ); $wp_customize->add_setting( 'menu_item_color' , array( 'default' => '#cdddeb', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'menu_item_color', array( 'label' => __( 'Navigation Menu Item', 'bootstrapcanvaswp' ), 'section' => 'nav', 'settings' => 'menu_item_color', ) ) ); $wp_customize->add_setting( 'current_menu_item_color' , array( 'default' => '#fff', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'current_menu_item_color', array( 'label' => __( 'Current Color', 'bootstrapcanvaswp' ), 'section' => 'nav', 'settings' => 'current_menu_item_color', ) ) ); } add_action( 'customize_register', 'bootstrapcanvaswp_customize_register' ); /** * Customization CSS */ function bootstrapcanvaswp_customize_css() { ?> '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', ); if ( array_key_exists( $input, $valid ) ) { return $input; } else { return ''; } }