-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
121 lines (81 loc) · 3.04 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
// Require the admin dasboard functions and the custom enqueue file
require get_template_directory() . '/inc/admin/admin-function.php';
require get_template_directory() .'/inc/enqueue.php';
require get_template_directory() .'/inc/customizer/customizer.php';
function hobi_global_script_enqueue()
{
wp_enqueue_style( 'Hobi', get_stylesheet_uri(), array() );
wp_register_style('font-awesome' ,get_template_directory_uri() . '/assets/font-awesome/css/font-awesome.min.css', array(), 'all' );
wp_enqueue_style( 'font-awesome');
wp_register_style('hobi_css', get_template_directory_uri() . '/css/HOBI.css', array(), '1.0.0', 'all' );
wp_enqueue_style('hobi_css');
$custom_css = HOBI_get_customizer_css();
wp_add_inline_style( 'hobi_css', $custom_css );
wp_enqueue_script( 'HOBI_navigation', get_template_directory_uri().'/assets/js/navigation.js', array(), true );
}
// Include scripts
add_action('wp_enqueue_scripts', 'hobi_global_script_enqueue');
/*
==================================================
fnctions to add all needed supprt to our theme
===================================================
*/
function HOBI_theme_support()
{
// logo theme support
add_theme_support('custom-logo' , array(
'width' => 200,
'flex-height' => true,
'flex-width' => true,
) );
//menu
register_nav_menus( array(
'main_menu' => __( 'Primary', 'Main menu' ),
));
// 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.
/*
* 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',
'style',
'script',
)
);
// Set up the WordPress core custom background feature.
// Add theme support for selective refresh for widgets.
add_theme_support( 'customize-selective-refresh-widgets' );
// functions to add arrows in front of menu with submenu
function be_arrows_in_menus( $item_output, $item, $depth, $args ) {
if( in_array( 'menu-item-has-children', $item->classes ) ) {
$arrow = 0 == $depth ? '<i class="fa fa-caret-down"></i>' : '<i class="fa fa-caret-right"></i>';
$item_output = str_replace( '</a>', $arrow . '</a>', $item_output );
}
return $item_output;
}
add_filter( 'walker_nav_menu_start_el', 'be_arrows_in_menus', 10, 4 );
}
add_action('after_setup_theme', 'HOBI_theme_support');