WordPress: Add A Hint About How Line Breaks Work In The Editor

<?php function add_hint() { $tip = '<strong>TIP:</strong> To create a single line break use SHIFT+RETURN. By default, RETURN creates a new paragraph.'; echo '<p style="margin-bottom:0;">'.$tip.'</p>'; } add_action( 'edit_form_after_title', 'add_hint' ); ?>
Add the following snippet to your functions.php file. Change the value of $tip to say whatever you want to remind your authors of.

This technique could be used to inject a reminder about anything you want authors to remember when adding or editing content.

Original source: https://www.smashingmagazine.com/2016/07/how-to-make-wordpress-easy-to-maintain-for-your-clients/

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.