Community Forums › Forums › Archived Forums › General Discussion › How can I force a line break in a widget title?
- This topic has 15 replies, 3 voices, and was last updated 9 years, 3 months ago by
Summer.
-
AuthorPosts
-
February 10, 2014 at 8:14 pm #89725
pcgs51
MemberIs there a way to force a line break in a widget title because neither <br> or <br /> work. Once a widget is saved the <br> goes away.
Thanks,
pcgs51February 11, 2014 at 3:52 am #89753Davinder Singh Kainth
MemberYou can check the option to add paragraphs at bottom of widget. It should keep the layout intact. Other options are using:
<p> </p>
or
<br> </br>
Sunshine PRO genesis theme
Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis ThemesFebruary 11, 2014 at 6:54 am #89775Davinder Singh Kainth
MemberAlso try this - http://bit.ly/1elZnnL
Sunshine PRO genesis theme
Need Genesis help? Davinder @ iGuiding Media | My Blog | Fresh Genesis ThemesFebruary 11, 2014 at 5:53 pm #89881pcgs51
MemberThanks Davinder, I've tried them all and can officially tell you that none of them work. Checking on the add paragraphs box does nothing. Also, I added that last script above to my functions.php and it broke my site entirely.
My question stands but let me rephrase this: Does anyone know of a way to do this? Have you done it before? I'm using a current version of Genesis and the Epik theme.
Thanks,
pcgs51February 11, 2014 at 7:20 pm #89882Summer
MemberGIven how sparse the search results are on this, my guess is not a lot of people have tried it.
Does using the CR/LF html codes work, instead of
? For some reason, it won't display the HTML code for the characters here, but you can find them here: http://code.cside.com/3rdpage/us/newLine.htmlThat said, I haven't tried this myself, but I found this in the wordpress.org support forums:
add_filter ( 'widget_title' , 'my_widget_title' , 10 , 3 ) ; function my_widget_title ( $title ) { $title = str_replace ( "[br]" , "<br/>" , $title ) ; return $title ; }
from http://macadamcodeboys.com/2012/12/20/wordpress-des-retours-a-la-ligne-dans-les-widgets/
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkFebruary 11, 2014 at 7:26 pm #89883Summer
MemberThat's weird... my post went away... Let's try again.
GIven how sparse the search results are on this, my guess is not a lot of people have tried it.
Does using the CR/LF html codes work, instead of
? For some reason, it won't display the HTML code for those characters here, but you can find them here: http://code.cside.com/3rdpage/us/newLine.htmlThat said, I haven't tried this myself, but I found this in the wordpress.org support forums:
add_filter ( 'widget_title' , 'my_widget_title' , 10 , 3 ) ; function my_widget_title ( $title ) { $title = str_replace ( "[br]" , "<br/>" , $title ) ; return $title ; }
from http://macadamcodeboys.com/2012/12/20/wordpress-des-retours-a-la-ligne-dans-les-widgets/
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkFebruary 11, 2014 at 7:27 pm #89884Summer
MemberHm. Not sure why the forum published my post the first time, and destroyed it on the edit. Maybe it doesn't like me posting multiple links?
Hopefully a moderator can fix my posts, so the potential for a solution can be found here.
If not, do a Google search for "wordpress line break in widget title" and look at the first wordpress.org forums link, and follow the link to a French site for a shortcode replacement solution
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkFebruary 11, 2014 at 7:30 pm #89885Summer
MemberOne more time.
Instead of trying to use
<br>
in the title, have you tried using the HTML codes for CR or LF? Since the forum won't let me post the characters, you can find them here: http://code.cside.com/3rdpage/us/newLine.htmlIf that doesn't work, try the solution offered up here, replacing the HTML break with a shortcode: http://macadamcodeboys.com/2012/12/20/wordpress-des-retours-a-la-ligne-dans-les-widgets/
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkFebruary 11, 2014 at 7:35 pm #89888pcgs51
MemberVery strange that your post doesn't show up but I did see your message, Summer.
Your coding suggestion also causes the white screen of death.
Thanks,
pcgs51February 11, 2014 at 7:35 pm #89889Summer
MemberThis is ridiculous. Not sure why the forum published my post the first time, and destroyed it on the edit. Maybe it doesn't like me posting multiple links? It's happened three times now.
Hopefully a moderator can fix my posts, so the potential for a solution can be found here.
If not, do a Google search for "wordpress line break in widget title" and look at the first wordpress.org forums link, and follow the link to a French site for a shortcode replacement solution
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkFebruary 11, 2014 at 7:37 pm #89890pcgs51
MemberNote to moderator: There is a person attempting to post to this thread but her replies keeps getting deleted. Her name is Summer.
Thanks,
pcgs51February 11, 2014 at 8:35 pm #89898Summer
MemberThat's strange about the filter not working... I added it to a test site I have running News Pro, and it worked just fine.
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkFebruary 11, 2014 at 8:38 pm #89899Summer
MemberLet's see if me just putting the code here works:
add_filter('widget_title','my_widget_title',10,3); function my_widget_title($title) { $title = str_replace("[br]", "<br/>", $title); return $title; }
Adding this filter to functions.php, then using the shortcode
[br]
in the title of the widget did work for me, using News Pro, Genesis 2.0.2 and WP 3.8.1. Site is running PHP 5.4
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkFebruary 11, 2014 at 8:44 pm #89901Summer
MemberJust uploaded Epik to my test site and tried it, and it does work there, too.
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkFebruary 11, 2014 at 9:09 pm #89904pcgs51
MemberThat worked! Thanks for hanging in there and helping out Summer! I actually was asking this on behalf of a friend in a different forum.
Thanks,
pcgs51February 11, 2014 at 10:08 pm #89912Summer
MemberGlad we worked around the forum glitches 🙂
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After Dark -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.