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
| /* HIDE NAVIGATION AREAS IN ADMIN */
function remove_menus () {
global $menu;
// check if admin and hide these for admins
if( (current_user_can('install_themes')) ) {
// $restricted = array(__('Dashboard'), __('Posts'), __('Media'), __('Links'), __('Pages'), __('Appearance'), __('Tools'), __('Users'), __('Settings'), __('Comments'), __('Plugins'));
//$restricted = array(__('Dashboard'), __('Media'), __('Links'), __('Tools'), __('Users'), __('Settings'), __('Gallery'), __('Comments'), __('Plugins'));
} else { // hide these for other roles
//$restricted = array(__('Dashboard'), __('Posts'), __('Media'), __('Links'), __('Pages'), __('Appearance'), __('Tools'), __('Users'), __('Settings'), __('Comments'), __('Plugins'));
$restricted = array(__('Dashboard')/*, __('Media')*/, __('Links'), __('Tools'), __('Users'), __('Settings'), __('Gallery'), __('Comments'), __('Plugins'));
}
end ($menu);
while (prev($menu)){
$value = explode(' ',$menu[key($menu)][0]);
if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
}
}
add_action('admin_menu', 'remove_menus');
function customAdmin() {
if( (current_user_can('install_themes')) ) {
$url = get_settings('siteurl');
$url = $url . '/wp-content/themes/soccer/css/wp-admin.css';
echo '<!-- custom admin css -->
<link rel="stylesheet" type="text/css" href="' . $url . '" />
<!-- /end custom adming css -->';
} else { // hide these for other roles
$url = get_settings('siteurl');
$url = $url . '/wp-content/themes/soccer/css/wp-admin.css';
echo '<!-- custom admin css -->
<link rel="stylesheet" type="text/css" href="' . $url . '" />
<!-- /end custom adming css -->';
}
}
add_action('admin_head', 'customAdmin');
/* end: HIDE NAVIGATION AREAS IN ADMIN */
/* ADD CUSTOMIZED LOGIN STYLES */
function my_login_stylesheet() {
$url = get_settings('siteurl');
$url = $url . '/wp-content/themes/soccer/css/wp-admin-login.css';
echo '<!-- custom admin css -->
<link rel="stylesheet" type="text/css" href="' . $url . '" />
<!-- /end custom adming css -->';
}
add_action( 'login_enqueue_scripts', 'my_login_stylesheet' );
/* end: ADD CUSTOMIZED LOGIN STYLES */
/* CUSTOMIZE DASHBOARD */
/*Custom Dashboard Widget*/
add_action('wp_dashboard_setup', 'add_instructions');
function add_instructions() {
global $wp_meta_boxes;
/*First, remove all stock, out of the box widgets*/
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']['wt_dashboard_statistics']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_custom_feed']);
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']);
/*Now proceed to add our new widget*/
wp_add_dashboard_widget('dashboard_instructions', 'Welcome to Active Youth Network', 'dashboard_instructions_widget');
}
function dashboard_instructions_widget() {
/*Add Our Custom Widget Code*/
?>
<!--Put any html you want in here, you should use wordpress functions to get the url to your theme in order to include any images.-->
<div id="ayn_dashboard">
<h1><?php bloginfo('name'); ?></h1>
<img src="<?php echo get_bloginfo('template_directory'); ?>/img/AYN-logo.png" style="float: left; margin: 0 20px 45px 0;" />
<h4 style="padding-top: 45px;">Keeping kids active in youth sports</h4>
<p>The Active Youth Network, LLC (AYN) is a Colorado based, national online ad network of youth sports websites that AYN markets t major brand, family-friendly advertisers who want to reach this premium audience. AYN is a cause related company that gives 70% of sales revenues generated back to its member clubs, schools and associations. AYN's mission is to help offset the escalating costs of participation to reduce the burden to families and keep kids active in youth sports. For more information go to <a href="http://www.activeyouthnetwork.com" target="_blank">www.activeyouthnetwork.com</a></p>
<br clear="both" />
</div>
<!--End Html-->
<?php
}
// CUSTOM ADMIN DASHBOARD HEADER LOGO
function custom_admin_logo(){
echo '<style type="text/css">#icon-index { background: url('.get_bloginfo('template_directory').'/images/AYN-logo-sm.png) no-repeat top left !important; }</style>';
}
add_action('admin_head', 'custom_admin_logo');
/* END: CUSTOMIZE DASHBOARD */ |
Recent Comments