<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Removing typographic widows in WordPress page titles</title>
	<atom:link href="http://imgiseverything.co.uk/articles/removing-typographic-widows-in-wordpress-page-titles/feed/" rel="self" type="application/rss+xml" />
	<link>http://imgiseverything.co.uk/articles/removing-typographic-widows-in-wordpress-page-titles/</link>
	<description>Manchester web designer Phil Thompson</description>
	<lastBuildDate>Wed, 21 Mar 2012 16:14:26 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Phil Thompson</title>
		<link>http://imgiseverything.co.uk/articles/removing-typographic-widows-in-wordpress-page-titles/#comment-111954</link>
		<dc:creator>Phil Thompson</dc:creator>
		<pubDate>Wed, 23 Dec 2009 20:06:03 +0000</pubDate>
		<guid isPermaLink="false">http://imgiseverything.co.uk/?p=2658#comment-111954</guid>
		<description>Thanks for the code suggestion - James. I didn&#039;t even contemplate using a regex but it does make sense to.

A great addition to your code would be a regex that checked for the last space that comes before each closing block level tags (like p, li, h1-6, etc) which could then be applied to WordPress&#039;s the_content() function and could eliminate widows from the body copy too.</description>
		<content:encoded><![CDATA[<p>Thanks for the code suggestion &#8211; James. I didn&#8217;t even contemplate using a regex but it does make sense to.</p>
<p>A great addition to your code would be a regex that checked for the last space that comes before each closing block level tags (like p, li, h1-6, etc) which could then be applied to WordPress&#8217;s the_content() function and could eliminate widows from the body copy too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://imgiseverything.co.uk/articles/removing-typographic-widows-in-wordpress-page-titles/#comment-111951</link>
		<dc:creator>James</dc:creator>
		<pubDate>Tue, 22 Dec 2009 09:23:44 +0000</pubDate>
		<guid isPermaLink="false">http://imgiseverything.co.uk/?p=2658#comment-111951</guid>
		<description>I would just use a regular expression for this:

preg_replace( &quot;/\s(?=\S+$)/&quot;, &quot;&nbsp;&quot;, $title );

The regular expression:

\s(?=\S+$)

Looks for a space (\s), and then does a look-ahead ( (?=...) ) for a string of non-space characters (\S+) followed by the end-of-string boundary ($). This pattern will only be satisfied by the last space in any string, and so will therefore replace:

&quot;this is a title&quot;

with:
&quot;this is a&#160;title&quot;</description>
		<content:encoded><![CDATA[<p>I would just use a regular expression for this:</p>
<p>preg_replace( &#8220;/\s(?=\S+$)/&#8221;, &#8220;&amp;nbsp;&#8221;, $title );</p>
<p>The regular expression:</p>
<p>\s(?=\S+$)</p>
<p>Looks for a space (\s), and then does a look-ahead ( (?=&#8230;) ) for a string of non-space characters (\S+) followed by the end-of-string boundary ($). This pattern will only be satisfied by the last space in any string, and so will therefore replace:</p>
<p>&#8220;this is a title&#8221;</p>
<p>with:<br />
&#8220;this is a&nbsp;title&#8221;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

