- This topic is empty.
-
AuthorPosts
-
October 26, 2009 at 5:46 pm #26558TeMcMember
Hi folks
with functions such as the following:
Code:function widowKiller($text) {
$return = $text;
$arr = explode(‘ ‘,$text);
$arr[count($arr) – 2].= ‘ ‘.$arr[count($arr) – 1];
array_pop($arr);
$return = implode(‘ ‘,$arr);
return $return;
}function widowKilledTitle() {
global $post; $text = the_title(”,”,false);
$return = $text;
$arr = explode(‘ ‘,$text);
$arr[count($arr) – 2].= ‘ ‘.$arr[count($arr) – 1];
array_pop($arr);
$return = implode(‘ ‘,$arr);
echo $return;
}… it’s possible to make sure there’s no single word on the next line.
Here at CSS-Tricks it has been discussed before:- http://css-tricks.com/preventing-widows-in-post-titles/[/*:m]
- http://css-tricks.com/snippets/jquery/add-non-breaking-space-on-title-to-prevent-widows/[/*:m]
- http://css-tricks.com/snippets/php/append-non-breaking-space-between-last-two-words/[/*:m][/list:u]
However, today I was browsing Digging into WordPress, specificly this post:
Will This Work With WordPress?!?!
… and I noticed that the "!?!" wrapped to the next line. Kind of like a widow, isn’t it ?
[img]http://img524.imageshack.us/img524/3365/afbeelding1lj.png[/img]What can we do about this ?
Is it (easily) fixable ?—
TeMc
October 26, 2009 at 6:08 pm #65923Chris CoyierKeymasterThat’s strange the post title looks like that for you. To me it breaks between Work and With.
I’m using this in WordPress now:
http://www.shauninman.com/archive/2007/ … ess_pluginDoes one thing and does it well.
October 29, 2009 at 11:34 am #66010TeMcMemberIndeed strange…
I think it’s because php adds between last two (space-seperated) words. And it does, but maybe Safari 4 defines a "word" differently and thus splits the title at the "!?" and there’s nothing between ! and ? that makes them have to stick together.
I’ve revisited that page ( http://digwp.com/2009/08/will-this-work-with-wordpress/ ), but it still does the same thing for me on a Leopard Mac with latest Safari 4.
—
Tem C.PS: I’ve tried Firefox (3.5) aswell, and was suprised that in there it didn’t wrap at !? but like you said, between Work and With.
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.