[Support request] Anchors and Conditional Menu

Home Forums Support Anchors and Conditional Menu

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #323457
    Victor

    Hello. First of all, congratulations on the amazing theme.

    I’m new to wordpress and I’m using the premium version of GeneratePress.
    I have some anchors in my pages, and I would like to properly link the items on the menu to the sections.

    To ilustrate, here’s a simplified example with 2 pages, Home and Contact.
    Items on the menu: Home (sub-items Company and Mission) and Contact.
    If I’m on the page Home and click on the sub-item Company, the url should be “#company”, so that it just scrolls down to that section. But if I’m on the page Contact and click on the sub-item Company, it should be a full link to the page followed by “#company”. I don’t want to place this full link when on Home because I don’t want the page to reload.

    Sorry if I didn’t explain it properly, but I believe it must be a trivial issue.
    I read a post here where you recommended the “If Menu” plugin, but I couldn’t activate it on the latest version of WordPress (fatal error).

    Thanks for the attention.

    #323495
    Leo
    Staff
    Customer Support

    Hi Victor,

    Yeah I think you would have to try a plugin for that.

    I just installed and activated If Menu (https://en-ca.wordpress.org/plugins/if-menu/) and it’s working for me on the latest version of WordPress and GP.

    The conflict might be from other plugins. Can you try deactivate all non GP plugins and activate If Menu again and see if it works?

    #323530
    Roberto Enrique

    If you see on this page:
    http://onepager.artomultiplo.net

    It works as it should without plugins

    When you click on a link on the menu that has the anchor to the section it takes you smoothscrolling to that section.
    Then if you go to the contact page you can allways use the menu links to go to the homepage sections even if the links are like http://onepager.artomultiplo.net#section3.

    And they don’t make the page to reload in the home page.

    #323531
    Victor

    Thank you for the reply Leo.

    I deactivated all non GP plugins and tried it, still got the same error activating If Menu.
    Here’s the error:

    Parse error: syntax error, unexpected T_FUNCTION in (path)/wp-content/plugins/if-menu/conditions.php on line 11

    Any idea what causes it?

    #323539
    Leo
    Staff
    Customer Support

    Not sure what’s causing that. Maybe try deleting and re-installing it though?

    I like Roberto’s solution though 🙂 Thanks for sharing it!!

    #323555
    Victor

    I tried re-installing both GP Premium and If Menu, didn’t work.

    Thank you for your solution Roberto. I already have a plugin (Easy Smooth Scroll Links) to smoothscroll, will they conflict?

    I’m going to try it and report here later.

    #323558
    Roberto Enrique

    Less plugins to load is always better.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.