/
functions.php
103 lines (85 loc) · 3.34 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
<?php
include ("metabox.php");
// resousreces support
function ppf_css(){
wp_enqueue_style('style', get_stylesheet_uri());
//scroll js
wp_enqueue_script('jquery-1.10.2', get_template_directory_uri() .'/js/jquery-1.10.2.min.js','','', false);
wp_enqueue_script('Scroll', get_template_directory_uri() .'/js/jquery.scrollTo.js','','', false);
}
add_action('wp_enqueue_scripts', 'ppf_css');
// theme setup
function ppf_setup(){
// navgation menu
register_nav_menus(
array(
'primary' => __('PPF Menu')
)
);
// add featured image support
add_theme_support('post-thumbnails');
add_image_size('who-thumbnail', 247, 247, true);
add_image_size('project-thumbnail', 350, 250, true);
// add post format support
//add_theme_support('post-formats', array('gallery','link'));
}
add_action('after_setup_theme', 'ppf_setup');
// remove the gallery
//add_filter( 'use_default_gallery_style', '__return_false' );
// remove the logo in the admin
function annointed_admin_bar_remove() {
global $wp_admin_bar;
/* Remove their stuff */
$wp_admin_bar->remove_menu('wp-logo');
}
add_action('wp_before_admin_bar_render', 'annointed_admin_bar_remove', 0);
function remove_screen_options(){ return false;}
//add_filter('screen_options_show_screen', 'remove_screen_options');
add_filter( 'contextual_help', 'wpse50723_remove_help', 999, 3 );
function wpse50723_remove_help($old_help, $screen_id, $screen){
$screen->remove_help_tabs();
return $old_help;
}
function example_remove_dashboard_widgets() {
// Globalize the metaboxes array, this holds all the widgets for wp-admin
global $wp_meta_boxes;
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
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']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
}
add_action('wp_dashboard_setup', 'example_remove_dashboard_widgets' );
function change_footer_admin () {return '';}
add_filter('admin_footer_text', 'change_footer_admin', 9999);
function change_footer_version() {return '';}
add_filter( 'update_footer', 'change_footer_version', 9999);
// change the backend logo
add_filter('login_headerurl', create_function(false,"return get_bloginfo( 'siteurl' );"));
add_filter('login_headertitle', create_function(false,"return get_bloginfo( 'description' );"));
function add_editor_buttons($buttons) {
$buttons[] = 'fontselect';
$buttons[] = 'fontsizeselect';
$buttons[] = 'cleanup';
$buttons[] = 'styleselect';
$buttons[] = 'hr';
$buttons[] = 'del';
$buttons[] = 'sub';
$buttons[] = 'sup';
$buttons[] = 'copy';
$buttons[] = 'paste';
$buttons[] = 'cut';
$buttons[] = 'undo';
$buttons[] = 'image';
$buttons[] = 'anchor';
$buttons[] = 'backcolor';
$buttons[] = 'wp_page';
$buttons[] = 'charmap';
$buttons[] = 'table';
return $buttons;
}
add_filter("mce_buttons_3", "add_editor_buttons");
?>