diff --git a/assets/styles/core.scss b/assets/styles/core.scss index f33782d..afe5ed5 100755 --- a/assets/styles/core.scss +++ b/assets/styles/core.scss @@ -1,3 +1,10 @@ +/** +* +* Core styles should contain all the core, important styling to improve +* peformance and first impression of the site on load. +* +**/ + @import 'config/variables'; @import 'config/mixins'; diff --git a/assets/styles/styles.scss b/assets/styles/styles.scss index d4e9b40..b252699 100755 --- a/assets/styles/styles.scss +++ b/assets/styles/styles.scss @@ -1,3 +1,9 @@ +/** +* +* Styles, containing "less" important layouts, components and pages +* +**/ + @import 'config/variables'; @import 'config/mixins'; diff --git a/functions.php b/functions.php index 8ec4619..162c057 100644 --- a/functions.php +++ b/functions.php @@ -25,17 +25,14 @@ if (function_exists('add_theme_support')) { load_theme_textdomain('barebones', get_template_directory() . '/languages'); } - +/** + * Hide admin bar + */ +add_filter('show_admin_bar', '__return_false'); /** * Remove junk */ - -define('ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS', true); -define('ICL_DONT_LOAD_LANGUAGES_JS', true); - -add_filter('show_admin_bar', '__return_false'); - remove_action('wp_head', 'rsd_link'); remove_action('wp_head', 'wlwmanifest_link'); remove_action('wp_head', 'wp_generator'); @@ -46,73 +43,80 @@ remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0); remove_action('wp_head', 'print_emoji_detection_script', 7); remove_action('wp_print_styles', 'print_emoji_styles'); -function barebones_remove_comments_rss($for_comments) +/** + * Remove comments feed + * + * @return void + */ +function barebones_post_comments_feed_link() { return; } - -add_filter('post_comments_feed_link', 'barebones_remove_comments_rss'); - - +add_filter('post_comments_feed_link', 'barebones_post_comments_feed_link'); /** - * jQuery the right way + * Enqueue scripts */ - -function barebones_scripts() +function barebones_enqueue_scripts() { // wp_enqueue_style( 'fonts', '//fonts.googleapis.com/css?family=Font+Family' ); // wp_enqueue_style( 'icons', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' ); wp_enqueue_script('script', get_stylesheet_directory_uri() . '/js/script.min.js?' . filemtime(get_stylesheet_directory() . '/js/script.min.js'), [], null, true); } - -add_action('wp_enqueue_scripts', 'barebones_scripts'); - - +add_action('wp_enqueue_scripts', 'barebones_wnqueue_scripts'); /** - * Nav menus + * Register nav menus + * + * @return void */ - -if (function_exists('register_nav_menus')) { +function barebones_register_nav_menus() +{ register_nav_menus([ - 'header' => 'Header', - 'footer' => 'Footer' + 'header' => __('Header', 'barebones'), + 'footer' => __('Footer', 'barebones'), ]); } +add_action('after_setup_theme', 'barebones_register_nav_menus', 0); -function barebones_nav_menu_args($args = '') +/** + * Nav menu args + * + * @param array $args + * @return void + */ +function barebones_nav_menu_args($args) { - $args['container'] = false; + $args['container'] = false; $args['container_class'] = false; - $args['menu_id'] = false; - $args['items_wrap'] = '