How to scroll item in the Menu setting effectively?
If the only issue is that you want to move an item to the top, there is actually a link to achieve this, once you have clicked to expand on a single menu item
If the only issue is that you want to move an item to the top, there is actually a link to achieve this, once you have clicked to expand on a single menu item
Why this is happening The default menu_order is 0, so unless you manually change this any new Page/Post inserted in to your DB will correctly have this menu_order set. You can set the menu_order for any Page via Quick Edit as below (or indeed the Edit Page screen if you wish) – By default, Post … Read more
For identical values they’ll be in whatever order they’re returned by the database engine, which would typically be the order they were inserted in the database. Anyway, the question you’ve linked is old, you can order by multiple columns with WP_Query: $query->set( ‘orderby’, array( ‘menu_order’ => ‘ASC’, ‘date’ => ‘ASC’ ) ); pre_get_posts acts on … Read more
it seems to me, after going through the source codes (both PHP and JS), that gallery and it’s order is not saved to database at all. Gallery exists only in JS when you are creating that and even does not persist when you leave a post editing page. Gallery gets saved only by inserting gallery … Read more
Your code should work in theory. Your failure is not caused by the code in your question but rather due to external factors. Something else is causing this failure DEBUGGING THIS ISSUE Turn on debug and check for obvious errors and warnings. This should be a good indication on the soundness of all your code … Read more
you cannot put this on position 5 because there is something but you can put it on 4.5 with this code : add_action(“admin_menu”, function () { $GLOBALS[“menu”][4.5] = $GLOBALS[“menu”][20]; unset($GLOBALS[“menu”][20]); });
Got it, thanks to cjbj‘s help, I was able to get the final solution: add_filter( ‘custom_menu_order’, ‘submenu_order’ ); function submenu_order( $menu_order ) { # Get submenu key location based on slug global $submenu; $settings = $submenu[‘options-general.php’]; foreach ( $settings as $key => $details ) { if ( $details[2] == ‘blogging’ ) { $index = $key; … Read more
First of all, never use query_posts, ever. My emphasis. It is outright not meant to be used at all, and should be removed in future wordpress versions. Overall performance wise I would say it is even worse than a custom query. You should really be using WP_Query for the task at hand Note: This function … Read more
The wp_list_categories() function calls the get_categories() function, that’s a wrapper for the get_terms() function, that creates an instance of the WP_Term_Query class. It doesn’t look like it supports ordering by term order. If the plugin uses the term_order column in the wp_terms table, then you can try to add a support for it’s ordering, via … Read more
every menu have an number . lower the number priority. add_action( ‘admin_bar_menu’, ‘wp_admin_bar_sidebar_toggle’, 0 ); add_action( ‘admin_bar_menu’, ‘wp_admin_bar_wp_menu’, 10 ); add_action( ‘admin_bar_menu’, ‘wp_admin_bar_my_sites_menu’, 20 ); add_action( ‘admin_bar_menu’, ‘wp_admin_bar_site_menu’, 30 ); more clear idea you can check the link below http://natko.com/custom-menu-item-position-in-wordpress-admin-bar-toolbar/