<?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: Fixing &#8220;Read More&#8221; Links in WordPress</title>
	<atom:link href="http://nslog.com/2006/11/13/fixing_read_more_links_in_wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://nslog.com/2006/11/13/fixing_read_more_links_in_wordpress</link>
	<description>The Weblog of Erik J. Barzeski</description>
	<lastBuildDate>Wed, 23 May 2012 23:05:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: leon</title>
		<link>http://nslog.com/2006/11/13/fixing_read_more_links_in_wordpress#comment-67994</link>
		<dc:creator>leon</dc:creator>
		<pubDate>Fri, 02 Sep 2011 05:34:58 +0000</pubDate>
		<guid isPermaLink="false">http://nslog.com/2006/11/13/fixing_read_more_links_in_wordpress/#comment-67994</guid>
		<description>I was reading some questions like this and the best answer I got was that wordpress has to put the more in its own element so there is no way to have it on the same line. However I discovered that if you don&#039;t tag your paragraphs with a  in the html of the admin post section wordpress adds them for you. It may be auto matic or because I have the setting&gt;General&gt;WordPress should correct invalidly nested XHTML automatically box checked any way I do this and just put the more tag at the end of the sentence that I want it and word press nests them together.</description>
		<content:encoded><![CDATA[<p>I was reading some questions like this and the best answer I got was that wordpress has to put the more in its own element so there is no way to have it on the same line. However I discovered that if you don't tag your paragraphs with a  in the html of the admin post section wordpress adds them for you. It may be auto matic or because I have the setting&gt;General&gt;WordPress should correct invalidly nested XHTML automatically box checked any way I do this and just put the more tag at the end of the sentence that I want it and word press nests them together.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BetterWPReadMore 0.1 and BetterWPMail 0.11 &#124; NSLog();</title>
		<link>http://nslog.com/2006/11/13/fixing_read_more_links_in_wordpress#comment-23153</link>
		<dc:creator>BetterWPReadMore 0.1 and BetterWPMail 0.11 &#124; NSLog();</dc:creator>
		<pubDate>Wed, 15 Nov 2006 00:37:39 +0000</pubDate>
		<guid isPermaLink="false">http://nslog.com/2006/11/13/fixing_read_more_links_in_wordpress/#comment-23153</guid>
		<description>[...] A day after complaining about the way WordPress handles &quot;read more&quot; links, I&#039;ve cobbled together a plugin I&#039;ve named &quot;BetterWPReadMore.&quot; It&#039;s available from a modified &quot;Plugins&quot; tab at the top of every page. [...]</description>
		<content:encoded><![CDATA[<p>[...] A day after complaining about the way WordPress handles "read more" links, I've cobbled together a plugin I've named "BetterWPReadMore." It's available from a modified "Plugins" tab at the top of every page. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik J. Barzeski</title>
		<link>http://nslog.com/2006/11/13/fixing_read_more_links_in_wordpress#comment-23151</link>
		<dc:creator>Erik J. Barzeski</dc:creator>
		<pubDate>Wed, 15 Nov 2006 00:32:53 +0000</pubDate>
		<guid isPermaLink="false">http://nslog.com/2006/11/13/fixing_read_more_links_in_wordpress/#comment-23151</guid>
		<description>[quote comment=&quot;23091&quot;]I&#039;ve made a plugin that removes (most of) the line breaks, though, so that&#039;s a start.[/quote]

Turns out I was able to hack around enough and get a plugin that works on my system, at least. I&#039;ve released it as a version 0.1 plugin named &lt;a href=&quot;http://nslog.com/plugins/betterwpreadmore/&quot;&gt;BetterWPReadMore&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p class="quote_header"><a  href="http://nslog.com/2006/11/13/fixing_read_more_links_in_wordpress#comment-23091">Erik J. Barzeski said</a> on November 14, 2006:</p>
<blockquote cite="http://nslog.com/2006/11/13/fixing_read_more_links_in_wordpress#comment-23091"><p>
I've made a plugin that removes (most of) the line breaks, though, so that's a start.</p>
</blockquote>
<p>Turns out I was able to hack around enough and get a plugin that works on my system, at least. I've released it as a version 0.1 plugin named <a  href="http://nslog.com/plugins/betterwpreadmore/">BetterWPReadMore</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik J. Barzeski</title>
		<link>http://nslog.com/2006/11/13/fixing_read_more_links_in_wordpress#comment-23091</link>
		<dc:creator>Erik J. Barzeski</dc:creator>
		<pubDate>Tue, 14 Nov 2006 16:17:24 +0000</pubDate>
		<guid isPermaLink="false">http://nslog.com/2006/11/13/fixing_read_more_links_in_wordpress/#comment-23091</guid>
		<description>[quote comment=&quot;23042&quot;]The way to fix this (so that a WP-upgrade doesn&#039;t undo your work) is to use the WP filter system.[/quote]

Only some of this can be done via a plugin. Variables like $more_link_text are never in scope, so I have no way to easily determine the link&#039;s text (&lt;code&gt;&lt;a href=&quot;http://permalink&quot;&gt;&lt;/p&gt;&lt;p class=&quot;readmorelink&quot;&gt;Read More&lt;/a&gt;&lt;/code&gt;), so I have no way to search for that string and replace it. I could probably do so with preg_replace, but that approach seems quite easily broken since $more_link_text can contain HTML.

I&#039;ve made a plugin that removes (most of) the line breaks, though, so that&#039;s a start.</description>
		<content:encoded><![CDATA[<p class="quote_header"><a  href="http://nslog.com/2006/11/13/fixing_read_more_links_in_wordpress#comment-23042">Mark Jaquith said</a> on November 14, 2006:</p>
<blockquote cite="http://nslog.com/2006/11/13/fixing_read_more_links_in_wordpress#comment-23042"><p>
The way to fix this (so that a WP-upgrade doesn't undo your work) is to use the WP filter system.</p>
</blockquote>
<p>Only some of this can be done via a plugin. Variables like $more_link_text are never in scope, so I have no way to easily determine the link's text (<code>&lt;a href="http://permalink"&gt;&lt;/p&gt;&lt;p class="readmorelink"&gt;Read More&lt;/a&gt;</code>), so I have no way to search for that string and replace it. I could probably do so with preg_replace, but that approach seems quite easily broken since $more_link_text can contain HTML.</p>
<p>I've made a plugin that removes (most of) the line breaks, though, so that's a start.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Jaquith</title>
		<link>http://nslog.com/2006/11/13/fixing_read_more_links_in_wordpress#comment-23042</link>
		<dc:creator>Mark Jaquith</dc:creator>
		<pubDate>Tue, 14 Nov 2006 06:08:30 +0000</pubDate>
		<guid isPermaLink="false">http://nslog.com/2006/11/13/fixing_read_more_links_in_wordpress/#comment-23042</guid>
		<description>The way to fix this (so that a WP-upgrade doesn&#039;t undo your work) is to use the WP filter system.

&lt;code&gt;add_filter(&#039;the_content&#039;, &#039;nslog_read_more&#039;, 7);&lt;/code&gt;

You can see where filters registered to &lt;code&gt;the_content&lt;/code&gt; are applied by looking for the &lt;code&gt;apply_filters();&lt;/code&gt; call for &lt;code&gt;the_content&lt;/code&gt;  Note that the name &lt;code&gt;the_content&lt;/code&gt; is meant to correspond to &lt;code&gt;the_content()&lt;/code&gt; but that doesn&#039;t mean that every function automatically has a filter.

I have a quasi-documented list of filters &lt;a href=&quot;http://wphooks.flatearth.org/&quot;&gt;here&lt;/a&gt;.

The &lt;code&gt;nslog_read_more()&lt;/code&gt; function should take a string input (it&#039;ll get the content of the post) and should return that content (after modification, of course).

The third param (7) is a &lt;em&gt;priority&lt;/em&gt; for the filter.  Default priority is 10.  I&#039;ve set this to 7 because at 10, &lt;code&gt;wpautop()&lt;/code&gt; kicks in.  So for the &lt;code&gt;preg_replace()&lt;/code&gt; calls in &lt;code&gt;nslog_read_more()&lt;/code&gt;, you&#039;ll be dealing with linebreaks, not paragraph/break tags.  If you &lt;em&gt;wanted&lt;/em&gt; to deal with the HTML, you could hook in using a priority of 11.</description>
		<content:encoded><![CDATA[<p>The way to fix this (so that a WP-upgrade doesn't undo your work) is to use the WP filter system.</p>
<p><code>add_filter('the_content', 'nslog_read_more', 7);</code></p>
<p>You can see where filters registered to <code>the_content</code> are applied by looking for the <code>apply_filters();</code> call for <code>the_content</code>  Note that the name <code>the_content</code> is meant to correspond to <code>the_content()</code> but that doesn't mean that every function automatically has a filter.</p>
<p>I have a quasi-documented list of filters <a  href="http://wphooks.flatearth.org/">here</a>.</p>
<p>The <code>nslog_read_more()</code> function should take a string input (it'll get the content of the post) and should return that content (after modification, of course).</p>
<p>The third param (7) is a <em>priority</em> for the filter.  Default priority is 10.  I've set this to 7 because at 10, <code>wpautop()</code> kicks in.  So for the <code>preg_replace()</code> calls in <code>nslog_read_more()</code>, you'll be dealing with linebreaks, not paragraph/break tags.  If you <em>wanted</em> to deal with the HTML, you could hook in using a priority of 11.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik J. Barzeski</title>
		<link>http://nslog.com/2006/11/13/fixing_read_more_links_in_wordpress#comment-23009</link>
		<dc:creator>Erik J. Barzeski</dc:creator>
		<pubDate>Mon, 13 Nov 2006 22:55:38 +0000</pubDate>
		<guid isPermaLink="false">http://nslog.com/2006/11/13/fixing_read_more_links_in_wordpress/#comment-23009</guid>
		<description>Submitted to &lt;a href=&quot;http://trac.wordpress.org/ticket/3359&quot;&gt;the WordPress trac system&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Submitted to <a  href="http://trac.wordpress.org/ticket/3359">the WordPress trac system</a>.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

