-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.php
executable file
·171 lines (121 loc) · 5.05 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?php
/**
* SIC Theme Framework
* This functions file is the gateway to the SIC Theme Framework, here is where you're going to decide what features of the framework you'll be usin
* this is also the place to create the theme options, widget areas, navigation menus, and enable/ disbale some of the default WordPress functions that
* are available to themes
*
* @author Michael Chacon
* @version 3.0
* @copyright April 16, 2012
* @package default
**/
include 'framework/framework-init.php';
include 'interface/interface-init.php';
remove_filter( 'the_content', 'wpautop' );
add_action('header_inner','header_contact');
add_action( 'content_block_outer' , 'top_slider');
add_action('body_open','responsive_nav');
add_action('sic_footer','sic_footer');
//add_action('wp_footer', 'ajax_footer');
function top_slider(){
$slides = rwmb_meta( 'sic_plimages',
array(
'type' => 'plupload_image',
'size' => 'full'));
if($slides){
foreach($slides as $slide){
$content[] = '<div><img src="' . $slide[url] . '"/></div>';
}
$atts = array(
'id' => 'page_slider',
'animation' => 'slide',
'controlNav' => TRUE,
);
if($content){$slider = new Slider($content, $atts);
echo $slider->output();}
// $content2 = 'http://www.youtube.com/watch?v=FtJcSqlHcP4';
// $player = new SicVideo('', $content2);
// echo $player->output();
}
}
function responsive_nav(){
echo '<section class="off-canvas">';
wp_nav_menu( array( 'container' => 'nav', 'container_class' => 'full_vertical', 'menu_id' => 'primary_nav', 'enable_bp_links' => true, 'show_home' => true ) );
echo '</section>
<div id="responsive-nav-overlay"></div>
<div id="responsive-nav">
<div class="responsive-button responsive-nav" style="float:left;">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</div>
<ul class="social_links cf">
<li><a href="http://facebook.com/yogawithapril" target="_blank" class=" facebook"></a></li>
<li><a href="http://facebook.com/yogawithapril" target="_blank" class=" pinterest"></a></li>
<li><a href="http://facebook.com/yogawithapril" target="_blank" class=" instagram"></a></li>
<li><a href="http://facebook.com/yogawithapril" target="_blank" class=" vimeo"></a></li>
<li><a href="http://twitter.com/aprilmartucci" target="_blank" class=" twitter"></a></li>
<li><a href="http://youtube.com/aprilmartucci" target="_blank" class=" youtube"></a></li>
</ul>
</div>';
}
function ajax_footer(){
$dir = get_bloginfo('stylesheet_directory');
$query = <<<EOD
<script>
jQuery(document).ready(function(\$){
siteurl = 'http://' + top.location.host.toString();
jQuery(document).delegate("a[href^='"+ siteurl +"']:not([href*='/wp-admin/']):not([href*='/wp-login.php']):not([hrefjQuery='/feed/'])", "click", function(e) {
var uri = this.pathname + this.search + this.hash;
jQuery('#content_block').load(this.href+" #content_block",null,
function (responseText, textStatus, XMLHttpRequest) {
if (textStatus == "success") {
jQuery('#content_block').replaceWith(\$(this).find("#content_block"));}// if
//jQuery('ajax_footer').replaceWith(\$(this).find("head"));// if
});//function
history.pushState(null, null, uri );
return e.preventDefault();
});//delegate
}); //document.ready
</script>
EOD;
echo $query;
}
function header_contact(){
echo '
<div class="branding one_half">'. sic_logo() .'</div><!--branding-->
<div class="social contact_info one_half cf last">
<div class="phone">305-741-4742</div>
<div class="address">6948 Collins ave #207</div>
</div>
';
}
function remove_dashboard_widgets() {
// Globalize the metaboxes array, this holds all the widgets for wp-admin
global $wp_meta_boxes;
//remove all default dashboard apps
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
}
// Hoook into the 'wp_dashboard_setup' action to register our function
add_action('wp_dashboard_setup', 'remove_dashboard_widgets');
$i = 1;
while ( $i <= $sic_theme->settings['footer']['layout']) {
register_sidebar( array(
'name' => 'Footer Area ' . $i,
'id' => 'footer-' . $i,
'description' => '',
'before_widget' => '<div class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>'
));
$i++;
}