esc_html__( 'Header', 'flexitheme' ), 'quickmenu' => esc_html__( 'Quick Menu', 'flexitheme' ), 'footermenu' => esc_html__( 'Footer Menu', 'flexitheme' ), )); //Enable custom logo add_theme_support('custom-logo', array( 'height' => 200, 'width' => 400, 'flex-height' => true, 'flex-width' => true, )); /* block pattern */ require_once( get_template_directory() . '/functions/patterns.php' ); } add_action('after_setup_theme', 'flexitheme_setup'); function flexitheme_register_block_styles() { register_block_style( 'core/paragraph', array( 'name' => 'highlighted-paragraph', 'label' => __('Highlighted Paragraph', 'flexitheme'), 'inline_style' => '.is-style-highlighted-paragraph { background-color: #f9bc60; padding: 10px; }', ) ); register_block_style( 'core/image', array( 'name' => 'rounded-image', 'label' => __('Rounded Image', 'flexitheme'), ) ); } add_action('init', 'flexitheme_register_block_styles'); function flexitheme_wp_block_styles() { add_theme_support( 'wp-block-styles' ); } add_action( 'after_setup_theme', 'flexitheme_wp_block_styles' ); function flexitheme_responsive_embeds() { add_theme_support( 'responsive-embeds' ); } add_action( 'after_setup_theme', 'flexitheme_responsive_embeds' ); function flexitheme_comment_support() { add_theme_support('comments'); } add_action('after_setup_theme', 'flexitheme_comment_support'); function flexitheme_html5_support() { add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', ) ); } add_action( 'after_setup_theme', 'flexitheme_html5_support' ); function flexitheme_enqueue_comment_reply_script() { if (is_single() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } } add_action('wp_enqueue_scripts', 'flexitheme_enqueue_comment_reply_script'); // Load translation function flexitheme_load_textdomain() { load_theme_textdomain('flexitheme', get_template_directory() . '/languages'); } add_action('after_setup_theme', 'flexitheme_load_textdomain'); // Custom Sidebar function flexitheme_custom_sidebar() { register_sidebar( array( 'name' => 'Custom Sidebar', 'id' => 'custom-sidebar', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'flexitheme_custom_sidebar' ); /*Custom Logo */ function flexitheme_customize_logo_section($wp_customize) { $wp_customize->add_section('logo_section', array( 'title' => __('Logo', 'flexitheme'), 'priority' => 30, 'description' => __('Manage the site logo and additional logo options.', 'flexitheme'), )); $wp_customize->get_control('custom_logo')->section = 'logo_section'; $wp_customize->get_control('custom_logo')->priority = 1; $wp_customize->get_control('custom_logo')->label = __('Default Logo', 'flexitheme'); $wp_customize->get_control('custom_logo')->description = __('Upload a default logo to be used in the header site.', 'flexitheme'); $wp_customize->add_setting('footer_logo', array( 'default' => '', // No logo default 'transport' => 'refresh', 'sanitize_callback' => 'esc_url', )); $wp_customize->add_control(new WP_Customize_Image_Control( $wp_customize, 'footer_logo', array( 'label' => __('Footer Logo', 'flexitheme'), 'description' => __('Upload a logo to be used in the footer.', 'flexitheme'), 'section' => 'logo_section', 'priority' => 3, ) )); } add_action('customize_register', 'flexitheme_customize_logo_section'); /* Enqueue javascript /* ------------------------------------ */ function flexitheme_scripts() { wp_enqueue_script('flexitheme-gsap-js', 'https://cdn.jsdelivr.net/npm/gsap@3.12.5/dist/gsap.min.js', array(), null, true); wp_enqueue_script('flexitheme-gsap-scrolltrigger-js', 'https://cdn.jsdelivr.net/npm/gsap@3.12.5/dist/ScrollTrigger.min.js', array(), null, true); wp_enqueue_script('flexitheme-scripts', get_template_directory_uri() . '/js/scripts.js','','', true ); } add_action( 'wp_enqueue_scripts', 'flexitheme_scripts' ); /* Enqueue css /* ------------------------------------ */ function flexitheme_styles() { wp_enqueue_style( 'simple-style', get_template_directory_uri().'/style.css'); wp_enqueue_style( 'editor-style', get_template_directory_uri().'/custom-editor-style.css'); } add_action( 'wp_enqueue_scripts', 'flexitheme_styles' ); function flexitheme_add_editor_styles() { add_editor_style('custom-editor-style.css'); } add_action('after_setup_theme', 'flexitheme_add_editor_styles'); /*Require custom function */ require_once('functions/customizer.php'); ?>