Support » Fixing WordPress » One Page Website – How to load a specific position directly?

  • Hello,

    I created a child theme. At least I hope so. Switching to it was possible [ redundant link removed ] and the theme settings were reset to default, which I hope is correct.

    I need to solve two problems.

    1. The reason I created a child theme. Menu items are not pages but links to a specific element on the page. And when the site is loaded, they are all underlined (all of them are current-menu-item class). Only after loading will the classes be removed (except the first). It is a fraction of a second, but it can still be noticed.
    Adjusting the code would certainly help. However, I do not know how to modify the code in order to load it in the finished form.

    2. When scrolling the web (either manually or via menu), the underlined menu item and url are changed. But if you just load a web with a link to a specific part of the page – for /#reference, this will load the web classic and then jump to the desired position, which looks strange.
    Again, couldn’t it be fixed with code modification?

    Please for advice.

    Thank you

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • These are theme-specific questions and should be asked at the parent theme’s support forum, so the people that know that code can help.

    Of course I could, but the theme support is quite stagnant. In addition, this requires better javascript. It is not necessary to know the whole code (at least I think)

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Side note @michalrama Use the link field. When you keep posting the way you do, you come across like a spammer and that’s not good. I’m sure that is not your intention but there is a reason for that field. Please use it.

    Yes, of course. I did not realize that. Sorry @jdembowski.

    Only after loading will the classes be removed

    This indicates that the theme is already doing something most themes are not.

    Again, couldn’t it be fixed with code modification?

    You have to know (and be able to see) the code in order to modify it. But browsers jump to target anchors without much way to influence them, and each positions it slightly differently.

    OK.

    So the second problem cannot be prevented?

    What about the first problem? I believe it is possible to set a static value so that the current-menu-item class has only the first menu item?

    Hurray. So I managed to solve the first problem. Just add this css code.

    ul.dropdown-menu.active-line-bottom > .current_page_item > a,
    ul.dropdown-menu.active-line-bottom > .current-menu-item > a, ul.dropdown-menu.default > .current_page_item > a,
    ul.dropdown-menu.default > .current-menu-item > a {
      border-bottom: none;
    }

    Although it’s not underlined at the top, but it doesn’t matter. And there’s no need to create a child theme.

    However, there is still a second problem. If it can’t be solved, would it be possible to make a one-page menu in a different way?

    Thank you

    would it be possible to make a one-page menu in a different way?

    You didn’t say what way you made the current one.

    It seems like a lot of trouble to force software made for multiple pages to use only one page, and end up with a less useful result. (one page sites are bad for SEO, harder to use analytics, bad for selling ad space, bad experience for the user, bad for comments going to the right content)

    You didn’t say what way you made the current one.

    I switched to the html editor and added id to specific elements.
    Menus are only user links that link to these elements, in the form of #id.

    It’s nicely explained here. Of course, there is exhausting information, but I only made the basis.

    And with this menu Mesmerize integrates well, so I used it. Of course, this is not the only reason – for example, to set a sticky menu without using an external plugin for this feature.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘One Page Website – How to load a specific position directly?’ is closed to new replies.