function remove_menus() { global $menu; global $current_user; get_currentuserinfo(); if($current_user->user_login == ‘username’) { $restricted = array(__(‘Posts’), __(‘Media’), __(‘Links’), __(‘Pages’), __(‘Comments’), __(‘Appearance’), __(‘Plugins’), __(‘Users’), __(‘Tools’), __(‘Settings’) ); end ($menu); while (prev($menu)){ $value = explode(‘ ‘,$menu[key($menu)][0]); if(in_array($value[0] != NULL?$value[0]:”” , $restricted)){unset($menu[key($menu)]);} }// end while }// end if } add_action(‘admin_menu’, ‘remove_menus’); //alternatively you can use if($current_user->user_login != ‘admin’) instead, […]
Articles Tagged: Look & Feel
Style the tag cloud
//tag cloud custom add_filter(‘widget_tag_cloud_args’,’style_tags’); function style_tags($args) { $args = array( ‘largest’ => ’10’, ‘smallest’ => ’10’, ‘format’ => ‘list’, ); return $args; }
Remove “Read More” page jumps**
Instead return to the top of the page. You know how when you click “read more” it will jump to the spot in the page which can be annoying, this makes it just load the page normally, no jumping! function remove_more_jump_link($link) { $offset = strpos($link, ‘#more-‘); if ($offset) { $end = strpos($link, ‘”‘,$offset); } if […]
Function to change the length of Excerpt
Tested on: WordPress 3.0.1 By default all excerpts are capped at 55 words. Utilizing the code below you can override this default settings: function new_excerpt_length($length) { return 100; } add_filter(‘excerpt_length’, ‘new_excerpt_length’); This example changes the excerpt length to 100 words, but you can use the same method to change it to any value.