Skip to content

Instantly share code, notes, and snippets.

Avatar

Alex Rodriguez arod2634

View GitHub Profile
@arod2634
arod2634 / custom-wp-login.php
Created Sep 22, 2012
Customize Wordpress Admin Login
View custom-wp-login.php
<?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');
@arod2634
arod2634 / custom-wp-admin-footer.php
Created Sep 22, 2012
Customize Wordpress Admin Footer
View custom-wp-admin-footer.php
@arod2634
arod2634 / customize-wp-tinymce.php
Created Sep 22, 2012
Customize Wordpress TinyMCE Editor
View customize-wp-tinymce.php
<?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-editor.php
Created Sep 21, 2012
Customize Wordpress Editor
View custom-wp-editor.php
<?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 Sep 21, 2012
Customize Wordpress Editor
View custom-wp-editor.php
<?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-widgets.php
Created Sep 21, 2012
Customize Wordpress Theme Widgets
View custom-wp-widgets.php
<?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-menus.php
Created Sep 21, 2012
Customize Wordpress Admin Menus
View custom-wp-menus.php
<?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-menus.php
Created Sep 21, 2012
Customize Wordpress Admin Menus
View custom-wp-menus.php
<?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-dashboard.php
Created Sep 21, 2012
Customize Wordpress Admin Dashboard
View custom-wp-dashboard.php
<?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 / input-place-holder.html
Created Jun 15, 2012
Input field Place Holder
View input-place-holder.html
<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" />