-
Notifications
You must be signed in to change notification settings - Fork 0
/
pootlepress-center-menu-n-logo-functions.php
122 lines (94 loc) · 3.38 KB
/
pootlepress-center-menu-n-logo-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
<?php
$health = 'ok';
if (!function_exists('check_main_heading')) {
function check_main_heading() {
global $health;
if (!function_exists('woo_options_add') ) {
function woo_options_add($options) {
$cx_heading = array( 'name' => __('Canvas Extensions', 'pootlepress-canvas-extensions' ),
'icon' => 'favorite', 'type' => 'heading' );
if (!in_array($cx_heading, $options))
$options[] = $cx_heading;
return $options;
}
} else { // another ( unknown ) child-theme or plugin has defined woo_options_add
$health = 'ng';
}
}
}
add_action( 'admin_init', 'poo_commit_suicide' );
if(!function_exists('poo_commit_suicide')) {
function poo_commit_suicide() {
global $health;
$pluginFile = str_replace('-functions', '', __FILE__);
$plugin = plugin_basename($pluginFile);
$plugin_data = get_plugin_data( $pluginFile, false );
if ( $health == 'ng' && is_plugin_active($plugin) ) {
deactivate_plugins( $plugin );
wp_die( "ERROR: <strong>woo_options_add</strong> function already defined by another plugin. " .
$plugin_data['Name']. " is unable to continue and has been deactivated. " .
"<br /><br />Please contact PootlePress at <a href=\"mailto:support@pootlepress.com?subject=Woo_Options_Add Conflict\"> support@pootlepress.com</a> for additional information / assistance." .
"<br /><br />Back to the WordPress <a href='".get_admin_url(null, 'plugins.php')."'>Plugins page</a>." );
}
}
}
/* Centre logo */
// http://www.dalesue.com/how-to-centrify-the-logo-in-canvas
function center_logo_css() { ?>
<style>
#logo { width:100%; text-align: center; }
</style>
<?php
}
/* Remove Search widget from navigation menu */
function hide_search_widget_css() { ?>
<style>
/*Not mobile*/
@media only screen and (min-width: 768px) {
ul.nav-search { display:none; }
}
</style>
<?php
}
/* Centre primary navigation menu */
function center_nav_css() { ?>
<style>
/*Not mobile*/
@media only screen and (min-width: 768px) {
#navigation { position: relative; }
#main-nav { position: relative; left: 0; text-align: center; width: 100%; }
#main-nav.nav li { display: inline-block; float: none; list-style: none; margin: 0; padding: 0;
position: relative; vertical-align: middle; }
#main-nav.nav li ul li { left: 0; }
#navigation .side-nav .cart .cart-contents { width: auto; text-indent: 0; }
}
</style>
<?php
}
/* Centre top menu */
function center_topmenu_css() { ?>
<style>
/*Not mobile*/
@media only screen and (min-width: 768px) {
#top-nav { position: relative; text-align: center; left: 0; width: 100%; }
#top-nav.nav li { display: inline-block; float: none; list-style: none; margin: 0; padding: 0;
position: relative; vertical-align: middle; }
#top-nav.nav li ul li { left: 0; }
}
</style>
<?php
}
/*
<script type="text/javascript">
jQuery(function ($) {
$(document).ready(function() {
var navhiddenHeight = '<? echo $navhiddenHeight; ?>';
var navhiddenMargin = '<? echo $navhiddenMargin; ?>';
var navid = '<? echo $_navid; ?>';
var stickNavOffset = $(navid).offset().top;
var contentWidth;
});
});
</script>
*/
?>