Home Forums Weaver Xtreme Theme Anchor Text Not Making The Jump Further Down Same Page

Topic Resolution: Resolved
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #73723
    miamax
    Participant

    I have a table of contents (set up as a list) with anchor links to each section further down the same page.

    I just cannot get them to work. When I publish, WordPress sometimes drops the anchor code, or inserts double quote marks, or drops the list altogether.

    Sometimes the links go nowhere and sometimes they go back to the top of the page.

    What am I doing wrong? Does the anchor link code not like being placed in < p > code? (I’ve tried that.)

    Thanks so much for your help. I have read many pages and watched many videos and cannot get this to work.

    https://www.dwellinthegarden.com/pickfair/

    #73724
    scrambler
    Moderator

    Cant see the list in the page you link to, can you precise where itb is?

    Where are you inserting the HTML?

    If in a page content, make sure you check the Xtreme option “Allow Raw HTML and Script” that will put the editor in text mode and prevent any further formatting from WordPress.

     

    #73725
    Weaver
    Keymaster

    I think you need content inside the anchor id label:

    <a href="#section">Open Section</a> ...
    ...
    <a id="section">SECTION</a>

    You don’t have any content in your id anchor, which I think is the problem.

    #73726
    miamax
    Participant

    I’ve been trying to figure out how to show you code without it just generating a link. How do I do that?

    #73727
    scrambler
    Moderator

    The anchor position does not have to be a link, it can be a paragraph or other things. What matters is the ID

    The below would work just as well

    <a href=”#section”>Open Section</a>

    … …

    <p id=”section”>SECTION</p>

    #73728
    miamax
    Participant

    Here’s the link:

    1919 – From Hunting Lodge to Mansion

    … …

    Which should jump to:

    <b style=”font-size: 28px;”>1919 – From Hunting Lodge to Mansion</b>

     

     

    #73729
    miamax
    Participant

    1919 – From Hunting Lodge to Mansion

     

    I cannot get this code to show, sorry.

    #73730
    miamax
    Participant

    &lt;a href=”#huntinglodge”&gt;1919 – From Hunting Lodge to Mansion&lt;/a&gt;

    #73731
    miamax
    Participant

    I also checked the box for “Allow Raw HTML and scripts.”

     

    Now WordPress has dropped half of the Table of Contents when I publish.

     

    I had a web site where I linked a Table of Contents to different places on the same page and it worked just fine. It is frustrating to not get this to work on this site.

    #73732
    scrambler
    Moderator

    Many issues here.

    First some of your double quotes in the link to anchor HTML are asymetrical quotes rendering the syntax invalid. You need to redo all the quotes to make sure they are straight one.

    Second you are not following the syntax for anchors.

    As we explained, the link to anchor needs to point to an actual ID in the content below.

    Right now you are creating an anchor link like

    <a href="#wherepickfair">Where was Pickfair?</a>

    which points to a tag with an ID #wherepickfair, but there is no such ID in the content. For the link to jump to a place in the content, that content should look like

    <p id="wherepickfair"> Your content </p>

    And ALL the double quotes in both the link and the paragraph ID must be straight ones !!

    Finally, If you want to post code, you must use the Preformatted paragraph format from the post toolbar (like I did above)

    And run your HTML through an Online HTML validation tool like below to make sure you have no syntax error, because I believe some of your bold tags are not closed causing everything to be bold

    The W3C Markup Validation Service

     

    #73733
    miamax
    Participant

    I don’t have double quotes on the post in edit mode. That happens when I publish — WordPress adds those extra quotes.

    I change them to straight and they change to asymmetrical.

    I have the link to the anchor pointing to an actual ID in the content further down the page. I swear I do. WordPress is dropping random text, adding asymmetrical quotes, dropping some of the Table of Contents, and generally annoying me.

    I do have the box checked to Allow Raw HTML.

    I just changed all the quotes (again) and, fingers crossed, things seem to be holding for whatever reason. Thank you for helping me with this.

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