<?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>Stoat - Where? &#187; Theme</title>
	<atom:link href="http://jamietalbot.com/tag/theme/feed/" rel="self" type="application/rss+xml" />
	<link>http://jamietalbot.com</link>
	<description>Adventures in Engrish</description>
	<lastBuildDate>Thu, 26 Aug 2010 23:02:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Fixing Mystique for Backtype Connect</title>
		<link>http://jamietalbot.com/2010/02/06/fixing-mystique-for-backtype-connect/</link>
		<comments>http://jamietalbot.com/2010/02/06/fixing-mystique-for-backtype-connect/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 02:59:25 +0000</pubDate>
		<dc:creator>Jamie Talbot</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Backtype Connect]]></category>
		<category><![CDATA[Mystique]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Theme]]></category>

		<guid isPermaLink="false">http://jamietalbot.com/?p=48</guid>
		<description><![CDATA[Using the Mystique WordPress theme with the Backtype Connect plugin causes posts to stop rendering halfway through.  Luckily, the fix is relatively straightforward.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing around with WordPress themes and plugins and one that caught my eye was <a href="http://www.backtype.com/connect">Backtype Connect</a>, which aggregates discussions from around the web and places them as comments onto the original post.  Unfortunately it wasn&#8217;t playing nicely with the <a href="http://digitalnature.ro/projects/mystique/">Mystique</a> theme I&#8217;m currently using, with no comments showing and the sidebar not appearing on posts where there was a backtype comment.</p>
<p>It turned out to be a minor error in the Mystique theme, which deals with how CSS classes are assigned to the sections that display the comments.  Mystique has the following lines of code at the bottom of its  <code>mystique_comment_class function</code>:</p>
<pre class="brush: php;">
$class = join(&quot; &quot;, $classes);
echo apply_filters(&quot;comment_class&quot;, $class);
</pre>
<p>Mystique is trying to do the right thing here, by allowing plugins to manipulate the classes with the &#8216;comment_class&#8217; hook, just like WordPress&#8217; own function.  However, the code is turning the $classes array into a $class string and passing that to the plugins.  Backtype Connect (and presumably other plugins) expect those classes to be passed as an array leading to the following error:</p>
<pre class="brush: php;">
Fatal error: [] operator not supported for strings
</pre>
<p>However, because this error occurs within an HTML tag it isn&#8217;t rendered correctly, which means it is hard to spot.  Nevertheless, it causes PHP to stop executing immediately, leading to half-rendered pages.</p>
<p>Luckily, the fix is simple.  Simply join the array after the filter has been called and everything works well.  Future revisions of the theme will probably fix this, but in the meantime, you can use the WordPress plugin editor to replace the two lines above in <code>mystique/lib/core.php</code> with the following:</p>
<pre class="brush: php;">
$classes = apply_filters(&quot;comment_class&quot;, $classes);
echo implode(&quot; &quot;, $classes);
</pre>
<p>And they should live together in harmony.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamietalbot.com/2010/02/06/fixing-mystique-for-backtype-connect/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
