-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
72 lines (47 loc) · 1.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
<?php
/**
*
* Template name: functios.php
* Add theme features
*
*/
// add customizer.php file
require_once('templates/helpers/customizer.php');
// link theme styles
function fn_theme_scripts(){
//link style files
wp_enqueue_style('fontawsome', get_template_directory_uri(). '/vendor/css/all.min.css');
wp_enqueue_style('style', get_stylesheet_uri());
wp_enqueue_style('media_responsive', get_template_directory_uri(). '/assets/css/media.css');
//link scripts files
wp_enqueue_script('jquery-file', get_template_directory_uri().'/vendor/js/jquery.js');
wp_enqueue_script('main-js', get_template_directory_uri().'/assets/js/main.js');
}
add_action('wp_enqueue_scripts','fn_theme_scripts');
// include theme supports
function fn_theme_support(){
add_theme_support('title-tag');
add_theme_support( 'post-thumbnails' );
add_theme_support('html5', array('search-form'));
add_theme_support('custom-logo');
}
add_action('after_setup_theme','fn_theme_support');
// Registering nav manu
function fn_nav_menus(){
register_nav_menus(array(
'primary-menu' => __('Primary Menu', 'text_domain'),
'footer-menu' => __('Footer Menu', 'text_domain'),
));
}
add_action('init', 'fn_nav_menus');
function add_link_atts($atts){
$atts['class'] = 'link text-light';
return $atts;
}
add_filter('nav_menu_link_attributes','add_link_atts');
//trim excerpt to a short lenght
function fn_custom_excerpt_lenght($lenght){
return 15;
}
add_filter('excerpt_lenght', 'fn_custom_excerpt_lenght');
?>