-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
84 lines (66 loc) · 2.56 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
<?php
//Adds functionality to have an own logo and to have thumbnails at blog posts
if ( ! function_exists( 'themell_theme_support' ) ) {
function themell_theme_support(){
//Adds dynamic title tag and logo
add_theme_support( 'title-tag' );
$logo_width = 250;
$logo_height = 70;
add_theme_support(
'custom-logo',
array(
'height' => $logo_height,
'width' => $logo_width,
'flex-width' => true,
'flex-height' => true,
'unlink-homepage-logo' => true,
)
);
add_theme_support('post-thumbnails');
}
add_action( 'after_setup_theme', 'themell_theme_support' );
}
//Adds dynamic menu options
function themell_menus(){
$locations = array(
'primary' => "Header menu",
'footer' => "Footer Menu"
);
register_nav_menus($locations);
}
add_action('init','themell_menus');
//Inserts the stylesheets inside the header
function themell_register_styles(){
$version = wp_get_theme()->get( 'Version' );
wp_enqueue_style('themell-bootstrap', get_template_directory_uri() . "/assets/css/bootstrap.css", array(), '5.0.0', 'all');
wp_enqueue_style('themell-style', get_template_directory_uri() . "/assets/css/style.css", array('themell-bootstrap'), $version, 'all');
wp_enqueue_style('themell-w3', get_template_directory_uri() . "/assets/css/w3.css", array(), '4', 'all');
}
add_action( 'wp_enqueue_scripts', 'themell_register_styles');
//Inserts the jscript files inside the footer
function themell_register_scripts(){
$version = wp_get_theme()->get( 'Version' );
wp_enqueue_script('themell-bootstrap', get_template_directory_uri() . "/assets/js/bootstrap.min.js", array(), '5.0.0',true);
wp_enqueue_script('themell-main', get_template_directory_uri() . "/assets/js/main.js", array(), $version,true);
}
add_action( 'wp_enqueue_scripts', 'themell_register_scripts');
function themell_widget_areas(){
register_sidebar(
array(
'before_title' => '',
'after_title' => '',
'before_widget' => '',
'after_widget' => '',
'name' => 'Footer Area',
'id' => 'footer-1',
'description' => 'Here you can add some stuff that should be displayed in the footer of your website.',
)
);
}
add_action( 'widgets_init', 'themell_widget_areas');
/* Register Custom Navigation Walker*/
function register_navwalker(){
require_once get_template_directory() . '/class-wp-bootstrap-navwalker.php';
}
add_action( 'after_setup_theme', 'register_navwalker' );
?>