开发者

Wordpress 4 Column menu on footer [closed]

开发者 https://www.devze.com 2023-04-07 12:29 出处:网络
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references,or expertise, but this question will likely solicit debate, a
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 11 years ago.

Does anyone know of any plugins or a simple way t开发者_开发百科o have a 4 column menu on the wordpress footer populated with Categories / and or Pages please?

Thanks


If you have custom menus activated in your functions file in your theme you can add a custom menu to your footer quite easily, like so:

<ul id="nav" class="bottom">
    <?php wp_nav_menu(array('menu' => 'Nav Bottom')); ?>
</ul>

If you don't have custom menus already activated, make sure to place this bit of code in your functions.php file:

//Wordpress custom menu support
if (function_exists('add_theme_support')) {
    add_theme_support('menus');
}


Add this to your functions.php:

//register custom menu    
function register_my_menus() {
      register_nav_menus(
        array( 'g-nav' => __( 'Global Navigation' ), 'f-nav' => __( 'Footer Navigation'))
      );
    }

As you can see in the above code, you can:

  1. Register as many custom menus as you like
  2. Name the custom menu as you like (the name that will appear on the left of the Custom Menu section will be the one that you define within ('') in the code above.

Following on from there, add the following snippet to the area you wish for the custom menu to appear:

<ul id="menu">
    <li><?php wp_nav_menu(array('menu' => 'g-nav')); ?><li>
</ul>

Next go to your CSS and style it according to how you'd like the columns to come out. It could be something like this:

#menu ul{
   list-style-type:none;
}

   #menu li{
       display:inline;
       padding:5px;
   }

Once you're done, you just need to go to your Dashboard and look for the Custom Menu module and select it. You should be able to figure the rest yourself as it's pretty straightforward from there on.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号