$title) { if ($key=='title') // Put the Thumbnail column before the Author column $new['post_thumb'] = 'Featured Image'; $new[$key] = $title; } return $new; } // Hook into the posts an pages column managing. Sharing function callback again. add_action('manage_posts_custom_column', 'display_post_thumbnail_column', 1, 2); add_action('manage_pages_custom_column', 'display_post_thumbnail_column', 1, 2); // Grab featured-thumbnail size post thumbnail and display it. function display_post_thumbnail_column($col, $id){ switch($col){ case 'post_thumb': if( function_exists('the_post_thumbnail') ) echo the_post_thumbnail( 'post-thumb' ); else echo 'Not supported in theme'; break; } } add_action( 'admin_footer', 'add_logout' ); function add_logout(){ echo 'Log Out'; } function remove_dashboard_meta() { remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' ); remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' ); remove_meta_box( 'dashboard_primary', 'dashboard', 'normal' ); remove_meta_box( 'dashboard_secondary', 'dashboard', 'normal' ); remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' ); remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' ); remove_meta_box( 'dashboard_recent_comments', 'dashboard', 'normal' ); remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' ); remove_meta_box( 'dashboard_activity', 'dashboard', 'normal');//since 3.8 } add_action( 'admin_init', 'remove_dashboard_meta' ); /** * Add a widget to the dashboard. * * This function is hooked into the 'wp_dashboard_setup' action below. */ function add_dashboard_widgets() { wp_add_dashboard_widget( 'dashboard_widget', 'Quick Links', 'dashboard_widget_function' ); // Globalize the metaboxes array, this holds all the widgets for wp-admin global $wp_meta_boxes; // Get the regular dashboard widgets array // (which has our new widget already but at the end) $normal_dashboard = $wp_meta_boxes['dashboard']['normal']['core']; // Backup and delete our new dashboard widget from the end of the array $widget_backup = array( 'dashboard_widget' => $normal_dashboard['dashboard_widget'] ); unset( $normal_dashboard['dashboard_widget'] ); // Merge the two arrays together so our widget is at the beginning $sorted_dashboard = array_merge( $widget_backup, $normal_dashboard ); // Save the sorted array back into the original metaboxes $wp_meta_boxes['dashboard']['normal']['core'] = $sorted_dashboard; } add_action( 'wp_dashboard_setup', 'add_dashboard_widgets' ); /** * Create the function to output the contents of our Dashboard Widget. */ function dashboard_widget_function() { echo ''; } // Disable Admin Bar for everyone if (!function_exists('df_disable_admin_bar')) { function df_disable_admin_bar() { // for the admin page remove_action('admin_footer', 'wp_admin_bar_render', 1000); // for the front-end remove_action('wp_footer', 'wp_admin_bar_render', 1000); // css override for the admin page function remove_admin_bar_style_backend() { echo ''; } add_filter('admin_head','remove_admin_bar_style_backend'); // css override for the frontend function remove_admin_bar_style_frontend() { echo ''; } add_filter('wp_head','remove_admin_bar_style_frontend', 99); } } add_action('init','df_disable_admin_bar'); ?>