-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
97 lines (84 loc) · 2.41 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
<?php
/* sidebars */
register_sidebar( array(
'name' => __( 'sidebar' ),
'id' => 'sidebar-1',
'before_widget' => '',
'after_widget' => '',
) );
register_sidebar( array(
'name' => __( 'footer1' ),
'id' => 'sidebar-2',
'before_widget' => '',
'after_widget' => '',
) );
register_sidebar( array(
'name' => __( 'footer2' ),
'id' => 'sidebar-3',
'before_widget' => '',
'after_widget' => '',
) );
register_sidebar( array(
'name' => __( 'feat1-img' ),
'id' => 'sidebar-4',
'before_widget' => '',
'after_widget' => '',
) );
register_sidebar( array(
'name' => __( 'feat2-img' ),
'id' => 'sidebar-5',
'before_widget' => '',
'after_widget' => '',
) );
register_sidebar( array(
'name' => __( 'feat3-img' ),
'id' => 'sidebar-6',
'before_widget' => '',
'after_widget' => '',
) );
register_sidebar( array(
'name' => __( 'testimonials' ),
'id' => 'sidebar-12',
'before_widget' => '<div class="testimonial">',
'after_widget' => '</div>',
) );
/* menus */
function register_my_menus() {
register_nav_menus(
array(
'top-menu' => __( 'Top Menu' )
)
);
}
add_action( 'init', 'register_my_menus' );
// Register custom navigation walker for bootstrap dropdown menu
require_once('wp_bootstrap_navwalker.php');
/* call google jquery */
function my_scripts_method() {
wp_enqueue_script( 'jquery' );
}
add_action('wp_enqueue_scripts', 'my_scripts_method');
/* admin login logo */
function login_logo() {
echo '<style type="text/css">
h1 a {background:url("http://www.root.lamtha2.co.uk/logos/lamtha2_logo.gif") !important; background-repeat:no-repeat !important; margin-left:50px !important; width:230px !important;}
</style>';}
add_action('login_head', 'login_logo');
// allow editor to access appearance menu - themes, widgets and menus
// get the the role object
$role_object = get_role( 'editor' );
// add $cap capability to this role object
$role_object->add_cap( 'edit_theme_options' );
// hide wp version from page source
remove_action('wp_head', 'wp_generator');
//remove query string from resources (e.g. plugings links to jquery cdn) to enable browser cacheing
function _remove_script_version( $src ){
$parts = explode( '?ver', $src );
return $parts[0];
}
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 );
add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
/* limit revisions */
define('AUTOSAVE_INTERVAL', 300); // seconds
define('WP_POST_REVISIONS', 5);
?>