How can I have a page besides One Page layout, and also keep the menu working?

I’m sure that you followed this article in order to create an One Page. However, many users preferred to keep the contact page separate (on a different page). In this specific scenarios, here’s what happens: the buttons of the menu at the top of the page became unusable since they were set to go to sections on the same page.

Starting from here, we will create here only the menu for the contact page (or any other page that is not included in One Page).

Step 1 – Installing the Required plugin

In order to be able to set a different menu for the contact button on the menu, we’ll need to use Conditional Menus plugin.

To create the menu links, we will:

  1. Go to WordPress Dashboard → Appearance → click on Menus.
  2. Add a new Menu, let’s call it “Main Menu Secondary” (or any other name).
  3. Add a menu item for each page/subpage that you want to scroll to, like you did on the other article. We will use the “Links” type and each item will have this particular structure:
    • URL: Link to the Open Page + #post-id-title where “id” is the Page ID that you can find by going in Admin Panel → Pages – select a page to edit and look at the browser URL bar; For example, if the link to the Open Page is www.example.com and the ID is 220, the link to the section is www.example.com/#post-220-title
      *Note: You can skip the “-title” if you want to link directly to the content or if you don’t have a featured image.
    • Link Text: the name that will appear on the menu (Eg. Reservations).
  4. Link to the page outside of the One Page (for example, if we create a separate menu for the Contact page, now you should add the link for this on by simply selecting it from the left side, from the Pages block).

Step 3 – Set the New Menu to the Separate Page

Go to Appearance → Menus → Manage Locations → Main Menu and click on Conditional Menu. Now, on the new field, select the menu that we just created. Once you’ve done that, click on + Conditions and select the page where you want to appear this menu (in our example, the Contact page). Now you just need to Save Changes and that’s all.

You can repeat the same process for any number of separate pages (you can have the homepage just as a presentation and keep the contact and the shop on different pages).

Updated on April 19, 2017

Was this article helpful?

Related Articles