__( 'Top Menu', 'jl-best-blog' ), 'header-menu' => __( 'Header Menu', 'jl-best-blog' ), ) ); } add_action( 'init', 'jlbestblog_register_my_menus' ); // Include logo function jlbestblog_set_custom_logo() { $defaults = array( 'height' => 100, 'width' => 120, 'flex-height' => true, 'flex-width' => true, // 'header-text' => array( 'site-title', 'site-description' ), ); add_theme_support( 'custom-logo', $defaults ); } add_action( 'after_setup_theme', 'jlbestblog_set_custom_logo' ); // Include custom style editor (TinyMCE visual editor) function jlbestblog_add_editor_styles() { add_editor_style( 'inc/css/editor-style.css' ); } // add_action( 'admin_init', 'jlbestblog_add_editor_styles' ); // Include custom styles for admin blocks function jlbestblog_enqueue_admin_stylesheet($jlbestblog_version) { wp_enqueue_style( 'jlbestblog-admin-css', get_stylesheet_directory_uri() . '/inc/css/editor-style.css', false, $jlbestblog_version ); } add_action( 'admin_enqueue_scripts', 'jlbestblog_enqueue_admin_stylesheet' ); // Include custom header function jlbestblog_set_custom_header() { $header_info = array( 'width' => 1200, 'height' => 700, 'flex-width' => true, 'flex-height' => true, 'default-image' => get_theme_file_uri() . '/inc/images/winter.jpg', // Display the header text along with the image 'header-text' => true, // Header text color default 'default-text-color' => '1e73be', ); add_theme_support( 'custom-header', $header_info ); // register header(s) $header_images = array( 'winter' => array( 'url' => get_theme_file_uri() . '/inc/images/winter.jpg', 'thumbnail_url' => get_theme_file_uri() . '/inc/images/winter.jpg', 'description' => 'Header image', ), ); register_default_headers( $header_images ); } add_action( 'after_setup_theme', 'jlbestblog_set_custom_header' ); // setup function jlbestblog_setup() { // Add site title support (and remove hard coded
. 'priority' => 50, ) ); // Adding sections $wp_customize->add_section( 'header' , array( 'title' => __( 'Header Search Box', 'jl-best-blog' ), 'panel' => 'header', 'priority' => 50, ) ); $wp_customize->add_section( 'header_image' , array( 'title' => __( 'Header Image', 'jl-best-blog' ), 'panel' => 'header', 'priority' => 50, ) ); $wp_customize->add_section( 'colors' , array( 'title' => __( 'Colors', 'jl-best-blog' ), 'panel' => 'appearance', 'priority' => 10, ) ); $wp_customize->add_section( 'background_image' , array( 'title' => __( 'Background image', 'jl-best-blog' ), 'panel' => 'appearance', 'priority' => 20, ) ); $wp_customize->add_section( 'front-page-layout' , array( 'title' => __( 'Front Page Layout', 'jl-best-blog' ), 'panel' => 'appearance', 'priority' => 30, ) ); $wp_customize->add_section( 'single-post-layout' , array( 'title' => __( 'Single Post Layout', 'jl-best-blog' ), 'panel' => 'appearance', 'priority' => 40, ) ); $wp_customize->add_section( 'single-page-layout' , array( 'title' => __( 'Single Page Layout', 'jl-best-blog' ), 'panel' => 'appearance', 'priority' => 50, ) ); $wp_customize->add_section( 'archive-layout' , array( 'title' => __( 'Archive Layout', 'jl-best-blog' ), 'panel' => 'appearance', 'priority' => 60, ) ); $wp_customize->add_section( 'footer' , array( 'title' => __( 'Footer', 'jl-best-blog' ), 'panel' => 'appearance', 'priority' => 70, ) ); // Adding controls - main site $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'menu_background_color', array( 'label' => __( 'Primary color', 'jl-best-blog' ), 'section' => 'colors', 'settings' => 'menu_background_color', // 'type' => '' // do not set type for color picker ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'menu_font_color', array( 'label' => __( 'Menu font color', 'jl-best-blog' ), 'section' => 'colors', 'settings' => 'menu_font_color', // 'type' => '' // do not set type for color picker ) ) ); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_hover_color', array( 'label' => __( 'Secondary color', 'jl-best-blog' ), 'section' => 'colors', 'settings' => 'link_hover_color', // 'type' => '' // do not set type for color picker ) ) ); $wp_customize->add_control( 'header_searchbox', array( 'label' => __( 'Display header searchbox', 'jl-best-blog' ), 'section' => 'header', 'settings' => 'header_searchbox', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'left_column', array( 'label' => __( 'Display left column', 'jl-best-blog' ), 'section' => 'front-page-layout', 'settings' => 'left-column', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'right_column', array( 'label' => __( 'Display right column', 'jl-best-blog' ), 'section' => 'front-page-layout', 'settings' => 'right-column', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'post-meta', array( 'label' => __( 'Enable post meta on front page', 'jl-best-blog' ), 'section' => 'front-page-layout', 'settings' => 'post-meta', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'front-page-image', array( 'label' => __( 'Post Image Position on Front Page and Archives Pages', 'jl-best-blog' ), 'section' => 'front-page-layout', 'settings' => 'front-page-image', 'type' => 'radio', 'choices' => array( 'left' => 'Left side', 'above' => 'Above text', ), ) ); $wp_customize->add_control( 'excerpt-length', array( 'label' => __( 'Choose Excerpt Length', 'jl-best-blog' ), 'section' => 'front-page-layout', 'settings' => 'excerpt-length', 'type' => 'number', ) ); $wp_customize->add_control( 'footer-column-1', array( 'label' => __( ' Display footer sidebar 1', 'jl-best-blog' ), 'section' => 'footer', 'settings' => 'footer-column-1', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'footer-column-2', array( 'label' => __( ' Display footer sidebar 2', 'jl-best-blog' ), 'section' => 'footer', 'settings' => 'footer-column-2', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'footer-column-3', array( 'label' => __( ' Display footer sidebar 3', 'jl-best-blog' ), 'section' => 'footer', 'settings' => 'footer-column-3', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'footer-privacy-policy', array( 'label' => __( ' Display link to privacy policy', 'jl-best-blog' ), 'section' => 'footer', 'settings' => 'footer-privacy-policy', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'footer-social-icon', array( 'label' => __( 'Enable social icons section', 'jl-best-blog' ), 'section' => 'footer', 'settings' => 'footer-social-icon', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'social-icon-facebook', array( 'label' => __( 'Link to your Facebook', 'jl-best-blog' ), 'section' => 'footer', 'settings' => 'social-icon-facebook', ) ); $wp_customize->add_control( 'social-icon-instagram', array( 'label' => __( 'Link to your Instagram', 'jl-best-blog' ), 'section' => 'footer', 'settings' => 'social-icon-instagram', ) ); $wp_customize->add_control( 'social-icon-twitter', array( 'label' => __( 'Link to your Twitter', 'jl-best-blog' ), 'section' => 'footer', 'settings' => 'social-icon-twitter', ) ); $wp_customize->add_control( 'social-icon-pinterest', array( 'label' => __( 'Link to your Pinterest', 'jl-best-blog' ), 'section' => 'footer', 'settings' => 'social-icon-pinterest', ) ); $wp_customize->add_control( 'social-icon-youtube', array( 'label' => __( 'Link to your Youtube', 'jl-best-blog' ), 'section' => 'footer', 'settings' => 'social-icon-youtube', ) ); $wp_customize->add_control( 'social-icon-whatsapp', array( 'label' => __( 'Link to your Whatsapp', 'jl-best-blog' ), 'section' => 'footer', 'settings' => 'social-icon-whatsapp', ) ); $wp_customize->add_control( 'social-icon-messenger', array( 'label' => __( 'Link to your Messenger', 'jl-best-blog' ), 'section' => 'footer', 'settings' => 'social-icon-messenger', ) ); $wp_customize->add_control( 'social-icon-linkedin', array( 'label' => __( 'Link to your Linkedin', 'jl-best-blog' ), 'section' => 'footer', 'settings' => 'social-icon-linkedin', ) ); // Adding controls - single post $wp_customize->add_control( 'left-column-single', array( 'label' => __( 'Display left column', 'jl-best-blog' ), 'section' => 'single-post-layout', 'settings' => 'left-column-single', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'right-column-single', array( 'label' => __( 'Display right column', 'jl-best-blog' ), 'section' => 'single-post-layout', 'settings' => 'right-column-single', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'post-meta-single', array( 'label' => __( 'Enable post meta', 'jl-best-blog' ), 'section' => 'single-post-layout', 'settings' => 'post-meta-single', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'display-header-image-on-post', array( 'label' => __( 'Display header image', 'jl-best-blog' ), 'section' => 'single-post-layout', 'settings' => 'display-header-image-on-post', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'display-tags-in-post', array( 'label' => __( 'Display tags', 'jl-best-blog' ), 'section' => 'single-post-layout', 'settings' => 'display-tags-in-post', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'post-image-single', array( 'label' => __( 'Display post image in single post', 'jl-best-blog' ), 'section' => 'single-post-layout', 'settings' => 'post-image-single', 'type' => 'checkbox', ) ); // Adding controls - single page $wp_customize->add_control( 'left-column-single-page', array( 'label' => __( 'Display left column', 'jl-best-blog' ), 'section' => 'single-page-layout', 'settings' => 'left-column-single-page', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'right-column-single-page', array( 'label' => __( 'Display right column', 'jl-best-blog' ), 'section' => 'single-page-layout', 'settings' => 'right-column-single-page', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'page-meta', array( 'label' => __( 'Enable post meta', 'jl-best-blog' ), 'section' => 'single-page-layout', 'settings' => 'page-meta', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'display-header-image-on-page', array( 'label' => __( 'Display header image', 'jl-best-blog' ), 'section' => 'single-page-layout', 'settings' => 'display-header-image-on-page', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'page-image', array( 'label' => __( 'Display image on single page', 'jl-best-blog' ), 'section' => 'single-page-layout', 'settings' => 'page-image', 'type' => 'checkbox', ) ); // Adding controls - archive page $wp_customize->add_control( 'left-column-archive', array( 'label' => __( 'Display left column', 'jl-best-blog' ), 'section' => 'archive-layout', 'settings' => 'left-column-archive', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'right-column-archive', array( 'label' => __( 'Display right column', 'jl-best-blog' ), 'section' => 'archive-layout', 'settings' => 'right-column-archive', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'display-header-image-on-archive', array( 'label' => __( 'Display header image', 'jl-best-blog' ), 'section' => 'archive-layout', 'settings' => 'display-header-image-on-archive', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'post-meta-archive', array( 'label' => __( 'Enable post meta on archive pages', 'jl-best-blog' ), 'section' => 'archive-layout', 'settings' => 'post-meta-archive', 'type' => 'checkbox' ) ); $wp_customize->add_control( 'taxonomy-description', array( 'label' => __( 'Taxonomy description position', 'jl-best-blog' ), 'section' => 'archive-layout', 'settings' => 'taxonomy-description', 'type' => 'radio', 'choices' => array( 'top' => 'Above content', 'bottom' => 'Below content', 'none' => 'None' ), ) ); $wp_customize->add_control( 'archive-image', array( 'label' => __( 'Post Image Position on Front Page and Archives Pages', 'jl-best-blog' ), 'section' => 'archive-layout', 'settings' => 'archive-image', 'type' => 'radio', 'choices' => array( 'left' => 'Left side', 'above' => 'Above text', ), ) ); } add_action( 'customize_register', 'jlbestblog_customize_register' ); // Register sidebars function jlbestblog_widgets_init() { register_sidebar( array( 'name' => __( 'Left Sidebar', 'jl-best-blog' ), 'id' => 'sidebar-left', 'before_widget' => '
', 'before_title' => '