Post Navigation based on ACF custom Field
Post Navigation based on ACF custom Field
Post Navigation based on ACF custom Field
Consider changing the CSS to: .wp-block-navigation-item.current-menu-item .wp-block-navigation-item__label { color #365ABA !important; } Please note, this only works on the Πρότζεκτς and Γνωρίστε μας menu items. As these are the only pages that get the current-menu-item class when on their respective pages. For the other menu items, you may need to look at re-adding the menu … Read more
To get a full control of the menu items you can create a custom Walker class, which extends the default Walker_Nav_Menu class. Override and customize the class methods as needed. Finally pass an instance of the custom walker to wp_nav_menu( array $args = array() ) with walker key in the $args array. If you only … Read more
I checked both of your links and in the <body> tag, both of them have class page-id-1508, meaning that the page id is recognised correctly either with or without the query variable. However, as @mmm suggested in the comment above, it seems that you added the menu item as Custom Link (note the menu item … Read more
After a lot of reading, debugging and testing I did not manage it to modify the default core/navigation block as I wanted. The interactivity API still keeps getting in the way. So my solution was to enable the classic menu and make it a custom dynamic block: My theme’s functions.php: function my_theme_register_menus() { register_nav_menus( array( … Read more
Is there any documentation on JS trigger for the Gutenberg “Navigation” block?
You can easily add any HTML element to all menu items that have children by extending the Walker_Nav_Menu core class. The code below will add <i> icon element just after menu item </a> tag but you can of course change that if you need them inside or somewhere else by changing the $item_output variable. function … Read more
Add/remove capability for blocks theme nav menu
If it’s a menu item in a classic menu, then yes, you could use useEntityProp to get and set the menu item’s post meta, except that the post type is actually nav_menu_item and that you would need to manually add custom fields support to that post type. const navMenuItemId = 123; const [ meta, setMeta … Read more
As pointed out in the comments it’s currently not possible to use the navigation block in a widget. I missed the section in the GitHub issue where they explain more detailed that simply enabling the block wouldn’t solve the problem.