Forget about this, is a duplicate of a question asked a few months ago (sorry, I forgot). However something changed (for the worse): If you create a menu using appearance-> menus, this menu is not recognized at all by the Appearance->editor->navigation, so you cannot insert it for example in the header. You can only generate a navigation menu with the blocks, and here the login/logout)hello username of this plugin do not work. Gutenverse, on the other hand, allows you to select that menu, and everything works.
I apologize again.
Plugin Author
xootix
(@xootix)
Hello Roberto,
Yes, menu links don’t work with the block theme. How about using the shortcode? The shortcode now gives you the ability to include the username.
[xoo_el_action type="login change_to="logout" change_to_text="Logout {username}?"]
You are right, but my problem (due without doubt to my lack of experience in the matter) is that I do not understand how you can insert shortcodes in the block menu. At least, I tried and i got the message “cannot insert this block” (shortcodes are blocks themselves). If there is a way of doing it, can you point the documentation to me? Thank you a lot for your attention.
I tried to follow the suggestions in the web, so I added the code in functions,php to add support for the menus in twenty-twentyfour and allow shortcodes in menus
function register_my_menu() {
register_nav_menu('header-menu',__( 'Header Menu' ));
}
add_action( 'init', 'register_my_menu' );
/**
* Enable shortcodes for menu navigation.
*/
if ( ! has_filter( 'wp_nav_menu', 'do_shortcode' ) ) {
add_filter( 'wp_nav_menu', 'shortcode_unautop' );
add_filter( 'wp_nav_menu', 'do_shortcode', 11 );
}
Al this does not seem to work. Inserting the shortcode in the menu label, it just gets repeated in the menu without being executed. Maybe this trick does not work in block themes anyway.