开发者

Custom Menu in Wordpress [closed]

开发者 https://www.devze.com 2023-01-23 17:35 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.

开发者_如何学Go

Closed 9 years ago.

Improve this question

Im using wordpress 3.0.1 version. My current theme 2010. I had my own theme,i want to create a custom menu for that theme. Can any one give me the code for files in theme


My first instinct was to tell you to go Google this. But here's a great tutorial to get you started.

Basically, you have to do the following:

Register the custom menu

add_action('init', 'register_custom_menu');

function register_custom_menu() {
    register_nav_menu('custom_menu', __('Custom Menu'));
}

Tell your header.php file to use the custom menu

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

Define your custom menu in the UI

Go to Appearance » Menus to create and customize a new menu.

0

精彩评论

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