<?php

function load_stylesheets(){
   
    wp_register_style('bootsrtap-core', get_template_directory_uri().'/assets/css/bootstrap.min.css','stylesheet', get_template_directory_uri().'/style.css','',1,'all');
    wp_register_style('stylesheet', get_template_directory_uri().'/style.css','',1,'all');
    wp_enqueue_style('stylesheet');
    wp_enqueue_style('bootsrtap-core');

    if( is_singular() && comments_open() && get_option('thread_comments')){
        wp_enqueue_script('comment-reply');
    }
}

add_Action('wp_enqueue_scripts','load_stylesheets');

function load_javascript(){
    
    wp_register_script('bootstrap-js', get_template_directory_uri().'/assets/js/bootstrap.min.js', array('jquery'), null, true);
    wp_register_script('custom',get_template_directory_uri().'/app.js','jquery',1,true);
    wp_enqueue_script('custom');
    wp_enqueue_script('bootstrap-js');
}
add_Action('wp_enqueue_scripts','load_javascript');

//add_theme_support('menus');
add_theme_support('post-thumbnails');

register_nav_menus(
    array(
        'top-menu'=>'Top Menu',
    )
);
//add_image_size('post_image',1100,750,true);
function sidebar(){
    register_sidebar(
        array(
            'name'=>'Page Sidebar',
            'id'=>'page-sidebar',
            'class'=>'',
            'before_widget' => '<div class="py-3">',
            'after_widget'  => '</div>',
            'before_title'  => '<h4 class="font-italic">',
            'after_title'   => '</h4>',
    
        )
        );

}
add_action( 'widgets_init', 'sidebar' );


function mytheme_add_woocommerce_support() {
    add_theme_support( 'woocommerce' );
}

add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );


$args= array(
    'width'                  => 1946,
    'height'                 => 200,
    'flex-height'            => true,
    'flex-width'             => true,
    'default-image'=> get_template_directory_uri().'/assets/images/facial.jpg',
    'uploads'=> true

);
add_theme_support( 'custom-header', $args );    







//for upload
function wpse_theme_setup() {

    add_theme_support( 'automatic-feed-links' );
}


function wpse_add_title_support() {
    add_theme_support( 'title-tag' );
}
add_action ( 'after_setup_theme', 'wpse_add_title_support' );


function language_attributes( $doctype = 'html' ) {
    echo get_language_attributes( $doctype );
}
function wp_body_open() {
    /**
     * Triggered after the opening body tag.
     *
     * @since 5.2.0
     */
    do_action( 'wp_body_open' );
}

if(! isset($content_width)){
    $content_width = 660;
}

add_editor_style($stylesheet = 'editor-style.css' );

function new_excerpt_text(){
    return '...';
}

add_filter('excerpt_more', 'new_excerpt_text');