• Hello. This is my first post here so forgive me if something’s wrong (like category etc.)

    So I have a one page template and everything works – if I click a link it just goes to a desired section on a page. Links are just made by adding
    #go-to-this-section (and of course some jQuery to prevent default behavior of link and add some scrolling).

    Now I’ve added a blog and it is an “external” link – it just goes to blog page. When I’m there I can’t go back to the first page. How can I make this work? I thought I could add some conditios like if it is on blog then it would add a full url to the one page before the #go-to-this-section
    but how do I do that?

Viewing 15 replies - 16 through 30 (of 30 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Sorry, I thought you were working on a 1 page site. My mistake.

    Thread Starter rafalborowski

    (@rafalborowski)

    Sorry, I thought you were working on a 1 page site. My mistake.

    Yes you are correct, but then I decided to add to this one page site a blog. And that’s when my menu issues started. I don’t know how to get back after going to the blog page.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    On your blog page, could you use a different template.
    Then make a new menu in the dashboard > Appearance > Menus section, a menu that will hold your proper URLs.
    Then in the blog page’s template file, select that menu in arguments of the wp_nav_menu function.

    Thread Starter rafalborowski

    (@rafalborowski)

    Yeah but that would still require to hardcode the url’s right?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    The menu should automatically generate the links for you, but you can hard-code URLs if you want to
    https://codex.www.ads-software.com/Appearance_Menus_Screen#Custom_Links

    Thread Starter rafalborowski

    (@rafalborowski)

    No I don’t want them hardcoded. I want them to be generated by WP. I just don’t see it working. So I would register two menus, and create two templates and each would have a separate menu. OK – no problem I can do this. And then what?

    On the first one I would have everything like now. And then when I go to the blog I would use second menu that do what? How do I make this second menu to go back? I would have to input whole URL’s in this second menu in order to work.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    So I would register two menus, and create two templates and each would have a separate menu

    You only need to create one template for the blog page. The only thing different will be the wp_nav_menu function.
    E.g;

    <?php wp_nav_menu( array('menu' => 'Second Menu' )); ?>

    On the first one I would have everything like now.

    As you’ll be creating a different template and assigning it to the Blog page, it’ll only be the Blog page that’ll be affected.

    And then when I go to the blog I would use second menu that do what?

    You’ll use the standard generated URLs to circumvent the issue of the hashtags no longer linking.

    How do I make this second menu to go back?

    If there isn’t already a link in the navigation menu to the one-page, you can create a new menu item and hard-code the link to that page.

    I would have to input whole URL’s in this second menu in order to work.

    Not necessarily. The menu will automatically generate the link if you don’t specify the URLs.

    Thread Starter rafalborowski

    (@rafalborowski)

    The menu will automatically generate the link if you don’t specify the URLs.

    Yes but it will only generate one link to this page. And I will not be able to add the anchors.

    See this page – https://demo.drythemes.com/dry-wp-one-page/.

    Check the markup with firebug by going to first page and then the markup on the “SHORTCODES” page. I want something just like this.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Yes but it will only generate one link to this page. And I will not be able to add the anchors.

    Yes, that’s correct. I thought you have one massively long page where you’re using hash tag navigation, then another page separate that has your blog.

    Or is your blog within the same massive page?

    Thread Starter rafalborowski

    (@rafalborowski)

    No they are two separate pages. But there are not only two links in the nav. We have something like this

    #LINK1   |   #LINK2   |   #LINK3   |   #LINK4   |   BLOG

    So there are four links (each goes to different area of the first ONE PAGE) and the last link is a separate link to separate page – blog.

    PS. Thank you for spending so much time on this. Really appreciate it! Hope we can get this solved ??

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Is the issue that when you click on

    | BLOG

    It doesn’t go to the right page?

    Thread Starter rafalborowski

    (@rafalborowski)

    When I click on BLOG it takes me to blog – no issue here. But when I’m there (on the blog) I cannot get to other pages since the links are anchors and it shows:

    https://localhost/wordpress/blog/#link

    instead of:

    https://localhost/wordpress/#link

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I’m sorry, I don’t know the answer to this. For others to help, you may have to host your website and link us to it. The website that has the blog on a separate page.

    That’s basically the same thing I told him, Andrew. If he made a temporary login I could figure it out. That’s usually what you do if you can’t really articulate the issue you’re having well enough for others to comprehend.

    Once I thought I got a handle on it, he got upset. But I still think his issue is in Appearances >> Menus >> Custom Links. And then he an add a page to the menu.

    Now, when he makes a custom menu, he has to realize he can put anything in there … categories, posts, pages, or custom URLs. For most of his menu item, he should add custom URLs to the menu.

    Then for his /blog/, he should add a page, his /blog/ page. Save the menu. Done. And on top of that, it’s a paid theme. Every paid theme has a support forum / contact. Unless he’s already gone that route.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    it’s a paid theme

    Sorry, missed that.

Viewing 15 replies - 16 through 30 (of 30 total)
  • The topic ‘One page navigation’ is closed to new replies.