I am trying to:
When I create a Custom Post type, I can set where it appears in the left hand WP admin menu. This was working fine after creating a few post types a couple weeks ago. Now that I added a few more post types, the ordering is not working at all. In fact I seem to have no control since they just appear in the same spot no matter how much I edit the desired order within each post type.
Link to a page where the issue can be seen: Attached image shows the custom posts types of Quotes, Books, Guests, Podcasts, Essays, FAQs
I expected to see: The items ordered on the left based on how I set it up in each post type config page. I have them set up to order as Podcasts, Guests, Essays, Books, Quotes, FAQs
Instead, I got: Not ordered as I set them.
Hi,
Thank you for contacting us and I'd be happy to assist.
I couldn't find any image attached to the ticket. Can you please share temporary admin login details, so that I can see how these post types are configured in the admin area?
Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.
regards,
Waqar
Sorry, here's the screenshot I meant to send earlier, plus a full page image showing how the Podcast type is configured, and that I want it to appear after Posts in the left side menu.
Thank you for sharing the screenshots.
To have absolute control over the admin menu position of the custom post types, you can make use of the 'menu_position' argument.
For example, to move the 'Podcasts' post type menu item, immediately after 'Posts' you can assign it the menu position of '6':
add_filter('register_post_type_args', 'podcast_position_custom', 10, 2);
function podcast_position_custom($args, $post_type){
// if post type 'podcast'
if ($post_type == 'podcasts'){
$args['menu_position'] = 6;
}
return $args;
}
The above code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through the active theme's "functions.php" file.
Similarly, you can include code snippets for the other custom post types too.
Useful links:
https://developer.wordpress.org/reference/hooks/register_post_type_args/
hidden link