不同类别/页面/帖子的Wordpress自定义菜单
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了不同类别/页面/帖子的Wordpress自定义菜单相关的知识,希望对你有一定的参考价值。
[register_nav_menus](http://codex.wordpress.org/Function_Reference/register_nav_menus,"register_nav_menus")[wp_nav_menu](http://codex.wordpress.org/Function_Reference/wp_nav_menu,"wp_nav_menu")
[in_category](http://codex.wordpress.org/Function_Reference/in_category,"in_category")
[is_category](http://codex.wordpress.org/Function_Reference/is_category,"is_category")
<?php // add the following to wp theme function.php 'primary-menu' => 'main menu', 'marketing-menu' => 'marketing menu', 'shopping menu' => 'shopping menu', 'technology menu' => 'technology menu', 'recreation menu' => 'recreation menu', ) ); add_action( 'init', 'register_nav_menus' ); ?> <?php // add following to where you want the menu share, in my case, hearder.php <?php 'theme_location' => 'marketing-menu', 'container' => '', 'menu_id' => 'primary-nav', 'container_class' => 'main-menu', 'menu_class' => 'nav' )); } else(has_nav_menu('primary-menu')){ 'theme_location' => 'primary-menu', 'container' => '', 'menu_id' => 'primary-nav', 'container_class' => 'main-menu', 'menu_class' => 'nav' )); ?>
以上是关于不同类别/页面/帖子的Wordpress自定义菜单的主要内容,如果未能解决你的问题,请参考以下文章
如何:在wordpress中自定义帖子类型的自定义类别存档页面
wordpress 3.8.1 类别第 2 页错误 404 未找到 / 自定义帖子类型
如何获取在 Wordpress 中按类别过滤的自定义帖子类型的永久链接?