-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
121 lines (106 loc) · 3.15 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
121
<?php
/**
* Configuracion de Menu
**/
function Orozco_wp_nav_menu_args( $args = '' ) {
$args = array(
'theme_location' => 'header-menu',
'menu' => '',
'container' => 'div',
'container_class' => 'collapse navbar-collapse',
'container_id' => 'bs-example-navbar-collapse-2',
'menu_class' => 'nav navbar-nav',
'menu_id' => '',
'echo' => false,
'fallback_cb' => '',
'before' => '',
'after' => '',
'link_before' => '',
'link_after' => '',
'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s </ul>',
'depth' => 0,
'walker' => ''
);
return $args;
}
add_filter( 'wp_nav_menu_args', 'Orozco_wp_nav_menu_args' );
/******************************************************************************/
/**
* Nombre de los menu
**/
function register_my_menus() {
register_nav_menus(
array(
'header-menu' => __( 'Header Menu' ),
'extra-menu' => __( 'Footer Menu' )
)
);
}
add_action( 'init', 'register_my_menus' );
/******************************************************************************/
/**
* Proper way to enqueue scripts and styles
*/
function wpb_mce_buttons_2($buttons) {
array_unshift($buttons, 'styleselect');
return $buttons;
}
add_filter('mce_buttons_2', 'wpb_mce_buttons_2');
/*
* Callback function to filter the MCE settings
*/
function my_mce_before_init_insert_formats( $init_array ) {
// Define the style_formats array
$style_formats = array(
// Each array child is a format with it's own settings
array(
'title' => 'Content Block',
'block' => 'span',
'classes' => 'content-block',
'wrapper' => true,
),
array(
'title' => 'Blue Button',
'block' => 'span',
'classes' => 'blue-button',
'wrapper' => true,
),
array(
'title' => 'Red Button',
'block' => 'span',
'classes' => 'red-button',
'wrapper' => true,
),
);
// Insert the array, JSON ENCODED, into 'style_formats'
$init_array['style_formats'] = json_encode( $style_formats );
return $init_array;
}
// Attach callback to 'tiny_mce_before_init'
add_filter( 'tiny_mce_before_init', 'my_mce_before_init_insert_formats' );
function my_theme_add_editor_styles() {
add_editor_style(get_bloginfo("stylesheet_directory").'/public/css/ccsadd.css' );
}
add_action( 'init', 'my_theme_add_editor_styles' );
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name'=>'sidebar',
'before_widget' => '<div id="%1$s" class="side %2$s">', // Removes <li>
'after_widget' => '</div>', // Removes </li>
));
if ( has_nav_menu('extra-menu') ) {
wp_nav_menu(
array(
'theme_location' => 'extra-menu',
'container' => 'div',
'container_id' => 'menu-social',
'container_class' => 'menu',
'menu_id' => 'menu-social-items',
'menu_class' => 'menu-items',
'depth' => 1,
'link_before' => '<span class="screen-reader-text">',
'link_after' => '</span>',
'fallback_cb' => '',
)
);
}