Skip to content

Instantly share code, notes, and snippets.

View arod2634's full-sized avatar

Alex Rodriguez arod2634

View GitHub Profile
@arod2634
arod2634 / input-place-holder.html
Created June 15, 2012 14:57
Input field Place Holder
<input onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'Email Address':this.value;" id="footerEmail" name="email" type="text" value="Email Address" />
@arod2634
arod2634 / custom-wp-dashboard.php
Created September 21, 2012 02:50
Customize Wordpress Admin Dashboard
<?php
//Add a custom admin dashboard welcome widget
function custom_dashboard_widget() {
echo '<h1>Welcome to your new WordPress site built by an awesome developer</h1>';
}
function add_custom_dashboard_widget() {
wp_add_dashboard_widget('custom_dashboard_widget', 'Integrity Welcomes You To WordPress!', 'custom_dashboard_widget');
}
add_action('wp_dashboard_setup', 'add_custom_dashboard_widget');
@arod2634
arod2634 / custom-wp-menus.php
Created September 21, 2012 03:05
Customize Wordpress Admin Menus
<?php
//Remove any unnecessary admin menus & sub-menus
function remove_menus () {
global $menu;
$restricted = array(__('Links' , 'themeName'), __('Comments' , 'themeName'));
// Additional options - > __('Dashboard'), __('Pages'), , __('Comments'), __('Media')
end ($menu);
while (prev($menu)){
$value = explode(' ',$menu[key($menu)][0]);
if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
@arod2634
arod2634 / custom-wp-menus.php
Created September 21, 2012 03:06
Customize Wordpress Admin Menus
<?php
//Remove any unnecessary admin menus & sub-menus
function my_remove_menu_pages() {
remove_menu_page('link-manager.php');
remove_menu_page('edit-comments.php');
//remove_menu_page('index.php');
//remove_menu_page('edit.php?post_type=page');
//remove_menu_page('upload.php');
//remove_menu_page('themes.php');
@arod2634
arod2634 / custom-wp-widgets.php
Created September 21, 2012 19:46
Customize Wordpress Theme Widgets
<?php
/*
* Remove any unwanted widgets...
*
* WP_Widget_Pages = Pages Widget
* WP_Widget_Calendar = Calendar Widget
* WP_Widget_Archives = Archives Widget
* WP_Widget_Links = Links Widget
* WP_Widget_Meta = Meta Widget
* WP_Widget_Search = Search Widget
@arod2634
arod2634 / custom-wp-editor.php
Created September 21, 2012 20:43
Customize Wordpress Editor
<?php
// Remove Meta-Boxes from Posts & Pages Editor Screens
function remove_extra_meta_boxes() {
remove_meta_box( 'postcustom' , 'post' , 'normal' ); // custom fields for posts
remove_meta_box( 'postcustom' , 'page' , 'normal' ); // custom fields for pages
remove_meta_box( 'postexcerpt' , 'post' , 'normal' ); // post excerpts
remove_meta_box( 'postexcerpt' , 'page' , 'normal' ); // page excerpts
remove_meta_box( 'commentsdiv' , 'post' , 'normal' ); // recent comments for posts
remove_meta_box( 'commentsdiv' , 'page' , 'normal' ); // recent comments for pages
remove_meta_box( 'tagsdiv-post_tag' , 'post' , 'side' ); // post tags
@arod2634
arod2634 / custom-wp-editor.php
Created September 21, 2012 20:43
Customize Wordpress Editor
<?php
// Remove Meta-Boxes from Posts & Pages Editor Screens
function remove_extra_meta_boxes() {
remove_meta_box( 'postcustom' , 'post' , 'normal' ); // custom fields for posts
remove_meta_box( 'postcustom' , 'page' , 'normal' ); // custom fields for pages
remove_meta_box( 'postexcerpt' , 'post' , 'normal' ); // post excerpts
remove_meta_box( 'postexcerpt' , 'page' , 'normal' ); // page excerpts
remove_meta_box( 'commentsdiv' , 'post' , 'normal' ); // recent comments for posts
remove_meta_box( 'commentsdiv' , 'page' , 'normal' ); // recent comments for pages
remove_meta_box( 'tagsdiv-post_tag' , 'post' , 'side' ); // post tags
@arod2634
arod2634 / customize-wp-tinymce.php
Created September 22, 2012 02:54
Customize Wordpress TinyMCE Editor
<?php
// Make TinyMCE editor awesome!
function make_mce_awesome( $init ) {
$init['theme_advanced_blockformats'] = 'h2,h3,h4,p';
$init['theme_advanced_buttons1_add'] = 'copy, cut, paste, redo, undo';
$init['theme_advanced_buttons2_add'] = 'anchor, hr, sub, sup';
$init['theme_advanced_disable'] = 'wp_help';
return $init;
}
@arod2634
arod2634 / custom-wp-admin-footer.php
Created September 22, 2012 03:27
Customize Wordpress Admin Footer
@arod2634
arod2634 / custom-wp-login.php
Created September 22, 2012 03:36
Customize Wordpress Admin Login
<?php
// Custom login styles
function custom_login_styles() {
echo '<style type="text/css">
.login h1 a { background-image:url('.get_template_directory_uri().'/images/logo.png) !important; text-align: center !important; width: 350px !important; background-size: 234px; 82px !important;}
body {background-color: #F6F6F6!important;}
div.updated, .login .message {color: #fff !important; border-color: #950639 !important; background-color: #CF153D !important;}
</style>';
}
add_action('login_head', 'custom_login_styles');