Wordpress - Pick out specific link and "redirect" it somewhere else
I'm using this bit of code to generate a menu:
<div id="menu">
<?php $args = array(
'depth' => 1,
'show_date' => '',
'date_format' => get_option('date_format'),
'child_of' => 0,
'exclude' => '426, 508',
'include' => '',
'title_li' 开发者_开发知识库 => __(''),
'echo' => 1,
'authors' => '',
'sort_column' => 'menu_order, post_title',
'link_before' => '',
'link_after' => '',
'walker' => '' ); ?>
<ul><div class="menu-button"><?php wp_list_pages( $args, 'sort_column=menu_order' ); ?></div></ul>
</div>
It's generating the menu fine but one of the links I need it to goto another page.
Is it possible to pick out that page by ID and tell it to goto a different address? If so, how can I do it?
I've been using the Page Links To plugin to achieve this.
You should be using the new features of wordpress, it includes a menu system which allows you to create and manage your menus from within the administration panel. You can add existing pages but also links to other websites in the same menu.
read more: http://codex.wordpress.org/Function_Reference/wp_nav_menu
精彩评论