<?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: Smarter Cleaner&#160;Gallery</title>
	<atom:link href="http://konstruktors.com/blog/wordpress/1899-smarter-cleaner-gallery/feed/" rel="self" type="application/rss+xml" />
	<link>http://konstruktors.com/blog/wordpress/1899-smarter-cleaner-gallery/</link>
	<description>Web Design, WordPress and Performance Services</description>
	<lastBuildDate>Wed, 01 Feb 2012 16:50:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-19894</generator>
	<item>
		<title>By: Kaspars</title>
		<link>http://konstruktors.com/blog/wordpress/1899-smarter-cleaner-gallery/#comment-1152</link>
		<dc:creator>Kaspars</dc:creator>
		<pubDate>Thu, 14 Jan 2010 16:59:26 +0000</pubDate>
		<guid isPermaLink="false">http://konstruktors.com/blog/?p=1899#comment-1152</guid>
		<description>&lt;a href=&quot;#comment-11335&quot; rel=&quot;nofollow&quot;&gt;Frank&lt;/a&gt;, the only problem I see with this approach is that it doesn&#039;t work with custom DB queries (when using &lt;code&gt;query_posts();&lt;/code&gt;).</description>
		<content:encoded><![CDATA[<p><a href="#comment-11335" rel="nofollow">Frank</a>, the only problem I see with this approach is that it doesn&#8217;t work with custom DB queries (when using <code>query_posts();</code>).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank</title>
		<link>http://konstruktors.com/blog/wordpress/1899-smarter-cleaner-gallery/#comment-1151</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Thu, 14 Jan 2010 15:21:11 +0000</pubDate>
		<guid isPermaLink="false">http://konstruktors.com/blog/?p=1899#comment-1151</guid>
		<description>I think it better, when you parse before triggered wp_head; maybe this one:

&lt;pre&gt;add_action(&#039;the_posts&#039;, &#039;cleaner_gallery_head&#039;, 0);
function cleaner_gallery_head($posts) {
	if (empty($posts))
		return $posts;

	$found = false;

	foreach ($posts as $post) {
		if (stripos($post-&gt;post_content, &#039;[gallery&#039;))
			$found = true;
	}

	if ($found)
		wp_enqueue_style( &#039;cleaner-gallery&#039;, CLEANER_GALLERY_URL . &#039;/cleaner-gallery.css&#039;, false, 0.7, &#039;all&#039; );

	return $posts;
}&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>I think it better, when you parse before triggered wp_head; maybe this one:</p>
<pre>add_action('the_posts', 'cleaner_gallery_head', 0);
function cleaner_gallery_head($posts) {
	if (empty($posts))
		return $posts;

	$found = false;

	foreach ($posts as $post) {
		if (stripos($post->post_content, '[gallery'))
			$found = true;
	}

	if ($found)
		wp_enqueue_style( 'cleaner-gallery', CLEANER_GALLERY_URL . '/cleaner-gallery.css', false, 0.7, 'all' );

	return $posts;
}</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaspars</title>
		<link>http://konstruktors.com/blog/wordpress/1899-smarter-cleaner-gallery/#comment-1150</link>
		<dc:creator>Kaspars</dc:creator>
		<pubDate>Thu, 14 Jan 2010 11:11:42 +0000</pubDate>
		<guid isPermaLink="false">http://konstruktors.com/blog/?p=1899#comment-1150</guid>
		<description>I have decided that, just like &lt;a href=&quot;#comment-11330&quot; rel=&quot;nofollow&quot;&gt;Ryan&lt;/a&gt; said, galleries are a core WordPress feature and their CSS should be provided by the theme. There is no easy way to tell what content is to be loaded for any particular view because of the way WordPress themes are constructed, especially in case of custom database queries.

If your theme sticks to the standard loop, the best solution is to use &lt;a href=&quot;http://beerpla.net/2010/01/13/wordpress-plugin-development-how-to-include-css-and-javascript-conditionally-and-only-when-needed-by-the-posts/&quot; rel=&quot;nofollow&quot;&gt;Artem&#039;s solution&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>I have decided that, just like <a href="#comment-11330" rel="nofollow">Ryan</a> said, galleries are a core WordPress feature and their CSS should be provided by the theme. There is no easy way to tell what content is to be loaded for any particular view because of the way WordPress themes are constructed, especially in case of custom database queries.</p>
<p>If your theme sticks to the standard loop, the best solution is to use <a href="http://beerpla.net/2010/01/13/wordpress-plugin-development-how-to-include-css-and-javascript-conditionally-and-only-when-needed-by-the-posts/" rel="nofollow">Artem&#8217;s solution</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Artem Russakovskii</title>
		<link>http://konstruktors.com/blog/wordpress/1899-smarter-cleaner-gallery/#comment-1149</link>
		<dc:creator>Artem Russakovskii</dc:creator>
		<pubDate>Thu, 14 Jan 2010 08:03:47 +0000</pubDate>
		<guid isPermaLink="false">http://konstruktors.com/blog/?p=1899#comment-1149</guid>
		<description>&lt;a href=&quot;#comment-11329&quot; rel=&quot;nofollow&quot;&gt;Justin&lt;/a&gt;, that&#039;s exactly what I posted about today. See my first comment above.</description>
		<content:encoded><![CDATA[<p><a href="#comment-11329" rel="nofollow">Justin</a>, that&#8217;s exactly what I posted about today. See my first comment above.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://konstruktors.com/blog/wordpress/1899-smarter-cleaner-gallery/#comment-1148</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Thu, 14 Jan 2010 02:30:31 +0000</pubDate>
		<guid isPermaLink="false">http://konstruktors.com/blog/?p=1899#comment-1148</guid>
		<description>Wouldn&#039;t it make more sense to just require the theme to include the CSS? Using a separate stylesheet for this seems kinda pointless when the theme can presumably be styled to cope.

There was a trac ticket regarding this back in 2.5, but I&#039;m guessing was ignored.

We should probably lobby to have this fixed in core as the current system produces some bizarro code. I don&#039;t understand why a definition list would be used in this way for a gallery. Each line is no different from the next, so an unordered list or table seems far more sensible to me.</description>
		<content:encoded><![CDATA[<p>Wouldn&#8217;t it make more sense to just require the theme to include the CSS? Using a separate stylesheet for this seems kinda pointless when the theme can presumably be styled to cope.</p>
<p>There was a trac ticket regarding this back in 2.5, but I&#8217;m guessing was ignored.</p>
<p>We should probably lobby to have this fixed in core as the current system produces some bizarro code. I don&#8217;t understand why a definition list would be used in this way for a gallery. Each line is no different from the next, so an unordered list or table seems far more sensible to me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin Tadlock</title>
		<link>http://konstruktors.com/blog/wordpress/1899-smarter-cleaner-gallery/#comment-1147</link>
		<dc:creator>Justin Tadlock</dc:creator>
		<pubDate>Thu, 14 Jan 2010 00:14:40 +0000</pubDate>
		<guid isPermaLink="false">http://konstruktors.com/blog/?p=1899#comment-1147</guid>
		<description>Yeah, I&#039;m still looking into a solution for non-singular views.  Once I, or anyone else, provides that, I can update the plugin.</description>
		<content:encoded><![CDATA[<p>Yeah, I&#8217;m still looking into a solution for non-singular views.  Once I, or anyone else, provides that, I can update the plugin.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaspars</title>
		<link>http://konstruktors.com/blog/wordpress/1899-smarter-cleaner-gallery/#comment-1146</link>
		<dc:creator>Kaspars</dc:creator>
		<pubDate>Wed, 13 Jan 2010 20:37:37 +0000</pubDate>
		<guid isPermaLink="false">http://konstruktors.com/blog/?p=1899#comment-1146</guid>
		<description>&lt;a href=&quot;#comment-11325&quot; rel=&quot;nofollow&quot;&gt;Artem&lt;/a&gt;, you raise a very good point about the archive and index pages. I&#039;ll have to look into it.</description>
		<content:encoded><![CDATA[<p><a href="#comment-11325" rel="nofollow">Artem</a>, you raise a very good point about the archive and index pages. I&#8217;ll have to look into it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Artem Russakovskii</title>
		<link>http://konstruktors.com/blog/wordpress/1899-smarter-cleaner-gallery/#comment-1145</link>
		<dc:creator>Artem Russakovskii</dc:creator>
		<pubDate>Wed, 13 Jan 2010 19:40:23 +0000</pubDate>
		<guid isPermaLink="false">http://konstruktors.com/blog/?p=1899#comment-1145</guid>
		<description>Ha, incidentally, I posted a more in-depth look at the same issue of overincluding css and js by plugin authors at almost exactly the same time as you - http://beerpla.net/2010/01/13/wordpress-plugin-development-how-to-include-css-and-javascript-conditionally-and-only-when-needed-by-the-posts/

Also, I&#039;d be careful about your solution - it seems to assume a single post page only - what about galleries on the front page. Not everyone uses excerpts.</description>
		<content:encoded><![CDATA[<p>Ha, incidentally, I posted a more in-depth look at the same issue of overincluding css and js by plugin authors at almost exactly the same time as you &#8211; <a href="http://beerpla.net/2010/01/13/wordpress-plugin-development-how-to-include-css-and-javascript-conditionally-and-only-when-needed-by-the-posts/" rel="nofollow">http://beerpla.net/2010/01/13/.....the-posts/</a></p>
<p>Also, I&#8217;d be careful about your solution &#8211; it seems to assume a single post page only &#8211; what about galleries on the front page. Not everyone uses excerpts.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
