Render link description in navigation block

I solve this problem by using WordPress Filter hooks I use the filter render_block, to hook in altering the existing HTML So I created custom_render_block_core_navigation_submenu hook function. Inside my hook I am using conditions to avoid storing my modified code in the database. Target the type of block (core/navigation-submenu) Only render in the front-end Don’t alter … Read more

Show shortcode output in menu

Please add below line in your functions.php file add_filter(‘wp_nav_menu_items’, ‘do_shortcode’); This line will execute do_shortcode to your menu items and if there is any it will execute the shortcode.

Main Menu Hover is Always White

Looks like Elementor is setting the hover color for all links on the page to #5E6462, which is hard to read against the background color of the nav menu. Somewhere within Elementor the color is being set; that will need to be changed.

register_nav_menus() not registering

Perhaps it’s happening too early and getting stomped on later. Try doing it the traditional way, in an init hook callback, like so: function register_my_menu() { register_nav_menus([ ‘main-menu’ => esc_html__(‘Main Menu’, ‘myfirsttheme’), ]); } add_action( ‘init’, ‘register_my_menu’ );

Give custom class names to WP nav sub-menu

I was able to work this out by using a hook that I grabbed from Artemiy Egorov’s answer on this post https://stackoverflow.com/questions/5034826/wp-nav-menu-change-sub-menu-class-name so I figured I’d share in case someone else needs it too: add_filter( ‘nav_menu_submenu_css_class’, ‘rename_sub_menus’, 10, 3 ); function rename_sub_menus( $classes, $args, $depth ){ foreach ( $classes as $key => $class ) { … Read more

Critical Error when editing menu

The posts_page variable is looking for a page set as the “blog” page in the reading settings. At some point this was unset or the blog page was removed, it is not clear, but simply making a blank page and setting it as the “blog” page under settings->reading resolved the issue.