'Header Menu', 'footer-one'=> 'footer Menu1', 'footer-two'=> 'footer Menu2', 'footer-three'=> 'footer Menu3', 'footer-four'=> 'footer Menu4', )); } add_action('init', 'add_nav_menus'); /* ========================================== Theme support function ========================================== */ //add_theme_support('custom-background'); //add_theme_support('custom-header'); add_theme_support( 'wp-block-styles' ); add_theme_support( 'responsive-embeds' ); //add_theme_support( 'post-formats' ); add_theme_support( "align-wide" ); add_theme_support( 'title-tag' ); add_theme_support( 'automatic-feed-links' ); add_theme_support('post-thumbnails'); add_theme_support('html5',array('search-form')); add_theme_support( 'custom-logo', array( 'height' => 100, 'width' => 400, 'flex-height' => true, 'flex-width' => true, 'header-text' => array( 'site-title', 'site-description' ), ) ); add_action( 'after_setup_theme', 'woocommerce_support' ); function woocommerce_support() { add_theme_support( 'woocommerce' ); } add_theme_support( 'custom-header', array( 'width' => 1200, // Set the width of the header image 'height' => 600, // Set the height of the header image 'flex-width' => true, // Allow flexible width 'flex-height' => true, // Allow flexible height 'header-text' => false, // Disable text in the header image ) ); add_theme_support( 'custom-background', array( 'default-color' => 'ffffff', // Set the default background color 'default-image' => '', // Set the default background image 'wp-head-callback' => '_custom_background_cb', 'admin-head-callback' => '', 'admin-preview-callback' => '' ) ); /* ========================================== Sidebar function ========================================== */ function ahona_widget_setup() { register_sidebar( array( 'name' => 'Sidebar', 'id' => 'sidebar-1', 'class' => 'custom', 'description' => 'Standard Sidebar', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action('widgets_init','ahona_widget_setup'); function ahona_widget_setup2() { register_sidebar( array( 'name' => 'Footer One Title', 'id' => 'sidebar-02', 'class' => 'custom2', 'description' => 'Footer One Title', 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); } add_action('widgets_init','ahona_widget_setup2'); function ahona_widget_setup3() { register_sidebar( array( 'name' => 'Footer Two Title', 'id' => 'sidebar-3', 'class' => 'custom2', 'description' => 'Footer Two Title', 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); } add_action('widgets_init','ahona_widget_setup3'); function ahona_widget_setup4() { register_sidebar( array( 'name' => 'Footer Three Title', 'id' => 'sidebar-4', 'class' => 'custom2', 'description' => 'Footer Three Title', 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); } add_action('widgets_init','ahona_widget_setup4'); function ahona_widget_setup5() { register_sidebar( array( 'name' => 'Footer Four Title', 'id' => 'sidebar-5', 'class' => 'custom2', 'description' => 'Footer Four Title', 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); } add_action('widgets_init','ahona_widget_setup5'); function ahona_widget_setup6() { register_sidebar( array( 'name' => 'Footer Copy Right Text', 'id' => 'sidebar-6', 'class' => 'custom2', 'description' => 'Footer Copy Right Text', 'before_widget' => '', 'before_title' => '
', 'after_title' => '
', ) ); } add_action('widgets_init','ahona_widget_setup6'); /* ========================================== Include Walker file ========================================== */ require get_template_directory() . '/inc/walker.php'; /* ========================================== Head function ========================================== */ function ahona_remove_version() { return ''; } add_filter('the_generator', 'ahona_remove_version'); /* ========================================== Custom Term Function ========================================== */ function ahona_get_terms( $postID, $term ){ $terms_list = wp_get_post_terms($postID, $term); $output = ''; $i = 0; foreach( $terms_list as $term ){ $i++; if( $i > 1 ){ $output .= ', '; } $output .= ''. $term->name .''; } return $output; } // Add a section for social links function custom_theme_customize_register($wp_customize) { $wp_customize->add_section('custom_social_links', array( 'title' => __('Social Links', 'ahona'), 'priority' => 30, )); // Add individual social link fields $social_icons = array( 'facebook' => 'fa-facebook', 'twitter' => 'fa-twitter', 'instagram' => 'fa-instagram', 'linkedin' => 'fa-linkedin', 'youtube' => 'fa-youtube', ); foreach ($social_icons as $key => $icon) { $wp_customize->add_setting($key . '_link', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control($key . '_link', array( 'label' => ucwords($key) . ' Link', 'section' => 'custom_social_links', 'type' => 'text', )); } } add_action('customize_register', 'custom_theme_customize_register'); function custom_theme_customize_register_color($wp_customize) { // Add a section for header customization $wp_customize->add_section('header_customization', array( 'title' => __('Header Customization', 'ahona'), 'priority' => 30, )); // Add anchor text color setting $wp_customize->add_setting('anchor_text_color', array( 'default' => '#686a6f', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'anchor_text_color', array( 'label' => __('Anchor Text Color', 'ahona'), 'section' => 'header_customization', 'settings' => 'anchor_text_color', ))); // Add header background color setting $wp_customize->add_setting('header_background_color', array( 'default' => '#eeeeee', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_background_color', array( 'label' => __('Header Background Color', 'ahona'), 'section' => 'header_customization', 'settings' => 'header_background_color', ))); } add_action('customize_register', 'custom_theme_customize_register_color'); function enqueue_comment_reply_ahona() { if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'enqueue_comment_reply_ahona' ); function website_remove($fields) { if(isset($fields['url'])) unset($fields['url']); return $fields; } add_filter('comment_form_default_fields', 'website_remove'); add_filter( 'comment_form_fields', 'ahona_move_comment_field', 10, 3 ); function ahona_move_comment_field( $fields) { $comment_field = $fields['comment']; unset( $fields['comment'] ); $fields['comment'] = $comment_field; return $fields; }