Separating a custom taxonomy from blog post-type
No. As far as the admin menu is concerned the taxonomies are always “below” the content they apply to. You will always need to directly manipulate the menu structure to change this.
No. As far as the admin menu is concerned the taxonomies are always “below” the content they apply to. You will always need to directly manipulate the menu structure to change this.
Add this to your functions.php // Allow editors to see Appearance menu $role_object = get_role( ‘editor’ ); $role_object->add_cap( ‘edit_theme_options’ ); function hide_menu() { // Hide theme selection page remove_submenu_page( ‘themes.php’, ‘themes.php’ ); // Hide widgets page remove_submenu_page( ‘themes.php’, ‘widgets.php’ ); // Hide customize page global $submenu; unset($submenu[‘themes.php’][6]); } add_action(‘admin_head’, ‘hide_menu’); … Read more
In your construct function you also need to enqueue a custom stylesheet that will house the CSS to style up your theme options. A simplified example would look like this: function admin_style() { wp_enqueue_style( ‘theme-options-style’, get_template_directory_uri().’styles/theme-options-style.css’); } add_action(‘admin_enqueue_scripts’, ‘admin_style’);
WordPress has some functions to help work with lists of objects. These are especially helpful when working with the nav menu objects or the query object. wp_filter_object_list() takes an array of objects and filters them by a given set of criteria. You get a result that only contains objects that match your criteria. Once you … Read more
I could be wrong but I don’t think there’s an easy way to modify these fields generally, you’d probably need to use a bit of JavaScript in the admin to manipulate the field when the page loads to change it from an input to textarea. I’ve not tested this, but something like this in jQuery … Read more
Must be a problem with the surrounding code, your add_menu_page code works fine inside my test code, i can see the item as an admin or editor. add_action( ‘admin_menu’ , ‘admin_menu_new_items’ ); function admin_menu_new_items() { add_menu_page(‘Calendar’, ‘Calendar’, ‘edit_posts’, ‘wp-eventcal/eventcal-manager.php’); } Works just fine for me.. Are you using any plugins for managing the admin menu, … Read more
I have found the issue. I was making changes to the plug-in code and transferring it directly (via ftp). I forgot to deactivate and activate the plug-in. Doh!
I figured out the problem: You must specify an ID in the add_menu array if the title is not alphanumeric. So, this code worked: function my_admin_bar_menu() { global $wp_admin_bar; if ( !is_super_admin() || !is_admin_bar_showing() ) return; $wp_admin_bar->add_menu( array( ‘title’ => __( ‘#’), ‘id’ => __( ‘my_menu_item’), ‘href’ => admin_url(‘myurl.php’))); } add_action(‘admin_bar_menu’, ‘my_admin_bar_menu’); The only change … Read more
Answering my own question as noted in the edit: This actually seems to do the trick, not sure if it’s the best way though: add_menu_page(‘Oranges’, ‘Oranges’, ‘edit_posts’, ‘edit.php?post_type=fruits&subtype=oranges’, ”);
Yep, believe so. Try this (enqueue in admin styles): Show sub-menus at all times #adminmenu .wp-submenu, .folded #adminmenu .wp-submenu { display: block !important; } Hide Pop-up Navs .wp-submenu.sub-open { display: none !important; } That should get you started with it, otherwise you can go to wp-admin.dev.css and edit the navigation there, starting at line c. … Read more