简体   繁体   中英

Adding style to custom wordpress menu

I'm using the bones starter theme, and have already created one menu that looks like it's supposed to. It's called like this:

<?php bones_main_nav(); ?>

and in the css it's styled simply by using the .menu class.

Now I've created an alternate menu that will be used on some pages. I want it to have the exact same style applied to as the first one, only include different pages. I've called it like this:

<?php wp_nav_menu( array('menu' => 'my custom menu' )); ?>

That shows the right pages but I can't seem to figure out how to apply the same styles to it that are already applied to the first one.

好的,所以我自己弄清楚了,只需要传递这样的属性即可:

<?php wp_nav_menu(array('menu' => 'custom menu', 'menu_class' => 'menu', 'container_class' =>  'menu clearfix', 'theme_location' => 'main_nav')) ?>

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