/
functions.php
93 lines (91 loc) · 3.35 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
/**
* @Project: josesayago
* @Author: Jose SAYAGO
* @Email: hello@josesayago.com
* @URL: http://josesayago.com
* @Date: 2016-01-23 11:45:24
* @Last Modified by: Jose SAYAGO
* @Last Modified time: 2016-01-26 10:00:30
* @File: functions.php
* @License: GLP v2
*/
if (!function_exists('jls_setup')) {
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function jls_setup() {
/*
* Make theme available for translation.
* Translations can be filed in the /languages/ directory.
* If you're building a theme based on jls, use a find and replace
* to change 'jls' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'jls', get_template_directory() . '/assets/languages' );
// Add default posts and comments RSS feed links to head.
add_theme_support( 'automatic-feed-links' );
/*
* Let WordPress manage the document title.
* By adding theme support, we declare that this theme does not use a
* hard-coded <title> tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => esc_html__('Primary Menu', 'jls'),
'top_menu' => esc_html__('Top Menu', 'jls')
) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
) );
/*
* Enable support for Post Formats.
* See https://developer.wordpress.org/themes/functionality/post-formats/
*/
add_theme_support( 'post-formats', array(
'aside',
'image',
'video',
'quote',
'link',
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'jls_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
// Sidebars
register_sidebars(2, array('name'=>'Sidebar %d'));
}
}
add_action( 'after_setup_theme', 'jls_setup' );
function jls_scripts()
{
wp_enqueue_style('bootstrap', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css');
wp_enqueue_style('frontend', get_template_directory_uri().'/assets/css/frontend.css');
wp_enqueue_style('frontend-map', get_template_directory_uri().'/assets/css/frontend.css.map');
wp_enqueue_script('typed', get_template_directory_uri().'/assets/js/typed.min.js', array('jquery'), '1.0.0', true);
wp_enqueue_script('typed-statement', get_template_directory_uri().'/assets/js/typed-statement.js', array('typed'), '1.0.0', true);
wp_enqueue_script('bootstrap-js', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js', array(), '3.3.6', true);
wp_enqueue_script('search', get_template_directory_uri().'/assets/js/search.js', array('jquery'), '1.0.0', true );
}
add_action('wp_enqueue_scripts', 'jls_scripts');