Inconsistent internal links


#1

Hi,

I have several links of the form #pg-8-1, #pg-8-2 etc. (probably as the most users of sydney).

On the main (front) page on several buttons and in main menu I’m using links of the form:
www.dc-corporate.ro/#pg-8-2 or www.dc-corporate.ro/#pg-8-5 etc.

As long as I access these links starting from the main page, everything works as expected BUT if I’m going on the blog page (www.dc-corporate.ro/oportunitati) or on any other page (except front page), accessing back the same links in the main menu is taking me to a “minus one” link on the front page, like this:
Instead of going to www.dc-corporate.ro/#pg-8-5, the jump is made to www.dc-corporate.ro/#pg-8-4
Clicking again on the same menu is taking me to the correct link (because now I am already back on the front page).

I do not know if this is a theme issue or something else… but the behavior is the same in chrome or firefox or ie.

Thank you,


#2

Hello Postmaster,

Can you please try to deactivate all your plugins except recommended and see if it helps?

Kind Regards, Roman.


#3

Hi Roman, thanks for the reply,

It took me a while, but I did something more relevant: I’ve installed a clean wordpress (on a wamp64 platform) with only sydney theme and the demo content taken also from sydney.

The behavior is exactly the same, so now we know is not an issue from another plugin.

I’m thinking that this could be a browser’s different way of positioning the internal links, when “calling” that links from inside the same page or from an outside page.

What I did: in the demo content, after setting up the front page and the blog page in the theme options, I’ve made 3 “custom link” sub-menus, with links of the form: http://site-front-page/#pg-8-3, http://site-front-page/#pg-8-4 and http://site-front-page/#pg-8-5 (the site is only local, but I could make it available for external browsing for a short time if necessary, only to be available for test)

Now, pushing that sub-menu from the front page is scrolling the page exactly to the intended bookmark.
Pushing the same sub-menu but being on the blog page, is “jumping” to the “minus one” bookmark (instead of #pg-8-4 I’m jumping to #pg-8-3).

What do you think about this issue?

Thank you,


#4

Hello Postmaster,

We tried to replicate this issue on Demo site, but it works there.

Looks like it requires close inspection, however, you can use this feature only on the front page for now. You can hide menu items with ID links on other pages with the following CSS code:

li#menu-item-563,
li#menu-item-693 {
    display: none;
}

body.home.page li#menu-item-563,
body.home.page li#menu-item-693 {
    display: inline;
}

Kind Regards, Roman.