<?php

// Load Stylesheets
function load_css(){
    wp_register_style('fontawesome', 'https://use.fontawesome.com/releases/v5.11.2/css/all.css', array(), false, 'all');
    wp_enqueue_style('fontawesome');

    wp_register_style('bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', array(), false, 'all');
    wp_enqueue_style('bootstrap');

    wp_register_style('sidenav', get_template_directory_uri() . '/css/sidebarNavigation.css', array(), false, 'all');
    wp_enqueue_style('sidenav');

    wp_register_style('main', get_template_directory_uri() . '/css/main.css', array(), false, 'all');
    wp_enqueue_style('main');

    wp_register_style('carousel-min', get_template_directory_uri() . '/css/carousel-min.css', array(), false, 'all');
    wp_enqueue_style('carousel-min');
}
add_action('wp_enqueue_scripts','load_css');

// Load Javascript
function load_js(){


    wp_register_script('jquerymin', get_template_directory_uri() . '/js/jquery.min.js', 'jquery', false, true);
    wp_enqueue_script('jquerymin');

    wp_register_script('bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', 'jquery', false, true);
    wp_enqueue_script('bootstrap');

    wp_register_script('sidenav', get_template_directory_uri() . '/js/sidebarNavigation.js', 'jquery', false, true);
    wp_enqueue_script('sidenav');

    wp_register_script('jsCarousel', get_template_directory_uri() . '/js/carousel-min.js', 'jquery', false, true);
    wp_enqueue_script('jsCarousel');

    wp_register_script('Carousel', get_template_directory_uri() . '/js/carousel.js', 'jquery', false, true);
    wp_enqueue_script('Carousel');

   // wp_register_script('skrollr', get_template_directory_uri() . '/js/skrollr.js', 'jquery', false, true);
   // wp_enqueue_script('skrollr');

}
add_action('wp_enqueue_scripts','load_js');

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

// Menu
register_nav_menus(
    array(
        'top-menu' => 'Top Menu Location',
        'mobile-menu' => 'Mobile Menu Location',
    )
);

//Register Custom Navigation Walker
function register_navwalker(){
    require_once get_template_directory() . '/class-wp-bootstrap-navwalker.php';
}
add_action('after_setup_theme', 'register_navwalker');

//Logo
function themename_custom_logo_setup() {
    $defaults = array(
    'height'      => 66,
    'width'       => 239,
    'flex-height' => false,
    'flex-width'  => false,
    'header-text' => array( 'site-title', 'site-description' ),
    'unlink-homepage-logo' => true, 
    );
    add_theme_support( 'custom-logo', $defaults );
}
add_action( 'after_setup_theme', 'themename_custom_logo_setup' );

/* Disable WordPress Admin Bar for all users */
add_filter( 'show_admin_bar', '__return_false' );

add_filter('acf/settings/show_admin', '__return_false');

function remove_quick_edit( $actions ) {
    unset($actions['inline hide-if-no-js']);
    return $actions;
}
if ( ! current_user_can('manage_options') ) {
    add_filter('post_row_actions','remove_quick_edit',10,1);
}