<?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: Load A Stylesheet Only If Use Gallery</title> <atom:link href="http://wpengineer.com/load-a-stylesheet-only-if-use-gallery/feed/" rel="self" type="application/rss+xml" /><link>http://wpengineer.com/load-a-stylesheet-only-if-use-gallery/</link> <description>WordPress News, Hacks, Tipps, Tutorials, Plugins and Themes</description> <lastBuildDate>Thu, 29 Jul 2010 08:11:47 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=1496</generator> <item><title>By: Frank</title><link>http://wpengineer.com/load-a-stylesheet-only-if-use-gallery/#comment-3369</link> <dc:creator>Frank</dc:creator> <pubDate>Tue, 26 Jan 2010 15:04:09 +0000</pubDate> <guid
isPermaLink="false">http://wpengineer.com/?p=1949#comment-3369</guid> <description>@Ted: yes, correctly and how you load your css, always or only when you add the shortcode in the content?</description> <content:encoded><![CDATA[<p>@Ted: yes, correctly and how you load your css, always or only when you add the shortcode in the content?</p> ]]></content:encoded> </item> <item><title>By: Frank</title><link>http://wpengineer.com/load-a-stylesheet-only-if-use-gallery/#comment-3367</link> <dc:creator>Frank</dc:creator> <pubDate>Tue, 26 Jan 2010 14:49:06 +0000</pubDate> <guid
isPermaLink="false">http://wpengineer.com/?p=1949#comment-3367</guid> <description>@Justin: thanks for your reply and your hint to this small code tipps. Yes, you have right, this works only when use the shortcode on post content: On my own solutions i add a metabox to the editor with a radiobutton or checkbox to add js or css for custom solutions.</description> <content:encoded><![CDATA[<p>@Justin: thanks for your reply and your hint to this small code tipps. Yes, you have right, this works only when use the shortcode on post content: On my own solutions i add a metabox to the editor with a radiobutton or checkbox to add js or css for custom solutions.</p> ]]></content:encoded> </item> <item><title>By: Ted</title><link>http://wpengineer.com/load-a-stylesheet-only-if-use-gallery/#comment-3366</link> <dc:creator>Ted</dc:creator> <pubDate>Tue, 26 Jan 2010 14:48:31 +0000</pubDate> <guid
isPermaLink="false">http://wpengineer.com/?p=1949#comment-3366</guid> <description>I put this code in function.php&lt;code&gt;
function remove_gallery_css()
{
return &quot;&quot;;
}
add_filter(&#039;gallery_style&#039;, &#039;remove_gallery_css&#039;);&lt;/code&gt;so I can style my gallery in my stylesheet</description> <content:encoded><![CDATA[<p>I put this code in function.php</p><p><code><br
/> function remove_gallery_css()<br
/> {<br
/> return "";<br
/> }<br
/> add_filter('gallery_style', 'remove_gallery_css');</code></p><p></p><p>so I can style my gallery in my stylesheet</p> ]]></content:encoded> </item> <item><title>By: Justin Tadlock</title><link>http://wpengineer.com/load-a-stylesheet-only-if-use-gallery/#comment-3365</link> <dc:creator>Justin Tadlock</dc:creator> <pubDate>Tue, 26 Jan 2010 14:04:52 +0000</pubDate> <guid
isPermaLink="false">http://wpengineer.com/?p=1949#comment-3365</guid> <description>This only works in the case of the shortcode being in the post content.  It doesn&#039;t take into account that users may put the gallery in other places on their page (other shortcode-ready areas).  I&#039;ve seen a few posts on checking the post content before loading JavaScript and CSS lately.  All of them make the assumption that users only add stuff to their post content.But, the solution I like the most is to simply add the gallery styles to the theme&#039;s &lt;code&gt;style.css&lt;/code&gt; file.  I also like just making one JavaScript file (jQuery, usually), and only having to load it.Also, for anyone using child themes, you need to replace &lt;code&gt;get_bloginfo(&#039;template_directory&#039;)&lt;/code&gt; with &lt;code&gt;get_stylesheet_directory_uri()&lt;/code&gt; for this tutorial.  This also works when not using a child theme.</description> <content:encoded><![CDATA[<p>This only works in the case of the shortcode being in the post content.  It doesn't take into account that users may put the gallery in other places on their page (other shortcode-ready areas).  I've seen a few posts on checking the post content before loading JavaScript and CSS lately.  All of them make the assumption that users only add stuff to their post content.</p><p>But, the solution I like the most is to simply add the gallery styles to the theme's <code>style.css</code> file.  I also like just making one JavaScript file (jQuery, usually), and only having to load it.</p><p>Also, for anyone using child themes, you need to replace <code>get_bloginfo('template_directory')</code> with <code>get_stylesheet_directory_uri()</code> for this tutorial.  This also works when not using a child theme.</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Database Caching 8/13 queries in 0.071 seconds using disk
Object Caching 255/286 objects using disk

Served from: wpengineer.com @ 2010-07-29 13:01:43 -->