WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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>

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?

share|improve this question

its a simple one liner if you want to use jQuery:

jQuery('#page-id').attr("href", "http://www.google.com/");
share|improve this answer
This will affect the way all the other links work though. – Rob Jun 6 '11 at 10:31
not if you put a specific page id as a selector! – Bainternet Jun 6 '11 at 16:35
up vote 0 down vote accepted

I'm now using the Page Links To plugin to achieve this.

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.