Archived topic
Underline the links inside the wordpress editor
2 replies · Started by Hilton on July 12, 2021
I would like to know how I can do to underline the links inside the wordpress editor because the underline is just showing up on the frontend of the site.
Wordpress admin: https://prnt.sc/1anaczv
Frontend: https://prnt.sc/1anakj8
This is the page https://bit.ly/3yOSqNn
Just to complement, I added this function to my child theme functions.php
function customAdminCSS() {
$url = get_settings('siteurl');
$url = $url . '/wp-content/themes/YOUR-CHILD-THEME/wp-admin.css';
echo '<!-- custom admin css -->
<link rel="stylesheet" type="text/css" href="' . $url . '" />
<!-- /end custom adming css -->';
}
add_action('admin_head', 'customAdminCSS');
and created a file named wp-admin.css with this code
div[class^="block-editor"] .editor-styles-wrapper a {
text-decoration: underline;
}
It seems to be working, I just don't know if it is the best alternative.
Hi there,
The best practice to go with this is by creating your own editor-styles.css and add it in.
Here's the PHP snippet to set it up. https://generatepress.com/forums/topic/how-to-call-editor-style-css-from-child-theme/#post-149083
Within this file is where you set CSS like the one you mentioned. :D