Always Underline Links in Post Content
Makes links inside posts and pages underlined, so they can be recognised without relying on color alone, as WCAG requires for links in text.
Opens WPIDE on
Code
.entry-content a:not(.wp-block-button__link):not(.wp-element-button),
.wp-block-post-content a:not(.wp-block-button__link):not(.wp-element-button),
.comment-content a {
text-decoration: underline !important;
text-decoration-thickness: max(1px, 0.0625em);
text-underline-offset: 0.15em;
}
.entry-content a:hover,
.wp-block-post-content a:hover,
.comment-content a:hover {
text-decoration-thickness: max(2px, 0.125em);
}
Notes
Buttons styled as links (wp-block-button) are left alone.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.