Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Feb 2021
    Location
    Hamburg, Germany
    Posts
    2
    Member #
    62509

    Unhappy Wordpress - Main Menu anchoring for homepage without reloading?

    Hey guys,
    I am new here, would enjoy a working reply:

    I am building out my Website right now - using WORDPRESS.org

    (problem described after point 4)

    1) On my homepage there are many sections (one page layout)

    2) I want to have submenu-items for these secitons in my Main Menu (primary menu)

    3) lets call the structure of home.html basically similar to the one stated below:
    <div id="all">
    <div id="block-1">Block-1 text</div>
    <div id="block-2">Block-2 text</div>
    <div id="block-3">Block-3 text</div>
    <div id="block-4">Block-4 text</div>
    ...
    </div>

    4) My sub-menu link items WORK BOTH FOLLOWING WAYS:
    solution A) <a href="#block-1">Block-1</a> --> works from the home.html obviously
    solution B) <a href="www.website.com/home.html/#block-1">Block-1</a> --> works from the home.html obviously

    NOW THE PROBLEM:

    there is only 1 main menu in Wordpress

    --> with Solution A
    Submenu items not working when visitor is trying to access from another page, lets say "page2.html"

    --> with solution B
    if visitor clicks on it, everything works from everywhere, but even If visitor is on the same page aka "home.html" and just wants to jump to another anchor, the page is firing a new request and reloading the whole content.

    Is there a standard solution to that?
    Or any ideas?

    Thanks for your answers!

  2.  

  3. #2
    Junior Member abdlimran's Avatar
    Join Date
    Nov 2020
    Location
    Pahartoli, Alongkar, Chittagong, Bangladesh.
    Posts
    6
    Member #
    62139
    Hi! if you want single-page navigation the solution A will work fine. But if you have a multi-page website you can't do it this way. Now if you need page navigation using WordPress then it will be reloaded. You can try to build your website using React.js or other JavaScript Frameworks you can do page navigation without page reloading.

  4. #3
    Junior Member
    Join Date
    Feb 2021
    Location
    Hamburg, Germany
    Posts
    2
    Member #
    62509
    Hey Mr. abdlimran,

    thanks for your reply.
    I am actually not so experienced with webdesign, so I just use a CMS like Wordpress to have an easier time around.

    Acutally I found a solution by just trying around random stuff I found by googling, and ....

    I FOUND A VERY EASY WORKING SOLUTION USING WORDPRESS:
    nav bar custom link:
    "https://www.website.com/#home-block-1"
    --> targets anchors correctly without reloading from the regarding page
    --> and also targets correctly from every other page on the website!

    ANOTHER QUESTION:
    Anyway, is there an easy way of also moving it a few pixels to compensate the sticky header height?


    Thanks in advance:


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:52 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com