Tag Info

New answers tagged

0

Did you ever figure this out, David? I am looking to do the same thing and cannot comment on another answer without 50 reputation.


0

Found a fix. Seems pagination is breaking the display of the the Pages hierarchy in the metabox. Here is the fix to disable page pagination in the nav menu metabox https://core.trac.wordpress.org/attachment/ticket/18282/18282-disable-nav-menu-pagination.patch Thanks


0

if ( !function_exists( 'wp_toolbar_frontend_admin_menu_links_extras' ) ) { function wp_toolbar_frontend_admin_menu_links_extras($wp_admin_bar) { if ( is_admin() || !is_admin_bar_showing() ) return; if ( !current_user_can('edit_pages') ) return; $wp_admin_bar->add_node(array( 'id' => 'homepage', ...


0

To dynamically add menu items you can use WP_Query, specifically get_posts or get_pages. Get pages is more consistent. Here's an example to add all pages to the Pages admin menu. You can change paramaters to exclude, include, orderby, etc in the $args below. To change to a custom post type just change $custom variable to your post type name. ...


0

You could use the posts_clauses filter: function wpse155797_posts_clauses( $pieces, $query ) { if ( ! is_admin() || ! $query->is_main_query() ) { return $pieces; } global $wpdb; if ( ( $orderby = $query->get( 'orderby' ) ) == 'asset_type' ) { if ( ( $order = strtoupper( $query->get( 'order' ) ) ) != 'DESC' ) $order = ...


0

Try this way : add_menu_page( 'custom menu title', 'custom menu', 'manage_options', 'nav-menus.php' ); For more info visit this link


0

As the dashboard uses the menu_position 2, just use menu_position 1. so: $args = array( 'label' => __( 'programmes', 'hiblio' ), 'description' => __( 'Programmes for application from partner organisations', 'hiblio' ), 'labels' => $labels, 'supports' => array( 'title', 'editor', ...


0

You should be able to use the admin_url() function; it returns the admin URL with the first parameter appended, optionally: admin_url( 'admin.php?page=bigname' );


0

You have misunderstand the purpose of add_submenu_page and it's callback function. If you take a look at Wordpress Codex you will see that the purpose of this function , in your case the slides_page function, is to output the content of the page. ie output HTML code etc $function (callback) (optional) The function to be called to output the content for ...


0

I think what you are looking for is: Create a template for your custom page 'slides.' Inside of that template, use WP_Query to call in your custom post type. Like so: <?php $loop = new WP_Query( array( 'post_type' => 'slideroo', 'posts_per_page' => -1 ) ); ?> <?php while ( $loop->have_posts() ) : $loop->the_post(); $do_not_duplicate = ...


-1

You'll want to register your own custom post type. Rather than try and get your head around how to do this properly (as referenced in other answers), I'd recommend you add this to your functions file and adjust as needed: function custom_post_type() { // Set UI labels for Custom Post Type $labels = array( 'name' => _x( 'Staff', 'Post ...


-3

There's a great plugin for creating and editing menu items in the wp-admin. Check it out here: https://wordpress.org/plugins/admin-menu-editor/ You can create custom menu items with that. You may also need to create a custom post type or a page with the text or content on it that you want the new menu link to load. It's good practice to use plugins for ...


1

Not as vague as you might think. This is a very commonly used approach. What I would suggest you focus on is creating a custom post type. This will give you the admin menu item, categories (or any taxonomy structure you like) and many other features. CPTs are very simple to register and modify. They are perfectly suited for storing data such as products ...


2

Please note, this should not be the accepted answer, this is only an extension to the answer given by @ungestaltbar, so please, @willow, accept the other answer, and if you deemed my answer useful, simply just give me an upvote :-) The biggest issue that should solve your problem have been discussed in the other answer, but I would like to point out some ...


6

Remember Apple's "Goto Fail"? Similar situation: Your code actually does this, when indentation is corrected: foreach ( $post_types as $post_type ) remove_meta_box('trackbacksdiv', $post_type, 'normal'); remove_meta_box('postcustom', $post_type, 'normal'); remove_meta_box('authordiv', $post_type, 'normal'); remove_meta_box('postexcerpt', ...


0

The WordPress admin menu scrolls with the page if its height exceeds the height of the window (ie. the menu doesn't fit on the screen). If you're adding custom post types then this could well happen, especially on smaller screens. This is expected behaviour. You wouldn't be able to access the items at the bottom of the menu otherwise.



Top 50 recent answers are included