Support » Fixing WordPress » anchor link not working

  • Resolved happywriter

    (@happywriter)


    Suddenly anchor links not working in any browser, but coding seems okay. It works here where the link is not to a sub-division: https://www.whatiscodependency.com/terms-of-use/ I tried different variations of code:
    <p style="text-align: left; font-size: 14px;"><span style="text-decoration: underline;"><a href="#PERSONAL THERAPY">PERSONAL THERAPY</a></span></p>

    linked to:

    <h2 class="entry-sub-title">span style="color: #ffffff;">PERSONAL THERAPY</span></h2>
    or
    <div class="entry-sub-title"><span style="color: #ffffff;">PERSONAL THERAPY:</span></div>

    Neither work. Thanks for help.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Forum Moderator

    There’s no anchor in your target.

    <h2 class="entry-sub-title"><span style="color: #ffffff;" id="personaltheerapy">PERSONAL THERAPY</span></h2>

    has an anchor (the ID) or you could use an <a> as in

    <h2 class="entry-sub-title">span style="color: #ffffff;"><a name="personaltherapy"></a>PERSONAL THERAPY</span></h2>

    or an ID and a div

    <div id="personaltherapy">PERSONAL THERAPY</div>

    etc. to create the anchor. Then to link to it, you’d use

    <a href="#personalthereapy">Jump to Personal Therapy</a> in your content.

    https://www.wpbeginner.com/beginners-guide/how-to-easily-add-anchor-links-in-wordpress-step-by-step/

    Thread Starter happywriter

    (@happywriter)

    THANK YOU. I tried with the id before but wasn’t sure how to coordinate it with the “entry-sub-title” and the color style. FYI, the h2 target was working perfectly on another WP website I have without any id. So I unsuccessfully tried to copy that here.

    Thanks very much. The id one worked best.
    SHould have contacted you a week ago. Spent hours and hours fiddling with different configurations. Greatly appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘anchor link not working’ is closed to new replies.