1920, 'height' => 400, 'flex-width' => true, 'flex-height' => true, ) ); add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'style', 'script', ) ); // Menu support register_nav_menus( array( 'blogoralite_primary_menu' => __( 'Primary Menu', 'blogoralite' ), ) ); add_editor_style( 'editor-style.css' ); // Search form support automatic (get_search_form) } add_action( 'after_setup_theme', 'blogoralite_setup' ); function blogoralite_comment_reply() { if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'blogoralite_comment_reply' ); function blogoralite_excerpt_length( $length ) { return 20; } add_filter( 'excerpt_length', 'blogoralite_excerpt_length' ); //enqueue_styles function blogoralite_enqueue_styles() { // Main stylesheet wp_enqueue_style( 'blogoralite-style', get_template_directory_uri() . '/assets/style.css', array(), wp_get_theme()->get('Version') ); wp_enqueue_style( 'blogoralite-style-page', get_template_directory_uri() . '/assets/page-style.css', array(), wp_get_theme()->get('Version') ); wp_enqueue_style( 'blogoralite-main-style', get_stylesheet_uri(), array(), wp_get_theme()->get('Version') ); } add_action( 'wp_enqueue_scripts', 'blogoralite_enqueue_styles' ); // Enqueue scripts function blogoralite_enqueue_scripts() { wp_enqueue_script( 'blogoralite-script', get_template_directory_uri() . '/assets/index.js', array(), wp_get_theme()->get('Version'), true ); } add_action( 'wp_enqueue_scripts', 'blogoralite_enqueue_scripts' ); function blogoralite_customize_register( $wp_customize ) { // Add Section for Footer $wp_customize->add_section( 'blogoralite_footer_section', array( 'title' => __( 'Footer Settings', 'blogoralite' ), 'priority' => 160, 'description' => __( 'Customize the footer text', 'blogoralite' ), ) ); // Add Setting for Footer Text $wp_customize->add_setting( 'blogoralite_copyright_sections', array( 'default' => __( 'Powered by WordPress | Theme: BlogoraLite by CodeVibrant.', 'blogoralite' ), 'sanitize_callback' => 'sanitize_text_field', ) ); // Add Control for Footer Text $wp_customize->add_control( 'blogoralite_copyright_sections', array( 'label' => __( 'Footer Text', 'blogoralite' ), 'section' => 'blogoralite_footer_section', 'settings' => 'blogoralite_copyright_sections', 'type' => 'text', ) ); } add_action( 'customize_register', 'blogoralite_customize_register' ); function blogoralite_customize_register_footer( $wp_customize ) { $wp_customize->add_section( 'blogoralite_footer_section', array( 'title' => __( 'Footer Settings', 'blogoralite' ), 'priority' => 160, ) ); $wp_customize->add_setting( 'blogoralite_copyright_sections', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'blogoralite_copyright_sections', array( 'label' => __( 'Footer Custom Text', 'blogoralite' ), 'section' => 'blogoralite_footer_section', 'settings' => 'blogoralite_copyright_sections', 'type' => 'text', ) ); /** * Register Customizer settings for BlogoraLite Footer */ // Add Footer Settings Section $wp_customize->add_setting( 'blogoralite_license_text', array( 'default' => __( 'GPL v2 or later', 'blogoralite' ), 'sanitize_callback' => 'sanitize_text_field', ) ); // 1. Setting & Control for Extra Copyright Text $wp_customize->add_control( 'blogoralite_license_text', array( 'label' => __( 'License Link Text', 'blogoralite' ), 'section' => 'blogoralite_footer_section', 'settings' => 'blogoralite_license_text', 'type' => 'text', ) ); // 2. Setting & Control for License Name $wp_customize->add_setting( 'blogoralite_license_url', array( 'default' => 'https://www.gnu.org/licenses/gpl-2.0.html', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( 'blogoralite_license_url', array( 'label' => __( 'License URL', 'blogoralite' ), 'section' => 'blogoralite_footer_section', 'settings' => 'blogoralite_license_url', 'type' => 'url', ) ); } add_action( 'customize_register', 'blogoralite_customize_register_footer' ); // Custom Walker for Navigation Menu class BlogoraLite_Walker_Nav_Menu extends Walker_Nav_Menu { function start_el( &$output, $item, $depth = 0, $args = null, $id = 0 ) { $classes = empty( $item->classes ) ? array() : (array) $item->classes; $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) ); $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : ''; $id = apply_filters( 'nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args ); $id = $id ? ' id="' . esc_attr( $id ) . '"' : ''; $output .= '