WordPress.org

Ready to get started?Download WordPress

Forums

Referencing Anchors/Linking to sections of a seperate post (3 posts)

  1. ZooLooK
    Member
    Posted 8 years ago #

    Hello!

    I'm wondering if anyone has managed to create something that allows you to make references to anchors from other posts thus allowing you to link to a specific paragraph of a post externally. I don't know if there is a buzz-word for this so sorry if this explanation seems long-winded.

    For example I would like to link to specific parts of a post (e.g. a diagram) from another page. In regular HTML of course all I would have to do is include an anchor and make reference to it in the URL but this grows a more complicated task when considering page-slugs/url-rewriting.

    Any ideas appreciated,

    James

  2. schestowitz
    Member
    Posted 8 years ago #

    I know of a so-called footnote 'plug-in'* that is doing something similar, but here is my recommendation:

    In the post that you write, add for example

    BRACKET_LEFTaBRACKET_RIGHTCaption: Figure 1BRACKET_LEFT/aBRACKET_RIGHT

    Then, having labelled the figure, you can link to that caption/<IMG> (deeper page linking). Assuming the page is at /index.php?p=1

    BRACKET_LEFTa href="/index.php?p=1#fig_1"BRACKET_RIGHTFigure 1BRACKET_LEFT/aBRACKET_RIGHT

    (*)It does something so simple, so can barely be labeled a plug-ins

    Replace BRACKET_RIGHT with >
    Replace BRACKET_LEFT with <

    The forum software is trying to 'help' me.

    ---

    Edit: thanks moshu

    <a href="/index.php?p=1#fig_1">Figure 1</a>

    <a name="fig_1">Caption: Figure 1</a>

    I think "id" instead of "name" should work too.

  3. moshu
    Member
    Posted 8 years ago #

    @schestowitz
    you just have to read the instructions below the text input area... put code in backticks = the little things that are usually on the same key as ~ [tilde]
    e.g.
    <a>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags