__( 'Primary Menu', 'azakios' ), 'header-menu' => __( 'Header Menu', 'azakios' ), 'extra-menu' => __( 'Extra Menu', 'azakios' ) ) ); } add_action( 'init', 'register_my_menus' ); /********************************/ /**********************/ function get_the_top_ancestor_id() { global $post; if ( $post->post_parent ) { $ancestors = array_reverse( get_post_ancestors( $post->ID ) ); return $ancestors[0]; } else { return $post->ID; } } /* sets the excerpt length */ function customize_the_excerpt_length() { return 30; } add_filter( 'excerpt_length', 'customize_the_excerpt_length' ); /* Add Featured Image Support To Your WordPress Theme */ function add_featured_image_support_to_your_wordpress_theme() { add_theme_support( 'post-thumbnails' ); add_image_size( 'small-thumbnail', 100, 100, true ); add_image_size( 'single-post-image', 960, 250, true ); add_theme_support( 'post-formats', [ 'aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat', 'standard' ] ); } add_action( 'after_setup_theme', 'add_featured_image_support_to_your_wordpress_theme' ); function initialize_widgets() { register_sidebar( [ 'name' => 'Right Sidebar', 'id' => 'rightsidebar', 'before_widget' => '
', 'after_widget' => '
' ] ); register_sidebar( [ 'name' => 'Footer 1', 'id' => 'footer1', 'before_widget' => '
', 'after_widget' => '
' ] ); register_sidebar( [ 'name' => 'Footer 2', 'id' => 'footer2', 'before_widget' => '
', 'after_widget' => '
' ] ); register_sidebar( [ 'name' => 'Footer 3', 'id' => 'footer3', 'before_widget' => '
', 'after_widget' => '
' ] ); register_sidebar( [ 'name' => 'Footer 4', 'id' => 'footer4', 'before_widget' => '
', 'after_widget' => '
' ] ); register_sidebar( [ 'name' => 'Footer Above', 'id' => 'footerabove', 'before_widget' => '
', 'after_widget' => '
' ] ); } add_action( 'widgets_init', 'initialize_widgets' ); /*--------------------------*/ function register_azakios_widget_area() { register_sidebar(array( 'name' => __('Header Widget Area', 'azakios'), 'id' => 'header_widget', 'description' => __('Add widgets here to display in the header.', 'azakios'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } add_action('widgets_init', 'register_azakios_widget_area'); /*--------------------------*/ function register_azakios_widget_area1() { register_sidebar(array( 'name' => __('Header Widget Area1', 'azakios'), 'id' => 'header_widget_head_menu', 'description' => __('Add widgets here to display in the header.', 'azakios'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } add_action('widgets_init', 'register_azakios_widget_area1'); /*--------------------------*/ function register_azakios_widget_area2() { register_sidebar(array( 'name' => __('Header Widget Area2', 'azakios'), 'id' => 'header_widget_logo', 'description' => __('Add widgets here to display in the header.', 'azakios'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } add_action('widgets_init', 'register_azakios_widget_area2'); /*--------------------------*/ function register_azakios_widget_footer_copyright() { register_sidebar(array( 'name' => __('Footer Copyright Widget ', 'azakios'), 'id' => 'footer_copyright_widget', 'description' => __('Add widgets here to display in the header.', 'azakios'), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); } add_action('widgets_init', 'register_azakios_widget_footer_copyright'); function azakios_theme_customizer_settings($wp_customize) { // Add a section for theme options $wp_customize->add_section('header_section', array( 'title' => __('Header Options', 'azakios'), 'priority' => 30, )); // Add a setting for header background color $wp_customize->add_setting('header_background_color', array( 'default' => '#333333', 'sanitize_callback' => 'sanitize_hex_color', )); // Add a control for header background color $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_background_color', array( 'label' => __('Header Background Color', 'azakios'), 'section' => 'header_section', ))); // Add a setting for title color $wp_customize->add_setting('title_color', array( 'default' => '#333333', 'sanitize_callback' => 'sanitize_hex_color', )); // Add a control for title color $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'title_color', array( 'label' => __('Title Color', 'azakios'), 'section' => 'header_section', ))); } add_action('customize_register', 'azakios_theme_customizer_settings'); function azakios_theme_customizer_css() { $header_background_color = get_theme_mod('header_background_color', '#333333'); $title_color = get_theme_mod('title_color', '#333333'); // Retrieve title color setting // Output the custom CSS echo ''; } add_action('wp_head', 'azakios_theme_customizer_css'); /************************/ function azakios_customize_register($wp_customize) { // Logo Section $wp_customize->add_section('logo_section', array( 'title' => __('Logo Options', 'azakios'), 'priority' => 30, )); // Display Logo $wp_customize->add_setting('display_logo', array( 'default' => true, 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('display_logo', array( 'label' => __('Display Logo', 'azakios'), 'section' => 'logo_section', 'type' => 'checkbox', )); // Custom Logo $wp_customize->add_setting('custom_logo', array( 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'custom_logo', array( 'label' => __('Custom Logo', 'azakios'), 'section' => 'logo_section', ))); // Display Title $wp_customize->add_setting('display_title', array( 'default' => true, 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('display_title', array( 'label' => __('Display Title', 'azakios'), 'section' => 'logo_section', 'type' => 'checkbox', )); // Logo Size $wp_customize->add_setting('logo_size', array( 'default' => 100, // Set your default logo size 'sanitize_callback' => 'absint', )); $wp_customize->add_control('logo_size', array( 'label' => __('Logo Size', 'azakios'), 'section' => 'logo_section', 'type' => 'number', 'input_attrs' => array( 'min' => 50, // Set minimum logo size 'max' => 200, // Set maximum logo size 'step' => 1, ), )); } add_action('customize_register', 'azakios_customize_register'); function custom_posts_per_page($query) { if ($query->is_main_query() && !is_admin()) { $query->set('posts_per_page', 10); // Adjust the number accordingly } } add_action('pre_get_posts', 'custom_posts_per_page');