This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Create widget areas | |
<?php | |
// In functions.php | |
register_sidebar(array( | |
'name' => 'Sidebar', | |
'id' => 'sidebar', | |
'before_widget' => '<li>', | |
'after_widget' => '</li>', | |
'before_title' => '<h3>', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://codex.wordpress.org/Dashboard_Widgets_API | |
<?php | |
function remove_dashboard_widgets() { | |
global $wp_meta_boxes; | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); | |
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']['dashboard_right_now']); | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function remove_footer_admin () { | |
echo 'My footer text. Thank you <a href="http://wordpress.org">Wordpress</a> for giving me this filter.'; | |
} | |
add_filter('admin_footer_text', 'remove_footer_admin'); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php function your_dashboard_widget() { ?> | |
<h3>Hello Wordpress user!</h3> | |
<p>Fill this with HTML or PHP.</p> | |
<?php }; | |
function add_your_dashboard_widget() { | |
wp_add_dashboard_widget( 'your_dashboard_widget', __( 'Widget Title!' ), 'your_dashboard_widget' ); | |
} | |
add_action('wp_dashboard_setup', 'add_your_dashboard_widget' ); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Custom admin logo - 30px wide, 31px high transparent gif. Header background color: #464646 | |
add_action('admin_head', 'my_custom_logo'); | |
function my_custom_logo() { | |
echo ' | |
<style type="text/css"> | |
#header-logo { background-image: url('.get_bloginfo('template_directory').'/images/custom-logo.gif) !important; } | |
</style> | |
'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
** Add to wp-config.php file ** | |
<?php | |
# Maximum 5 revisions # | |
define('WP_POST_REVISIONS', 5); | |
# Disable revisions # | |
define('WP_POST_REVISIONS', false); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function custom_login_logo() { | |
echo '<style type="text/css"> | |
h1 a { background-image:url('.get_bloginfo('template_directory').'/images/login_logo.png) !important; } | |
</style>'; | |
} | |
add_action('login_head', 'custom_login_logo'); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Template Name: Name of your Template | |
*/ | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function new_contactmethods( $contactmethods ) { | |
$contactmethods['twitter'] = 'Twitter'; // Add Twitter | |
$contactmethods['facebook'] = 'Facebook'; // Add Facebook | |
unset($contactmethods['yim']); // Remove YIM | |
unset($contactmethods['aim']); // Remove AIM | |
unset($contactmethods['jabber']); // Remove Jabber | |
return $contactmethods; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $current_user; | |
get_currentuserinfo(); | |
$user_id = $current_user->ID; // You can set $user_id to any users, but this gets the current users ID. | |
$user_twitter = get_user_meta( $user_id, 'twitter', true); | |
echo $user_twitter; | |
?> |