admin管理员组

文章数量:1122832

I've got this header menu in my site (made editing a theme), but i've noticed that the custom links pointing at local anchor section (like #section) correctly navigate in the same page to the desired location, but an external link won't work, even if specifing "open in new tab". I suppose something is preventing the menu link to open, or worse, the external link is not supported in that theme. Since i'm noob, where should i look for the menu item/link opening behaviour? Would it be easy to modify such behaviour?

the menu element html is the following:

<li id="menu-item-812" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-812 level-0"><a class="menu-item-href" href="#societa"><span class="line_wrap"><span class="line"></span>L’Agenzia</span></a></li>
<a class="menu-item-href" href="#societa"><span class="line_wrap"><span class="line"></span>L’Agenzia</span></a>

If i create an external link is the same, the url goes as www.google (for example) in the href.

I've got this header menu in my site (made editing a theme), but i've noticed that the custom links pointing at local anchor section (like #section) correctly navigate in the same page to the desired location, but an external link won't work, even if specifing "open in new tab". I suppose something is preventing the menu link to open, or worse, the external link is not supported in that theme. Since i'm noob, where should i look for the menu item/link opening behaviour? Would it be easy to modify such behaviour?

the menu element html is the following:

<li id="menu-item-812" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-812 level-0"><a class="menu-item-href" href="#societa"><span class="line_wrap"><span class="line"></span>L’Agenzia</span></a></li>
<a class="menu-item-href" href="#societa"><span class="line_wrap"><span class="line"></span>L’Agenzia</span></a>

If i create an external link is the same, the url goes as www.google.com (for example) in the href.

Share Improve this question edited Sep 30, 2017 at 8:26 ro.nin asked Sep 29, 2017 at 16:59 ro.ninro.nin 131 silver badge4 bronze badges 2
  • can you add the html of the header to you question? – David Lee Commented Sep 29, 2017 at 17:31
  • added html line for menu link element – ro.nin Commented Sep 30, 2017 at 8:26
Add a comment  | 

1 Answer 1

Reset to default 0

Resolved, i've manually added the "external" css class to menu link, as suggested here https://github.com/ChrisWojcik/single-page-nav/issues/1

Actually, that didn't work, the problem is still the page wich is intended to be single pag navigation, which is preventink external link from opening, because I think the smooth to-section movement is not coded for managing also external link

本文标签: Menu custom link not working for external site