Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have been trying for months to make a one page WordPress site. This site has need for a special character set in the navigation in order to work. Each page is set up in an unordered list based on the title. So in the code, a page would look like this

 <li page="page_about_us">
   about page content would go here
 </li>

In order to navigate to the about page the way I need to set this up, the nav link would look like this

http://www.myblog.com/!#/page_about_us

I can do this just fine. I have decided to use the built in features of WordPress to make my custom links. So I make a custom menu item and set the url like so

!#/page_about_us

Then I give it a title and add the item to the menu. It works out great.

I had trouble getting the blog to work the way I wanted it to work. I wasn't getting pagination correctly so I figured I would try to reload the page instead of having it load into the homepage. My problem started when I tried to go from the blog or a single page back to the custom menu structure. If I am on the blog page and then hover over the about page link, I get this:

 http://www.myblog.com/blog/!#/page_about_us

when I should be getting this:

 http://www.myblog.com/!#/page_about_us

Now I did set up a custom walker in my site and I tried some code to fix the issue and was able to get 50% of the way. When I hovered over the about page with the tweak to my custom walker, I did get the correct address. My problem then was that when I hovered over the blog page, it did not give me the correct address.

so what I did, was I added this tweak into my custom walker

     if( !is_front_page()){
    $temp_url = strtolower(trim(str_replace(" ", "_", $item->title)));
    //if I have set a custom link with a # sign for the purposes of a top link for a drop down menu
    if ( $item->url == "#") {
        $item->url = get_bloginfo('url')."/#";
    } else {
                    //trying to go back from the blog or single page to the custom nav structure
        $temp_url = strtolower(trim(str_replace(" ", "_", $item->title)));
        $item->url = get_bloginfo('url'). "/#!/page_".$temp_url;
    }
} 

So what I have done now is strip my site straight back to the 2012 theme and set up my static page the correct way. I put the code for my blog into the index.php which is a loop to get the posts from the category "blog" and I set up a page template called template-homepage.php for the front page and set those settings in the reading section.

Can you offer some advice on how to solve my issue? You can check out the site at http://www.rc-hc.com/mafloral

To sum up my issue, just visit the link, go to the blog or a single page and you can see the issue I am having when you try to go back to any other page.

share|improve this question
3  
Can you please edit your title. "need serious help" is not very helpful to someone who might have an answer to your question but never clicks on it because of your title. –  Chris_O Apr 17 '13 at 3:31
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.