WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Hash Tag in Permalink (4 posts)

  1. SGHB
    Member
    Posted 2 years ago #

    Is there any way I can use a hash tag in a permalink, like:

    http://blahblah.co.uk/#thing

    I've tried and it never keeps the tag in once saved

    I need it so I can link to an anchor on the same page

    Thanks

  2. theotherlebowski
    Member
    Posted 2 years ago #

    hastags are html special entities and they have special codes to help you display them in places where the actual sign has a specific coding function.

    you can add entities to URLs in html (hashtag is %23, see here for html entities reference ) but i don't know if it works in permalinks... there are certain server side issues to be taken into consideration with URLs generated in blogs and CMS's

  3. theotherlebowski
    Member
    Posted 2 years ago #

    or are you trying to create a linkable table of contents? if so then you create the anchor point on the element you want to jump down to, ie:

    <h1 id="anchor_id">section heading</h1>

    and then in the link text you want people to click to jump put:

    <a href="#anchor_id">clickable text</a>

  4. SGHB
    Member
    Posted 2 years ago #

    All I'm trying to do is:

    Create a page, say Video Gallery

    That will then go in the nav-bar

    The permalink should be

    http://cinemageek.co.uk/#video

    Which will link to an anchor on the main page

    I tried the %23 and it worked except a forward slash is also added after

    Like so, http://cinemageek.co.uk/#video/

    Which, unfortunately, is not what I want, but I can't see anyway of getting rid of the /

    Oh well, a gif will have to do!

    ;)

    Thanks for the help!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags