How to put a line break in a WordPress page, post or widget title

Do you ever need to put a line break in the title of a WordPress page, post or widget title? It can be frustrating because WordPress doesn’t have a way to do it, and strips out HTML if you type a <br> break tag. The solution: create a shortcode that inserts a break tag. Here’s how…

Go to Appearance > Theme Editor. From the drop-down list on the right side, choose functions.php. That’s a file where you can insert custom code and it won’t get overwritten when the theme gets updated. Insert this code:

function line_break_shortcode() {
 return '<br />';
 }
 add_shortcode( 'br', 'line_break_shortcode' );

Click the Update button on bottom to save the file. Now when you want a line break, just type [br].

Share:

Facebook
Twitter
Pinterest
LinkedIn
On Key

Related Posts

Now certified in AI Ethics

Just earned my third AI certification: AI+ Ethics, from AI Certs. Now offering training in ethics issues, including transparency, accountability, privacy, mitigating bias and compliance

Earned another AI certification

I just earned the AI+ Executive certification from AI Certs. This is to assist and train companies in developing AI strategies, governance and risk management,

Get in touch

AI Workshop Inquiry/Booking