Ad Inserter
94Manage Google AdSense ads, banners, ad rotation, sticky widgets, AMP ads, ads.txt, tracking, header and footer...
Menu Item Types makes it easy to add and create custom menu item types to your navigation menus.
Menu Item Types is a WordPress plugin that allows you to enhance your navigation menus by adding various custom links and items, such as archive links, titles, paragraphs, or images. It also provides the capability to create and register your own custom item types through code in your theme or a plugin.
This plugin is suitable for developers who want to extend the functionality of WordPress menus and require a flexible way to manage custom menu items. It includes options to override templates and customize the rendering of menu items.
Best for: This plugin is best for WordPress developers looking to customize navigation menus.
What it does well
Where it falls short
Menu Item Types offers useful features for customising navigation menus, but it is geared towards users with programming skills.
Maxime Pertici's own description of Menu Item Types, lightly tidied.
Menu Item Types makes it easy to add links to your archive pages, titles, items without URL, paragraphs or images to your navigation menus.
You can also easily override the templates and/or create your own custom elements.
You need to declare your new type in, functions.php, a plugin, child theme, or your custom theme like this :
function register_my_custom_type(){
$args = array(
'slug' => "my-custom-type",
'label' => __( 'My Custom Type', 'my-custom-type' ),
'render' => 'path/to/render/my-custom-render.php',
);
mitypes_register_type( $args );
}
add_action( 'mitypes_init', 'register_my_custom_type' );
You can do more than that on $args.
$args = array(
'slug' => "my-custom-type",
'label' => __( 'My Custom Type', 'my-custom-type' ),
'render' => 'path/to/my-custom-type-render.php',
// Link your custom icon
'icon' => 'https://url-to-icon-file.svg',
// Return ACF Group field array
'field-group' => [
'key' => 'uniq_key',
'title' => 'Group Title',
'fields => [
...
],
'location' => [
[
[
'param' => 'mitypes',
'operator' => '==',
'value' => 'my-custom-type',
],
],
],
],
// Use callback for customize your item
// you can add filter on 'mitypes_nav_menu_link_attributes' if you need
'callback' => function(){ ... }
);
And finally, you can work in the render with some variables.
You have two variables available:
// $item is the WP_Post of the menu item, with which you can, for example, retrieve custom field data.
$id = get_field( 'acf-slug', $item->ID ) ;
// $args is an object containing the complete configuration of the wp_nav_menu() call,
// including the current menu (WP_Term), classes, IDs, wrappers, depth, walker, menu location, etc.
// More info : https://developer.wordpress.org/reference/functions/wp_nav_menu/
There are already additional plugins.
You can also create your own elements like these plugins do:
// Disable Post Type Archive Metabox
add_filter( 'mitypes_has_post_type_archive_metabox', '__return_false' ) ;
// Disable Buildin Item types
add_filter( 'mitypes_has_buildin_item_types', '__return_false' ) ;
// Mix Buildin and Plugin Item types in the metabox
add_filter( 'mitypes_mix_metabox_item_types', '__return_true' ) ;
// Filter Supported Item types
add_filter( 'mitypes_supported_types', function(){ return ['image']; } );
// Disable Nav Item Icons
add_filter( 'mitypes_nav_menu_items_has_icons', '__return_false' ) ;
Other plugins for custom content structures.
Manage Google AdSense ads, banners, ad rotation, sticky widgets, AMP ads, ads.txt, tracking, header and footer...
ACF helps customize WordPress with powerful, professional and intuitive fields. Proudly powering over 2 millio...
Checkout Field Editor (Checkout Manager) for WooCommerce – The best WooCommerce checkout manager plugin to man...
Easily reorder posts, pages, custom post types, and taxonomies with intuitive drag-and-drop sorting in the Wor...
The #1 user-rated activity log plugin for event logging, activity monitoring and change tracking.
Admin UI for creating custom content types like post types and taxonomies