This repository has been archived by the owner on May 21, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
functions.php
62 lines (54 loc) · 2.13 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
<?php
/*
* Functions file for BuddyStrap
*/
// define( 'BP_DISABLE_ADMIN_BAR', true );
require_once "adminbar.php";
function bacon($input) {
return "bacon";
}
function buddystrap_register_menus() {
register_nav_menus(
array(
'primary' => __( 'Primary Menu' ),
'adminbar_primary' => __( 'Adminbar Primary Menu' ),
'adminbar_secondary' => __( 'Adminbar Secondary Menu' )
)
);
}
add_action( 'init', 'buddystrap_register_menus' );
function buddystrap_append_javascript() { ?>
<script src="<?php echo get_stylesheet_directory_uri(); ?>/bootstrap/js/bootstrap-alerts.js"></script>
<script src="<?php echo get_stylesheet_directory_uri(); ?>/bootstrap/js/bootstrap-buttons.js"></script>
<script src="<?php echo get_stylesheet_directory_uri(); ?>/bootstrap/js/bootstrap-dropdown.js"></script>
<script src="<?php echo get_stylesheet_directory_uri(); ?>/bootstrap/js/bootstrap-modal.js"></script>
<script src="<?php echo get_stylesheet_directory_uri(); ?>/bootstrap/js/bootstrap-scrollspy.js"></script>
<script src="<?php echo get_stylesheet_directory_uri(); ?>/bootstrap/js/bootstrap-tabs.js"></script>
<script src="<?php echo get_stylesheet_directory_uri(); ?>/bootstrap/js/bootstrap-twipsy.js"></script>
<script src="<?php echo get_stylesheet_directory_uri(); ?>/bootstrap/js/bootstrap-popover.js"></script>
<?php
}
add_action( "wp_footer", "buddystrap_append_javascript" );
function buddystrap_add_html5shiv() { ?>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<?php
}
add_action("wp_head", "buddystrap_add_html5shiv");
function buddystrap_theme_filter_current_menu_item($item) {
return str_replace("current_page_item", "active", $item);
}
add_filter('wp_page_menu', 'buddystrap_theme_filter_current_menu_item');
function buddystrap_theme_main_nav( $args ) {
$pages_args = array(
'depth' => 0,
'echo' => false,
'exclude' => '',
'title_li' => ''
);
$menu = wp_page_menu( $pages_args );
$menu = str_replace( array( '<div class="menu"><ul>', '</ul></div>' ), array( '<ul class="pills pull-right">', '</ul><!-- #nav -->' ), $menu );
echo $menu;
do_action( 'bp_nav_items' );
}