Sign in

How to use anchor links from theme settings?

  • This topic has 5 replies, 2 voices, and was last updated 7 months, 3 weeks ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #9203
    Avatar photoGyges

    That is, I would like to mark text in a post as anchor and link to this position it from text in the theme settings.

    #9290
    Avatar photocandidexmedia

    Hi! What do you mean by linking to the anchor in the theme settings?

    Typically, to create an anchor, you would add an ID to the markup of the text. Here’s an example for the webpage http://www.mysite.com/page:

    <p>This is my text. Here's my <span id="the-id">anchor</span>. Hope you like it!</p>

    Then, to create an anchor link, you would add a reference to that webpage, follow by a slash, # and the ID:

    <p>Here is my anchor. Hope it works!</p>

     

    #9327
    Avatar photoGyges

    I mean a link from the frontpage’s hero section to a certain position on a certain page, namely a certain meal with a h4 heading.

    With your method, this is what I get:

    • 16 – YAKI-TORI
      4,50 €
      2 STK – Japanische Hühnchenspieße mit Teriyaki Sauce
    • anchor class=”uKXCDd”>17 – Satay Gay
      4,50 €
      2 STK – Thailändische Hühnchenspieße mit Erdnuss Sauce
    #9329
    Avatar photocandidexmedia

    You need to use an ID inside your H4, not a class. Anchors only work with IDs.

    #9331
    Avatar photoGyges

    The anchor class has the same identifier than the headings’ and got created automatically upon saving, maybe due to the span tag.

    I tried without span tag and now it works:

    <h4 id=”satay-gay” class=”uKXCDd”>17 – Satay Gay</h4>

    Thanks for your help!

    #9336
    Avatar photocandidexmedia

    Yes, I should have specified: the ID should be added to whatever HTML tag you want to reference to. Could be a p tag, a heading, a div, etc.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.