240,
'width' => 240,
'flex-height' => true,
) );
add_theme_support( 'custom-background', array(
'default-color' => 'f1f1f1'
) );
/*
* This theme styles the visual editor to resemble the theme style,
* specifically font, colors, icons, and column width.
*/
add_editor_style( array( 'css/editor-style.css', the_wp_fitness_font_url() ) );
}
endif;
add_action( 'after_setup_theme', 'core_fitness_setup' );
add_action( 'wp_enqueue_scripts', 'core_fitness_enqueue_styles' );
function core_fitness_enqueue_styles() {
$parent_style = 'core-fitness-style'; // Style handle of parent theme.
wp_enqueue_style( 'bootstrap-css', get_template_directory_uri().'/css/bootstrap.css' );
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'core-fitness-style', get_stylesheet_uri(), array( $parent_style ) );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
wp_enqueue_style( 'core-fitness-block-patterns-style-frontend', get_theme_file_uri('/block-patterns/css/block-frontend.css') );
}
function core_fitness_customize_register() {
global $wp_customize;
$wp_customize->remove_section( 'the_wp_fitness_theme_color_option' );
}
add_action( 'customize_register', 'core_fitness_customize_register', 11 );
function core_fitness_remove_parent_function() {
remove_action( 'admin_notices', 'the_wp_fitness_activation_notice' );
remove_action( 'admin_menu', 'the_wp_fitness_gettingstarted' );
}
add_action( 'init', 'core_fitness_remove_parent_function');
/* Theme Widgets Setup */
function core_fitness_widgets_init() {
register_sidebar( array(
'name' => __( 'Blog Sidebar', 'core-fitness' ),
'description' => __( 'Appears on blog page sidebar', 'core-fitness' ),
'id' => 'sidebar-1',
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Page Sidebar', 'core-fitness' ),
'description' => __( 'Appears on page sidebar', 'core-fitness' ),
'id' => 'sidebar-2',
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Third Column Sidebar', 'core-fitness' ),
'description' => __( 'Appears on page sidebar', 'core-fitness' ),
'id' => 'sidebar-3',
'before_widget' => '',
'before_title' => '',
) );
$core_fitness_footer_columns = get_theme_mod('core_fitness_footer_widget', '4');
for ($i=1; $i<=$core_fitness_footer_columns; $i++) {
register_sidebar( array(
'name' => __( 'Footer ', 'core-fitness' ) . $i,
'id' => 'footer-' . $i,
'description' => '',
'before_widget' => '',
'before_title' => '',
) );
}
}
add_action( 'widgets_init', 'core_fitness_widgets_init' );
/**
* Enqueue block editor style
*/
function core_fitness_block_editor_styles() {
wp_enqueue_style( 'core-fitness-font', the_wp_fitness_font_url(), array() );
wp_enqueue_style( 'core-fitness-block-patterns-style-editor', get_theme_file_uri( '/block-patterns/css/block-editor.css' ), false, '1.0', 'all' );
wp_enqueue_style( 'font-awesome-css', get_template_directory_uri().'/css/fontawesome-all.css' );
}
add_action( 'enqueue_block_editor_assets', 'core_fitness_block_editor_styles' );
function core_fitness_customizer ( $wp_customize ) {
//Trending Product
$wp_customize->add_section('core_fitness_products',array(
'title' => __('New Products','core-fitness'),
'description'=> __('This section will appear below the slider.','core-fitness'),
'panel' => 'the_wp_fitness_panel_id',
));
$wp_customize->add_setting('core_fitness_title',array(
'default'=> '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('core_fitness_title',array(
'label' => __('Section Title','core-fitness'),
'section'=> 'core_fitness_products',
'setting'=> 'core_fitness_title',
'type'=> 'text'
));
$wp_customize->add_setting( 'core_fitness_page', array(
'default' => '',
'sanitize_callback' => 'the_wp_fitness_sanitize_dropdown_pages'
));
$wp_customize->add_control( 'core_fitness_page', array(
'label' => __( 'Select Page', 'core-fitness' ),
'section' => 'core_fitness_products',
'type' => 'dropdown-pages'
));
}
add_action( 'customize_register', 'core_fitness_customizer' );
/* Block Pattern */
require get_theme_file_path('/block-patterns/block-patterns.php');