Archived topic
Underline link in Wordpress editor
5 replies · Started by William on July 22, 2022
Hello -
I am not using a child theme. Is there a way to get the underlines of my hyperlinks to show up on the backend inside the Wordpress editor?
Thank you.
Hi there,
with the Code Snippets plugin, try adding this snippet:
add_filter( 'block_editor_settings_all', function( $editor_settings ) {
$css = '.wp-block a {
text-decoration: underline;
text-underline-offset: 5px;
text-decoration-thickness: 2px;
text-decoration-color: #101010;
font-weight: 700;
}';
$editor_settings['styles'][] = array( 'css' => $css );
return $editor_settings;
} );
Hi David -
Thanks very much for the help here. I installed the code snippets plugin and added that function. Unfortunately, still no underline on the backend.
Here is my code for the hyperlinks if that's helpful:
.entry-content p a,
.entry-content h2 a,
.entry-content h3 a{
text-decoration: underline;
text-underline-offset: 5px;
text-decoration-thickness: 2px;
text-decoration-color: #101010;
font-weight: 700;
}
Try the updated code above:
https://generatepress.com/forums/topic/underline-link-in-wordpress-editor/#post-2291194
David thank you so much! Stellar support as always.
Glad to be of help!