Home › Forums › Weaver Xtreme Theme › Anchor Text Not Making The Jump Further Down Same Page
- This topic has 10 replies, 3 voices, and was last updated 2 years, 8 months ago by
miamax.
-
AuthorPosts
-
December 13, 2023 at 15:28 UTC - Views: 70 #73723
miamax
ParticipantI 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.
December 13, 2023 at 16:10 UTC - Views: 68 #73724scrambler
ModeratorCant 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.
December 13, 2023 at 17:24 UTC - Views: 61 #73725Weaver
KeymasterI 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.
December 13, 2023 at 22:36 UTC - Views: 51 #73726miamax
ParticipantI’ve been trying to figure out how to show you code without it just generating a link. How do I do that?
December 14, 2023 at 01:14 UTC - Views: 50 #73727scrambler
ModeratorThe 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>
December 14, 2023 at 16:58 UTC - Views: 44 #73728miamax
ParticipantHere’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>
December 14, 2023 at 17:05 UTC - Views: 39 #73729miamax
ParticipantDecember 14, 2023 at 17:10 UTC - Views: 37 #73730miamax
Participant<a href=”#huntinglodge”>1919 – From Hunting Lodge to Mansion</a>
December 14, 2023 at 17:16 UTC - Views: 31 #73731miamax
ParticipantI 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.
December 14, 2023 at 19:08 UTC - Views: 26 #73732scrambler
ModeratorMany 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
December 14, 2023 at 22:05 UTC - Views: 21 #73733miamax
ParticipantI 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.
-
AuthorPosts
- You must be logged in to reply to this topic.

