BACK TO DIRECTORY

WP Anchor Header

by Per Søderlind

4.3
(6 ratings)

WP Anchor Header generates anchored headings (H1-H6), creating a heading like this:

<h2 id="the-heading">
   The Heading<a class="anchorlink dashicons-before" href="#the-heading"></a>
</h2>

The links are styled using the following CSS:

/* show IDs for anchors */
h1[id]:hover a.anchorlink:before,
h2[id]:hover a.anchorlink:before,
h3[id]:hover a.anchorlink:before,
h4[id]:hover a.anchorlink:before,
h5[id]:hover a.anchorlink:before,
h6[id]:hover a.anchorlink:before {
    content: "\f103"; /*dashicons-admin-links*/
    color: #888;
    font-size: smaller;
    text-decoration: none;
    vertical-align: baseline;
}
a.anchorlink {
    text-decoration: none;
    margin-left: 0.5em;
    font-size: smaller;
}

Credits

The plugin is inspired by Christian Weiske and his article Usability: Clickable heading links.

Plugin Details

Active Installs
300
Total Downloads
10,866
Version
0.3.1
Requires WP
6.5
Requires PHP
7.2
Tested Up To
7.1
Added
2015-03-02
Last Updated
2026-08-13 8:22am GMT

Ratings

5
5
4
0
3
0
2
0
1
1