90,
'width' => 90,
'flex-height' => false,
'flex-width' => false,
'header-text' => array('site-title', 'site-description'),
'unlink-homepage-logo' => false,
);
add_theme_support('custom-logo', $defaults);
add_theme_support( 'wp-block-styles' );
add_theme_support( 'responsive-embeds' );
add_theme_support('post-thumbnails');
add_theme_support( 'custom-header' );
add_theme_support( 'html5', array( 'navigation-widgets' ) );
add_theme_support( 'align-wide' );
register_nav_menus(
array(
'header-menu' => esc_html__('Header Menu', 'ahona'),
'footer-menu' => esc_html__('Footer Menu', 'ahona'),
)
);
// Move sidebar registration to widgets_init action
add_action('widgets_init', __NAMESPACE__ . '\\register_sidebars');
}
add_action('after_setup_theme', __NAMESPACE__ . '\\theme_setup');
/**
* Register theme sidebars.
*/
function register_sidebars() {
register_sidebar(array(
'name' => __('Blog Page Right sidebar', 'ahona'),
'id' => 'blog-right',
'before_widget' => '',
'before_title' => '
',
));
register_sidebar(array(
'name' => __('Single Post Right sidebar', 'ahona'),
'id' => 'post-right',
'before_widget' => '',
'before_title' => '',
));
register_sidebar(array(
'name' => __('Single Page Right sidebar', 'ahona'),
'id' => 'page-right',
'before_widget' => '',
'before_title' => '',
));
}
/**
* Enqueue theme assets.
*
* @return void
*/
function enqueue_assets() {
wp_enqueue_style(
'normalize',
get_template_directory_uri() . '/public/css/normalize.css',
[],
VERSION
);
wp_enqueue_style(
'styles',
get_template_directory_uri() . '/public/css/style.css',
[],
VERSION
);
wp_enqueue_script(
'styles',
get_template_directory_uri() . '/public/js/mobile-menu.js',
[],
VERSION
);
}
add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\enqueue_assets' );
// Add Customizer option for copyright text within the namespace
function theme_customizer_settings($wp_customize) {
$wp_customize->add_section('theme_copyright_section', array(
'title' => 'Copyright Text',
'priority' => 30,
));
$wp_customize->add_setting('copyright_text', array(
'default' => '© ' . date('Y') . ' Your Blog Name. All Rights Reserved.',
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('copyright_text', array(
'label' => 'Copyright Text',
'section' => 'theme_copyright_section',
'type' => 'text',
));
}
add_action('customize_register', __NAMESPACE__ . '\\theme_customizer_settings');