<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SofaRider &#187; stripped tags</title>
	<atom:link href="http://rider.sofarider.com/tag/stripped-tags/feed/" rel="self" type="application/rss+xml" />
	<link>http://rider.sofarider.com</link>
	<description>WordPress Themes, Widgets, Development &#124; WEB &#38; Graphic Design</description>
	<lastBuildDate>Wed, 14 Oct 2009 08:40:00 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to fix get_the_content() stripped tags?</title>
		<link>http://rider.sofarider.com/blog/wordpress-tips/how-to-fix-get_the_content-stripped-tags/</link>
		<comments>http://rider.sofarider.com/blog/wordpress-tips/how-to-fix-get_the_content-stripped-tags/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 06:49:04 +0000</pubDate>
		<dc:creator>Feeleep</dc:creator>
				<category><![CDATA[Wordpress Tips]]></category>
		<category><![CDATA[get_the_content()]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[missing tags]]></category>
		<category><![CDATA[stripped tags]]></category>

		<guid isPermaLink="false">http://rider.sofarider.com/?p=293</guid>
		<description><![CDATA[This is the problem I came across recently and I am still not sure whether this is a kind of intentional bug or else because it just looks like so. OK, what exactly happens when you use WordPress get_the_content() function in order to &#8217;save&#8217; Post or Page content into variable? You can do a little [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://rider.sofarider.com/wp-content/uploads/2009/09/1201373442_anus-200x200.jpg" alt="1201373442_anus" title="1201373442_anus" width="200" height="200" class="alignnone size-thumbnail wp-image-294" />This is the problem I came across recently and I am still not sure whether this is a kind of intentional bug or else because it just looks like so. OK, what exactly happens when you use WordPress <strong>get_the_content()</strong> function in order to &#8217;save&#8217; Post or Page content into variable? You can do a little test. Somewhere in your Post details, after <strong>the_content()</strong> function try to add the following code &#8211; just to compare what&#8217;s happening on frontend:</p>
<pre>
<code>
&lt;?php
	the_content(); // this is your standard way to output Post or Page content
	// now the test
	$var_content = get_the_content();
	echo $var_content;
?&gt;
</code>
</pre>
<p>It looks like paragraphs and break rules (&lt;p&gt; and &lt;br /&gt;) are gone. Maybe some other tags too but I have noticed those two. I suppose not so many developers use <strong>get_the_content()</strong> function, however some of my themes (this one too) needs it in order to extract images or documents out of Post/Page content and still keep text formatted. We all know that <strong>the_excerpt()</strong> function will strip down each and every html tag so there&#8217;s no sense in using it, especially not in Post/Page details template.</p>
<h2>Solution</h2>
<p>It&#8217;s true there&#8217;s a solution at codex.wordpress.org but for those who have hard time to find it &#8211; here it is:</p>
<pre>
<code>
&lt;?php
	the_content(); // this is your standard way to output Post or Page content
	// now the test which works
	$var_content = get_the_content();
	$var_content = apply_filters( 'the_content', $var_content );
	$var_content = str_replace( ']]&gt;', ']]&gt;', $var_content );
	echo $var_content;
?&gt;
</code>
</pre>
<p>It should be OK now. Just wanted to pay your attention to this issue since WordPress developer team didn&#8217;t fix it until 2.8.4 &#8211; currently available for download. Maybe next time.</p>
]]></content:encoded>
			<wfw:commentRss>http://rider.sofarider.com/blog/wordpress-tips/how-to-fix-get_the_content-stripped-tags/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
