themes - Target Internal Link Of Another Page On Website

In the Edit Menus page, you can select an internal page to link, or an external page.I am building a giant single page w

In the Edit Menus page, you can select an internal page to link, or an external page.

I am building a giant single page where the hyperlinks target internal page headings, for example I have one of my menu elements set to #one that targets <a name="one"></a>on my homepage.

This is all ok whilst the user is on the giant single page. However I will have the last link to the blog. When on the blog I want the user still to be able to click these hyperlinks in the navigation.

I need a way of programming into the menu the following:

internal page id=x #one

If that makes sense? The link has to go to the giant single page and target the section.

In pure html this is what I am looking for:

<a href="www.mywebsite/giant-single-page#one">

The most obvious answer is for me to program these absolute links in, but I'd rather not do this. Is there a way to combine the internal links in the menu with section names?

I have full control of the theme and I can program, so please present to me any solution.

In the Edit Menus page, you can select an internal page to link, or an external page.

I am building a giant single page where the hyperlinks target internal page headings, for example I have one of my menu elements set to #one that targets <a name="one"></a>on my homepage.

This is all ok whilst the user is on the giant single page. However I will have the last link to the blog. When on the blog I want the user still to be able to click these hyperlinks in the navigation.

I need a way of programming into the menu the following:

internal page id=x #one

If that makes sense? The link has to go to the giant single page and target the section.

In pure html this is what I am looking for:

<a href="www.mywebsite/giant-single-page#one">

The most obvious answer is for me to program these absolute links in, but I'd rather not do this. Is there a way to combine the internal links in the menu with section names?

I have full control of the theme and I can program, so please present to me any solution.

Share Improve this question asked Apr 3, 2015 at 9:46 JosephJoseph 1135 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Through some trial and error I found the solution. It's far simpler than I thought.

For example, because my page is the homepage, I use this as my link in the menu:

/#one

As opposed to:

#one

And it works. It doesn't matter what page I am on, once I click that link it takes me to the correct page and then to the correct section.

If you want to target the section of another page, just do the following:

/?page_id=21#four

Of course, this doesn't let you have the flexibility of selecting the page name in the menu customisation page, so you have to know the pages ID for this to work.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744637286a4585220.html

相关推荐

  • themes - Target Internal Link Of Another Page On Website

    In the Edit Menus page, you can select an internal page to link, or an external page.I am building a giant single page w

    1天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信