简体   繁体   中英

wordpress wp_nav_menu

Why I can't add an id or a class in the output of wp_nav_menu?

here is my code:

wp_nav_menu( array( 'container_id' => 'navigation', 'container_class' => 'menu' ) );

nothing happens on this.

I already added it to registered items in functions.php

Are you using the WP Super Cache plugin? You will need to turn it off while you are changing/developing things. Also, some themes don't always support menus in the way you might expect.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM