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 am using ajax in a theme not written by me. This ajax gets the link clicked and then slides that page into view. it works good. In order for it to do it's thing, I had to make a custom walker for wp_nav_menu that adds two characters to the link so my links look like this in the nav


my problem with this is that when viewing a single page. I have to have WordPress reload the page to get the single post. So then my link would look like this


So when I hover over the nav to go back to a previous or new page, this is where my problem starts. my nav shows this as the selection when clicked


I don't know why it won't get rid of the previous address. Here is my custom walker http://pastebin.com/Xn7NRiG7

Most of the site is is loading posts and pages into the index and then using the ajax to scroll that page into view. I am trying to make the single blog pages external to the ajax functionality. I tried using two different menus for this like so

 if( is_home() || is_page()){
           $args = array( 'depth' => 3, 'container' => '', 'container_class' => '','menu_class' =>'', 'menu_id' => 'menu', 'fallback_cb' => 'default_menu','link_before' => '<span></span><strong>','link_after' => '</strong>', 'theme_location' => 'primary','walker' => new Amaranthe_Custom_Walker_Nav_Sub_Menu());
        } else {
           $args = array( 'depth' => 3, 'container' => '', 'container_class' => '','menu_class' =>'', 'menu_id' => 'menu', 'fallback_cb' => 'default_menu','link_before' => '<span></span><strong>','link_after' => '</strong>', 'theme_location' => 'primary');
        } ?>

Do you have any idea how I might be able to get back into the ajax flow properly?

share|improve this question
up vote 0 down vote accepted

I solved this issue by adding this code to my walker

    if( !is_home()){
    $item->url = get_bloginfo('url')."/#!/page_".$temp_url;
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.