开发者

create own wordpress theme (tewnty ten as base)

i have to create a customized wordpress theme. i still don't how it should look like, so viewed the twenty ten theme files to figured out what i could customize. so i searched for the menu build function in the header.php file and found this

<?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to w开发者_运维知识库p_page_menu. The menu assiged to the primary position is the one used. If none is assigned, the menu with the lowest ID is used. */ ?> <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>

but i cant figure out what this function does...where is written how the menu is created with html tags like <ul>, <li> and so on... i wan't to edit the html code!

regards, peter


Check out the documentation for wp_nav_menu in the codex. It's a menu system added to WordPress back at version 2.9 (I believe). If you navigate in your dashboard to Appearance -> Menus, you can customize it through an interface. In Twenty Ten, the fallback is wp_page_menu, which displays a list of your pages. Should you prefer to build yours by hand and hard code it into the theme (not advisable, but possible) just delete the relevant code and replace it with your own HTML.

My adviice is to look into the Menu interface, create a menu, assign it to the theme position 'primary', and go from there with a properly configurable and WP-driven menu.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜