__('Primary Menu', 'aiowb'),
));
}
add_action('after_setup_theme', 'aiowb_register_menus');
add_theme_support('custom-header', array(
'default-image' => get_template_directory_uri() . '/assets/images/default-header.jpg',
'default-text-color' => '000',
));
add_theme_support( "custom-logo" );
add_theme_support( "custom-background" );
add_theme_support( 'automatic-feed-links' );
add_theme_support( 'post-thumbnails' );
add_theme_support( 'title-tag' );
add_theme_support( "wp-block-styles" );
add_theme_support( 'responsive-embeds' );
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
'script',
'style',
) );
add_theme_support( "align-wide" );
// Registering a custom widget
function aiowb_register_widgets() {
register_sidebar(array(
'name' => __('Sidebar', 'aiowb'),
'id' => 'sidebar-1',
'description' => __('Add widgets here to customize the sidebar.', 'aiowb'),
'before_widget' => '',
'before_title' => '
',
));
}
add_action('widgets_init', 'aiowb_register_widgets');
// Functions that reflect theme customizer settings
function aiowb_customize_css() {
// Get basic site information settings
$catchphrase = get_theme_mod( 'mytheme_catchphrase' );
// output css
echo '';
// }
// add_action('wp_head', 'aiowb_adds_head');
function aiowb_preload_resources($preload_resources) {
$new_resources = array(
array(
'href' => 'https://fonts.googleapis.com',
'as' => 'document',
'rel' => 'preconnect',
),
array(
'href' => 'https://fonts.gstatic.com',
'as' => 'document',
'rel' => 'preconnect',
'crossorigin' => 'anonymous',
),
);
return array_merge($preload_resources, $new_resources);
}
add_filter('wp_preload_resources', 'aiowb_preload_resources');
function aiowb_enqueue_styles() {
// Load theme stylesheet
wp_enqueue_style('aiowb-style', get_stylesheet_uri());
wp_enqueue_style('google-fonts', 'https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;700&family=Noto+Sans+JP:wght@300;600;700&display=swap', array(), null);
$custom_css = "
.site-navigation {
color: #" . get_header_textcolor() . ";
}
";
wp_add_inline_style('google-fonts', $custom_css);
}
add_action('wp_enqueue_scripts', 'aiowb_enqueue_styles');
// wp_footer
function aiowb_adds_footer() {
echo ''."\n";
}
add_action('wp_footer', 'aiowb_adds_footer');
function aiowb_wpdocs_theme_add_editor_styles() {
add_theme_support( 'editor-styles' );
add_editor_style( array( 'style.css', 'editor-style.css' ) );
}
add_action( 'after_setup_theme', 'aiowb_wpdocs_theme_add_editor_styles' );
add_theme_support( 'editor-styles' );
function aiowb_my_language(){
load_theme_textdomain('aiowb', get_template_directory() . '/languages');
}
add_action('after_setup_theme', 'aiowb_my_language');