<?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>Christian Schenk&#187; HowTo</title>
	<atom:link href="http://www.christianschenk.org/blog/tag/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.christianschenk.org</link>
	<description>Writing about my experiences with technology and all different kinds of projects and experiments</description>
	<lastBuildDate>Sun, 29 Aug 2010 09:08:16 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to pretend having an iPhone</title>
		<link>http://www.christianschenk.org/blog/howto-pretend-having-iphone/</link>
		<comments>http://www.christianschenk.org/blog/howto-pretend-having-iphone/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 06:15:24 +0000</pubDate>
		<dc:creator>Christian Schenk</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[pretend]]></category>
		<category><![CDATA[satire]]></category>

		<guid isPermaLink="false">http://www.christianschenk.org/?p=753</guid>
		<description><![CDATA[Quite some years after the iPhone was introduced it still seems that everybody wants to have one to send email messages. But what if you just can&#8217;t afford it? In this short post I would like to show how to setup your email client so it looks like you were sending these messages from your [...]]]></description>
			<content:encoded><![CDATA[<p>Quite some years after the iPhone was introduced it still seems that everybody wants to have one to send email messages. But what if you just can&#8217;t afford it? In this short post I would like to show how to setup your email client so it looks like you were sending these messages from your shiny iPhone. It&#8217;s easy, quick and fun.</p>
<p><span id="more-753"></span></p>
<h2>How to</h2>
<p>We&#8217;ll change your email signature in a way that tells people the message was sent using an iPhone. It doesn&#8217;t matter which email client you&#8217;re using: while Apple Mail is great, using Outlook will be okay as well.</p>
<p>Open your email client&#8217;s configuration menu, find the part that lets you change your signature and enter the following text into the input field:</p>

<div class="wp_syntax"><div class="code"><pre class="plain" style="font-family:monospace;">Sent from my iPhone</pre></div></div>

<p>Click on save and make sure that the signature will be used when writing new emails or replying to the ones from your friends.</p>
<p>Although you don&#8217;t really have an iPhone everybody will be impressed that you sent him/her a message with your cool gadget.</p>
<h2>Conclusion</h2>
<p>Sure, if the one you&#8217;re sending an email is a geek I bet he&#8217;ll find out that you didn&#8217;t really send the message with an iPhone in no time. Nevertheless, most people won&#8217;t be able to notice this but just think that you&#8217;re the proud owner of an iPhone.</p>
<p>Next up:</p>
<ul>
<li>How to pretend having an iPad.</li>
<li>How to avoid meeting people in real life so they don&#8217;t notice that you haven&#8217;t really got Apple&#8217;s latest hardware.</li>
<li>How to write silly posts on a <a href="/blog/review-27-imac-perfect-christmas-gift/">27&#8243; iMac</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.christianschenk.org/blog/howto-pretend-having-iphone/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>WordPress: Adding a sidebar to your theme</title>
		<link>http://www.christianschenk.org/blog/wordpress-adding-sidebar-theme/</link>
		<comments>http://www.christianschenk.org/blog/wordpress-adding-sidebar-theme/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 07:40:19 +0000</pubDate>
		<dc:creator>Christian Schenk</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[sidebar]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[widgets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.christianschenk.org/?p=733</guid>
		<description><![CDATA[In another post I discussed the idea of placing a sidebar into your theme and using it to manage the navigation menu of your site. I came to the conclusion &#8211; proposed by other people from the WordPress community as well &#8211; that you can use a sidebar for basically anything but not just a [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="/blog/dynamic-navigation-menu-wordpress-theme/">another post</a> I discussed the idea of placing a <em>sidebar</em> into your theme and using it to manage the navigation menu of your site. I came to the conclusion &#8211; proposed by other people from the WordPress community as well &#8211; that you can use a sidebar for basically anything but not just a <em>sidebar</em>.</p>
<p>Although you can find this information in the <a href="http://codex.wordpress.org/">Codex</a> too, I would like to show you how easy it is to add a sidebar somewhere into your theme. You&#8217;ll see that it&#8217;s just about adding some function calls here and there &#8211; that&#8217;s it and you&#8217;ve got a new sidebar that can hold arbitrary widgets.</p>
<p><span id="more-733"></span></p>
<h2>Three simple steps</h2>
<p>Having a list of steps you can work through seems to be the best approach for this howto. Just follow these three steps and you&#8217;ll have a new sidebar in your theme.</p>
<h3>1. Register the sidebar</h3>
<p>First, you&#8217;ll have to register the new sidebar using <code>register_sidebar</code>. Open the file <code>functions.php</code> of your current theme &#8211; if there&#8217;s no such file just create it &#8211; and search for calls to <code>register_sidebar</code>. If you can&#8217;t find any that&#8217;s fine and you can go on inserting the function call where ever you like but if your theme already got a sidebar you should find at least one occurrence of the aforementioned function.</p>
<p>In case there&#8217;s already a call to <code>register_sidebar</code> insert the new calls to this function <em>after</em> the existing one. This way you&#8217;ll make sure that the widgets placed in another sidebar don&#8217;t suddenly appear in your new sidebar while the other one seems to be empty; has to do with the internal ordering of the sidebars.</p>
<p>The code is as easy as the following: just insert the function call and adjust the name as you see fit; please choose a unique name.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;"># maybe other calls to register_sidebar here...
</span><span style="color: #666666; font-style: italic;"># ...
</span>register_sidebar<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'My new sidebar'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;"># ...
</span><span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Want to fine tune the appearance of your sidebar? Have a look at other parameters <a href="http://codex.wordpress.org/Function_Reference/register_sidebar">here</a>.</p>
<h3>2. Inserting the sidebar into the theme</h3>
<p>Once you&#8217;ve registered the sidebar you&#8217;ll have to tell WordPress where the widgets associated with the newly created sidebar should appear. This, of course, depends on your specific theme and other considerations as well.</p>
<p>For now, lets assume we wanted a new sidebar below the title of a post. We would open the file <code>single.php</code> &#8211; or <code>index.php</code> if <code>single.php</code> doesn&#8217;t exist &#8211; of our theme and insert the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">...
&lt;h1&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h1&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dynamic_sidebar'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span>
           <span style="color: #339933;">!</span>dynamic_sidebar<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'My new sidebar'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  &lt;!-- This will be displayed if the sidebar is empty --&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
...</pre></div></div>

<p>See that we provide the name of the sidebar registered above in the function call to <code>dynamic_sidebar</code>. If you want to show some default content in case no widgets are assigned to the sidebar you can do so by changing the HTML comment to something else; this may be particularly interesting if you&#8217;re developing a theme and the user hasn&#8217;t customized the sidebar yet.</p>
<p>If you want to read more about <code>dynamic_sidebar</code> check out the Codex <a href="http://codex.wordpress.org/WordPress_Widgets_Api/dynamic_sidebar">here</a>.</p>
<h3>3. Adding widgets</h3>
<p>Now that you&#8217;ve added a new sidebar to your theme you should start adding widgets. Your new sidebar should appear under Appearance &#8211; Widgets and is ready to use. If you&#8217;re not satisfied with the appearance of the sidebar or the widgets try tweaking the parameters of <code>register_sidebar</code> or adjust your CSS.</p>
<h2>Conclusion</h2>
<p>It&#8217;s pretty easy adding multiple sidebars to your theme. This post presented the basics which are sufficient most of the time. If you want to learn more about sidebars and widgets a good starting point is the <a href="http://codex.wordpress.org/Widgets_API">Widgets API</a> page in the Codex; extra parameters can be found there.</p>
<p>The more sidebars a theme has the more flexible it is. From a user&#8217;s perspective it&#8217;s just nice to display widgets just where one wants to. Since it isn&#8217;t that hard to add another sidebar users can do this on their own or hire somebody to do this for them at low costs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christianschenk.org/blog/wordpress-adding-sidebar-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paginated comments with WordPress 2.7 and the Copyblogger theme</title>
		<link>http://www.christianschenk.org/blog/paginated-comments-copyblogger-theme/</link>
		<comments>http://www.christianschenk.org/blog/paginated-comments-copyblogger-theme/#comments</comments>
		<pubDate>Fri, 26 Dec 2008 17:05:23 +0000</pubDate>
		<dc:creator>Christian Schenk</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[copyblogger]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[paging]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.christianschenk.org/?p=381</guid>
		<description><![CDATA[Shows you how to tweak the CopyBlogger theme to have comments on several pages with WordPress 2.7]]></description>
			<content:encoded><![CDATA[<p>The new WordPress release 2.7 has built-in support for both comment threading and paging. Especially the latter is a cool feature: it helps fighting the problem of ever growing pages just because there&#8217;re so many comments attached to a post or a page.</p>
<p>Since I&#8217;m using the <a href="http://www.copyblogger.com/the-copyblogger-theme-for-wordpress/">Copyblogger theme</a> that currently doesn&#8217;t come with comments on several pages I changed the <code>comment.php</code> to use this new feature. This post documents how this worked.</p>
<p><span id="more-381"></span></p>
<h2>How to add paginated comments</h2>
<p>First I started reading <a href="http://codex.wordpress.org/Migrating_Plugins_and_Themes_to_2.7">this</a>, <a href="http://codex.wordpress.org/Template_Tags/wp_list_comments">that</a> and finally <a href="http://ottodestruct.com/blog/2008/09/29/wordpress-27-comments-enhancements/">this post</a>. If you&#8217;d like to understand what you&#8217;re doing I recommend reading these too.</p>
<p>Basically it&#8217;s all about the new functions <code>wp_list_comments</code>, <code>have_comments</code> and <code>*_comments_link</code>. Just replacing the old code with these won&#8217;t cut it for the Copyblogger theme because the CSS is based on a description list, i.e. <code>dl</code> with <code>dt</code> and <code>dd</code> inside. We&#8217;ll have to change that to either a <code>div</code> or &#8211; and that&#8217;s what I did &#8211; a <code>ul</code>.</p>
<p>One more thing you&#8217;ll have to think about is whether the <em>paged pages</em> should be indexed by search engines. Since I&#8217;m not an expert in search engine optimization I don&#8217;t really know what to do here; regarding duplicate content I guess the robots should only <code>index</code> the first page. <a href="http://www.malcolmcoles.co.uk/blog/wordpress-comment-pagination-and-duplicate-content/">Read</a> what Malcolm Coles wrote about this.</p>
<h2>Making the changes</h2>
<p>Before making changes to the original <code>comments.php</code> from the Copyblogger theme I renamed that file and started from scratch just copying over the bits I needed. You can have a look at the result <a href="http://data.christianschenk.org/paginated-comments-copyblogger-theme/comments.php.txt">here</a>; the corresponding part for the CSS can be found over <a href="http://data.christianschenk.org/paginated-comments-copyblogger-theme/custom.css">here</a>.</p>
<p>All I did was following the recommendations <a href="http://codex.wordpress.org/Migrating_Plugins_and_Themes_to_2.7/Enhanced_Comment_Display">here</a>, i.e. adding the new comment loop and changing the existing CSS to match the new HTML markup. This worked great so far until I wanted to add the <em>round corners</em> and the <em>speech bubble</em> style to the CSS. The solution I opted for was a filter that adds some <code>div</code>&#8217;s around the comment text like so:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> copyblogger_comment_text_filter<span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'&lt;div class=&quot;comment_text_prefix&quot;&gt;&lt;/div&gt;'</span><span style="color: #339933;">.</span>
         <span style="color: #0000ff;">'&lt;div class=&quot;comment_text&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$content</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/div&gt;'</span><span style="color: #339933;">.</span>
         <span style="color: #0000ff;">'&lt;div class=&quot;comment_text_suffix&quot;&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'add_filter'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
  add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'comment_text'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'copyblogger_comment_text_filter'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This way it was possible to style the top and the bottom of the speech bubble around the comment text with the <code>prefix</code> and <code>suffix</code> div.</p>
<h2>Conclusion</h2>
<p>Adding paged comments to a theme is almost a snap: changing the PHP code will be done in a few minutes. More likely than not you&#8217;ll have to spent some time fixing the CSS to match the HTML code; this won&#8217;t be a big problem if your theme already uses an ordered or unsorted list (<code>ol</code>, <code>ul</code>). In case of the Copyblogger theme some extra work was required.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christianschenk.org/blog/paginated-comments-copyblogger-theme/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Removing the WordPress Generator meta tag completely</title>
		<link>http://www.christianschenk.org/blog/removing-wordpress-generator-meta-tag-completely/</link>
		<comments>http://www.christianschenk.org/blog/removing-wordpress-generator-meta-tag-completely/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 21:25:36 +0000</pubDate>
		<dc:creator>Christian Schenk</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[generator]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[tag]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.christianschenk.org/?p=358</guid>
		<description><![CDATA[Shows you how to remove the generator meta tag completely that's being added by WordPress' core after a fresh installation]]></description>
			<content:encoded><![CDATA[<p>WordPress adds a <em>generator</em> tag at various locations. Basically that&#8217;s a good idea because it provides a means to check out the different versions of WordPress that are actively being used in the blogosphere.</p>
<p><span id="more-358"></span></p>
<p>I&#8217;ve found the generator meta tag in my fresh installation of WordPress 2.7 here, there and everywhere:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/* In the HTML header */</span>
<span style="color: #339933;">&lt;</span>meta name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;generator&quot;</span> content<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;WordPress 2.7&quot;</span> <span style="color: #339933;">/&gt;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/* In the RSS feed */</span>
<span style="color: #339933;">&lt;</span>generator<span style="color: #339933;">&gt;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//wordpress.org/?v=2.7&lt;/generator&gt;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/* In the Atom feed */</span>
<span style="color: #339933;">&lt;</span>generator uri<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://wordpress.org/&quot;</span>
 version<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;2.7&quot;</span><span style="color: #339933;">&gt;</span>WordPress<span style="color: #339933;">&lt;/</span>generator<span style="color: #339933;">&gt;</span></pre></div></div>

<p>And the <a href="http://trac.wordpress.org/browser/tags/2.7/wp-includes/general-template.php#L1872">code suggests</a> that there&#8217;re even more places where this tag might show up.</p>
<h2>How to remove it completely</h2>
<p>If you&#8217;re doing some <a href="http://codex.wordpress.org/Hardening_WordPress#Security_through_obscurity">security through obscurity</a> you might have <a href="http://www.google.com/search?q=remove+wordpress+meta+generator">googled</a> a little bit and found the solutions that use the following piece of PHP code just unsatisfactory:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">remove_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wp_generator'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>So let&#8217;s remove it completely like so:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> rm_generator_filter<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_generator'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rm_generator_filter'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This will remove the tag everywhere: from the HTML, the RSS and the Atom feed, et cetera.</p>
<h3>WordPress&#8217; world of possibilities&#8230;</h3>
<p>Now I&#8217;d like to present another solution that might make sense: What about removing the generator tag almost everywhere <strong>but</strong> not in case of RDF content? Since RDF is widely used as a format for data mining applications why not show the information to these web robots? You could do this like so:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> rm_generator_filter<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'add_filter'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$types</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'html'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'xhtml'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'atom'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rss2'</span><span style="color: #339933;">,</span>
                 <span style="color: #666666; font-style: italic;">/*'rdf',*/</span> <span style="color: #0000ff;">'comment'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'export'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$types</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$type</span><span style="color: #009900;">&#41;</span>
    add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'get_the_generator_'</span><span style="color: #339933;">.</span><span style="color: #000088;">$type</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rm_generator_filter'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>What it does is adding a filter for every <code>type</code> but <em>RDF</em> returning just and empty string for the generator meta tag.</p>
<p>Although this doesn&#8217;t make much sense from the standpoint of security through obscurity because making the information available in just one place would compromise your <em>security</em> anyway, I just wanted to show that WordPress is flexible enough to do something like this.</p>
<h2>Download</h2>
<p>You can download the above code packaged in a plugin <a href="http://data.christianschenk.org/removing-wordpress-generator-meta-tag-completely/remove-generator-meta-tag.zip">here</a>. Have a look at the code and checkout the <code>define</code> in line 30: set it to true or false whether you&#8217;d like to remove the tag completely or not; the default is to remove it just everywhere.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christianschenk.org/blog/removing-wordpress-generator-meta-tag-completely/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Automate FTP sessions with Windows</title>
		<link>http://www.christianschenk.org/blog/automate-ftp-sessions-windows/</link>
		<comments>http://www.christianschenk.org/blog/automate-ftp-sessions-windows/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 07:55:44 +0000</pubDate>
		<dc:creator>Christian Schenk</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[at]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.christianschenk.org/?p=308</guid>
		<description><![CDATA[You&#8217;d like to upload some files from a PC running Windows via FTP to another server every now and then? It&#8217;s as easy as:

saving the appropriate FTP commands in a text file
using Windows&#8217; built-in ftp command along with the text file
adding a task to the at scheduler.

Let&#8217;s have a look at this.

The upload script
First we&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;d like to upload some files from a PC running Windows via FTP to another server every now and then? It&#8217;s as easy as:</p>
<ul>
<li>saving the appropriate FTP commands in a text file</li>
<li>using Windows&#8217; built-in <code>ftp</code> command along with the text file</li>
<li>adding a task to the <code>at</code> scheduler.</li>
</ul>
<p>Let&#8217;s have a look at this.</p>
<p><span id="more-308"></span></p>
<h2>The upload script</h2>
<p>First we&#8217;ll create a file that holds the FTP commands and then we&#8217;ll write a small batch script that uses the <code>ftp</code> command to execute the commands from the text file; have you ever read a sentence that uses the word <em>command</em> more often <img src='http://www.christianschenk.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ?</p>
<p>This is what the text file (<code>upload.ftp</code>) may look like:</p>

<div class="wp_syntax"><div class="code"><pre class="batch" style="font-family:monospace;">open example.com
username
password
cd another-directory
mput C:filesfile*.txt
bye</pre></div></div>

<p>It will open a connection to the given host using the supplied username and password. Then it will change the working directory on the server to <code>another-directory</code> and finally upload some files. Adapt everything to your needs; if you&#8217;d like to use more FTP commands, <a title="List of FTP commands" href="http://en.wikipedia.org/wiki/List_of_FTP_commands">this</a> is a good starting point.</p>
<p>Next we&#8217;ll create a batch script that calls the <code>ftp</code> command using the text file that we&#8217;ve just created. Save the following into a batch file (<code>upload.bat</code>):</p>

<div class="wp_syntax"><div class="code"><pre class="batch" style="font-family:monospace;">@echo off
@set logfile=upload.log
@ftp -i -v -s:&quot;upload.ftp&quot; &gt; %logfile%
@del %logfile%</pre></div></div>

<p>It creates a log file (<code>upload.log</code>) and deletes it after the <code>ftp</code> command is finished &#8211; if you&#8217;d like to keep the log file remove the last line from the script.</p>
<p>Now you have a batch file that you can click on and the files will be uploaded to the FTP server. Although this was pretty easy to setup is has a great impact: You don&#8217;t have to do this manually any more.</p>
<h3>Adding Automation</h3>
<p>While the script that you&#8217;ve just created is fully functional you may want to run it automatically every now and then. To do this, you&#8217;ll have to:</p>
<ul>
<li>make sure that the script uses absolute path names</li>
<li>add a task to the <code>at</code> scheduler</li>
</ul>
<p>First put the batch script and the text file into a directory of your choice. Add the path to this directory in front of log file&#8217;s name in line two of the batch script and to the text file containing the FTP commands in line three.</p>
<p>At last you can add a recurring task with <code>at</code> like so:</p>

<div class="wp_syntax"><div class="code"><pre class="batch" style="font-family:monospace;">at 22:30 /every:M,T,W,Th,F,S,Su C:Scriptsupload.bat</pre></div></div>

<p>In this case the script that I put under <code>C:Scripts</code> will run every day at 22:30, i.e. 10:30 pm.</p>
<h2>Conclusion</h2>
<p>As we&#8217;ve seen it&#8217;s pretty easy to automatically upload files to some FTP server with Windows. For example, this comes in handy if you&#8217;d like to backup some files to another server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christianschenk.org/blog/automate-ftp-sessions-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic menu for your WordPress theme</title>
		<link>http://www.christianschenk.org/blog/dynamic-navigation-menu-wordpress-theme/</link>
		<comments>http://www.christianschenk.org/blog/dynamic-navigation-menu-wordpress-theme/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 16:00:21 +0000</pubDate>
		<dc:creator>Christian Schenk</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[sidebar]]></category>
		<category><![CDATA[widgets]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.christianschenk.org/?p=284</guid>
		<description><![CDATA[Shows you how to add another sidebar to your theme that holds some Text widgets, each representing an item in your navigation menu.]]></description>
			<content:encoded><![CDATA[<p>I have <a title="Dynamic WordPress menu with animated JavaScript drop-downs" href="http://wordpress.org/support/topic/215815">found</a> <a title="Building a Dynamic WordPress Nav Menu" href="http://green-beast.com/blog/?p=157">various</a> descriptions about a dynamic navigation menu in a WordPress theme. What I&#8217;ve seen these solutions grab some pages and display the result either in the header or sidebar of the theme. It&#8217;s called <em>dynamic</em> because you can add pages to your blog and &#8211; depending on the implementation &#8211; a link to the appropriate page will appear in the menu.</p>
<p><span id="more-284"></span></p>
<p>Here&#8217;s my idea: What about adding another sidebar to your theme that holds some <code>Text</code> widgets, each representing an item in your menu? I think that&#8217;s ultra neat because you can:</p>
<ul>
<li>change your menu just by adding another <code>Text</code> widget</li>
<li>rearrange the order with drag and drop</li>
<li>use <a title="Widget Logic" href="http://wordpress.org/extend/plugins/widget-logic/">Widget Logic</a> to control where your menu items appear.</li>
</ul>
<p>Let&#8217;s implement this.</p>
<h2>Changing the theme</h2>
<p>Since I&#8217;m using a modified version of the great <a title="The Copyblogger Theme for WordPress" href="http://www.copyblogger.com/the-copyblogger-theme-for-wordpress/">Copyblogger Theme</a> I&#8217;ll show you how to change this specific theme. But it&#8217;s no problem to translate the following to other themes.</p>
<p>Basically we&#8217;ll have to change three files: <code>functions.php</code>, <code>sidebar.php</code> and <code>nav_menu.php</code>; I think the latter is a specialty of the Copyblogger theme. First we&#8217;ll register a new sidebar called <em>menu</em> in the file <code>functions.php</code> like so:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'register_sidebar'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    register_sidebar<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'sidebar'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    register_sidebar<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'name'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'menu'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>More likely than not you had a call to <code>register_sidebar</code> with no parameters: This registered your sidebar. As you can see we have to supply a name for each sidebar; make sure that each sidebar gets a unique name.</p>
<p>If your theme has got only one sidebar you have to change the file <code>sidebar.php</code> to pick up your original sidebar; if you already had more than one sidebar in your theme you can skip this step. Search for a call to <code>dynamic_sidebar</code> somewhere in the file <code>sidebar.php</code> and add the parameter <code>'sidebar'</code> to <code>dynamic_sidebar</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dynamic_sidebar'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span>
    <span style="color: #339933;">!</span>dynamic_sidebar<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'sidebar'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span></pre></div></div>

<p>This is a line from my file and it might look different in yours. Just make sure that the code uses the <em>right</em> sidebar here.</p>
<p>Finally the users of the Copyblogger theme will change the <code>nav_menu.php</code>. Everybody else may place the following in the <code>header.php</code> or wherever the menu of your theme might be.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dynamic_sidebar'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span>
      <span style="color: #339933;">!</span>dynamic_sidebar<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'menu'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;li&gt;&lt;a href=&quot;/&quot;&gt;home&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/archives/&quot;&gt;archives&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;/about/&quot;&gt;about&lt;/a&gt;&lt;/li&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
  <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>This snippet will display the widgets associated with the sidebar called <em>menu</em>. If there&#8217;re no widgets in this specific sidebar the three hardcoded links will show up.</p>
<h2>Customizing the menu</h2>
<p>Now that you&#8217;ve got a new sidebar called <em>menu</em> go to <em>Design &#8211; Widgets</em> and under <em>Current Widgets</em> select the menu sidebar in the drop down list and click on <em>Show</em>. Add as many Text widgets as you like and use them to link to sensible pages on your website. It&#8217;s as easy as this.</p>
<p>Since we leverage the power of the cool widget screen you can easily rearrange the order of your menu items by dragging them around. You can add other widgets to your menu as well &#8211; maybe that makes sense too.</p>
<h2>Conclusion</h2>
<p>As we&#8217;ve seen the concept of the sidebar is powerful and can be used for different purposes: one of them is a neat navigation menu. The new menu is easy to setup in any theme and I bet you&#8217;ll really like the way to manage it via the widget screen.</p>
<p>If you&#8217;d like to read more about the functions from the <a title=" Widgets API" href="http://codex.wordpress.org/Plugins/WordPress_Widgets_Api">Widgets API</a> used in this post I recommend having a look at <a title="register_sidebar" href="http://codex.wordpress.org/WordPress_Widgets_Api/register_sidebar">this</a> and <a title="dynamic_sidebar" href="http://codex.wordpress.org/WordPress_Widgets_Api/dynamic_sidebar">that</a> page.</p>
<p>This was inspired by Justin Tadlock&#8217;s <a href="http://justintadlock.com/archives/2008/04/18/widgetize-this">Widgetize This</a> post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christianschenk.org/blog/dynamic-navigation-menu-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Follow meta refresh with Commons HttpClient</title>
		<link>http://www.christianschenk.org/blog/follow-meta-refresh-with-commons-httpclient/</link>
		<comments>http://www.christianschenk.org/blog/follow-meta-refresh-with-commons-httpclient/#comments</comments>
		<pubDate>Thu, 22 May 2008 12:25:14 +0000</pubDate>
		<dc:creator>Christian Schenk</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[commons]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[httpclient]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[meta refresh]]></category>

		<guid isPermaLink="false">http://www.christianschenk.org/follow-meta-refresh-with-commons-httpclient/</guid>
		<description><![CDATA[Want to follow HTTP redirects and meta refresh tags as well? Have a look at the code in this post.]]></description>
			<content:encoded><![CDATA[<p>Having to check the <code>title</code> tag from a lot of different websites I needed a tool that would follow HTTP redirects as well as redirects in meta refresh tags. As a fan of <a href="http://www.google.de/search?q=commons+httpclient&#038;btnI">Commons HttpClient</a>, I hacked together some code that does the work.</p>
<p>For the impatient: check out the code <a title="Code reference" href="http://data.christianschenk.org/follow-meta-refresh-with-commons-httpclient/xref/">here</a>.</p>
<p><span id="more-106"></span></p>
<h2>The code</h2>
<p>The actual code is very simple:</p>
<ol>
<li>it executes an HTTP GET with a given URL</li>
<li>follows HTTP redirects</li>
<li>finally downloads the contents</li>
<li>checks whether there&#8217;s a meta refresh tag
<ul>
<li>starts over at 1. if it found such a tag</li>
</ul>
</li>
<li>returns the content.</li>
</ol>
<p>Have a look at the class <code>TitleTest</code> <a title="Code reference" href="http://data.christianschenk.org/follow-meta-refresh-with-commons-httpclient/xref/">here</a>: the private method <code>doGet</code> will be most interesting. </p>
<h2>Conclusion</h2>
<p>I was wondering why there aren&#8217;t that many tools out there which support following meta refresh tags. Since a lot of websites use this feature I thought that this would be something a lot of people might want to use when testing their websites.<br />
Hacking a small tool that does the job is very easy though, as demonstrated in this post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christianschenk.org/blog/follow-meta-refresh-with-commons-httpclient/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deleting files older than a week under Windows</title>
		<link>http://www.christianschenk.org/blog/deleting-files-older-than-a-week-under-windows/</link>
		<comments>http://www.christianschenk.org/blog/deleting-files-older-than-a-week-under-windows/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 07:15:59 +0000</pubDate>
		<dc:creator>Christian Schenk</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[at]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[vbs]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.christianschenk.org/deleting-files-older-than-a-week-under-windows/</guid>
		<description><![CDATA[Shows how to use a Visual Basic script and the at command to delete files older than a week under Windows]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re running a Windows server and want to delete files that are older than, say, a week then Visual Basic comes to the rescue. Once you&#8217;ve got the script running you&#8217;d like Windows to start it every day so you don&#8217;t have to do this manually: <code>at</code> will be your friend here.</p>
<p><span id="more-94"></span></p>
<h2>The Visual Basic script</h2>
<p>For everybody who knows how to program in Visual Basic it&#8217;s be pretty easy to write some lines that get the files from a certain directory and deletes them if they haven&#8217;t been changed for some time. For everybody else: just copy the following lines into a file e.g. <code>cleaner.vbs</code>.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Dim</span> fso, f, f1, fc
<span style="color: #000080;">Set</span> fso = CreateObject(<span style="color: #800000;">&quot;Scripting.FileSystemObject&quot;</span>)
<span style="color: #000080;">Set</span> f = fso.GetFolder(<span style="color: #800000;">&quot;C:foobar&quot;</span>)
<span style="color: #000080;">Set</span> fc = f.Files
<span style="color: #000080;">For</span> <span style="color: #000080;">Each</span> f1 <span style="color: #000080;">in</span> fc
<span style="color: #000080;">If</span> DateDiff(<span style="color: #800000;">&quot;d&quot;</span>, f1.DateLastModified, Now) &gt; 7 <span style="color: #000080;">Then</span> f1.Delete
<span style="color: #000080;">Next</span></pre></td></tr></table></div>

<p>All that&#8217;s left to do is to change the folder in line 3 to whatever you want. Have a look at line 6 and adapt the number of days, currently <code>7</code>, to your needs.</p>
<h2>Running the script</h2>
<p>The <code>at</code> command helps you to run programs at a certain time. Let&#8217;s say we want to run our script every day at 22:30 o&#8217;clock (that&#8217;s 10:30PM) we would type this on the command prompt:</p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;">at <span style="color: #cc66cc;">22</span>:<span style="color: #cc66cc;">30</span> /every:M,T,W,Th,F,S,Su C:Scriptscleaner.vbs</pre></div></div>

<p>If we just type <code>at</code> we&#8217;ll see all the tasks that are planned for execution.</p>
<h2>Conclusion</h2>
<p>With a simple Visual Basic script and the <code>at</code> command it&#8217;s pretty easy to run recurring tasks under Windows. If your Windows server is running longer than a week without rebooting this is a really nice solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christianschenk.org/blog/deleting-files-older-than-a-week-under-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove clutter from WordPress 2.5</title>
		<link>http://www.christianschenk.org/blog/remove-clutter-from-wordpress-25/</link>
		<comments>http://www.christianschenk.org/blog/remove-clutter-from-wordpress-25/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 07:20:11 +0000</pubDate>
		<dc:creator>Christian Schenk</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.christianschenk.org/remove-clutter-from-wordpress-25/</guid>
		<description><![CDATA[This post shows you how to remove some clutter from your WordPress installation. Namely: RSD and WLW links and some JavaScript.]]></description>
			<content:encoded><![CDATA[<p>After upgrading to WordPress 2.5 I noticed some extra tags in the HTML header of my site: an RSD link, a link to the <code>wlwmanifest.xml</code> and a meta tag with the name set to <code>generator</code>.</p>
<p>While the link tags were introduced in an earlier release of WordPress the meta tag came with 2.5. I&#8217;m pretty sure that the latter will cause incompatibilities with a lot of existing themes that have a line like this in their <code>header.php</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;meta</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;generator&quot;</span> <span style="color: #000066;">content</span>=<span style="color: #ff0000;">&quot;WordPress 2.3.2&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #808080; font-style: italic;">&lt;!-- leave this for stats please --&gt;</span></pre></div></div>

<p>In this post I&#8217;d like to share my ideas about removing some clutter from your WordPress installation. <span id="more-93"></span>Namely:</p>
<ul>
<li>RSD and WLW links</li>
<li>generator tag</li>
<li>some JavaScript</li>
</ul>
<h2>Removing RSD and WLW links</h2>
<p>Getting rid of this stuff is as easy as using the <a title="WLW Disabler" href="http://www.planetmike.com/plugins/wlw-disabler/">WLW Disabler</a> plugin. After installing and activating the plugin the links are gone. That&#8217;s great.</p>
<h2>Getting rid of the generator tag</h2>
<p>Maybe it&#8217;s possible to write a nice plugin that removes this tag too but a quick and dirty hack is to edit the file <code>general-template.php</code>; you can find it in <code>wp-includes</code>. On line 1187 set the variable <code>$gen</code> to an empty string:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// ...</span>
<span style="color: #000088;">$gen</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">return</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;get_the_generator_<span style="color: #006699; font-weight: bold;">{$type}</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// ...</span></pre></div></div>

<p>If you come up with a clean solution to this please <a href="#respond">leave a comment</a>.<br />
<em>Update</em>: I found a nice solution and <a title="Removing the WordPress Generator meta tag completely" href="/blog/removing-wordpress-generator-meta-tag-completely/">wrote</a> about it.</p>
<h2>Living without JavaScript</h2>
<p>Although this isn&#8217;t really related to the previous two I&#8217;d like to share this one too. I&#8217;ve disabled most of the JavaScript that comes with WordPress quite some time ago. And it works great for me: especially the admin pages load a lot faster.</p>
<p>Furthermore I got rid of <a href="http://www.prototypejs.org/">Prototype</a> that doesn&#8217;t play well with SmoothGallery. So, if you&#8217;re using the <a href="http://www.christianschenk.org/projects/wordpress-smoothgallery-plugin/">WordPress SmoothGallery plugin</a> this might be something for you.</p>
<p>Just open the file <code>wp-includes/script-loader.php</code> and comment out the line saying:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">default_scripts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>That&#8217;s it.</p>
<h2>Conclusion</h2>
<p>If you don&#8217;t use Windows Live Writer and the like, using WLW Disabler should be of no harm for you. Disabling some of the JavaScript will give you a performance boost but you&#8217;ll lose some of the nifty features at the same time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christianschenk.org/blog/remove-clutter-from-wordpress-25/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Integrate SmoothGallery into WordPress</title>
		<link>http://www.christianschenk.org/blog/integrate-smoothgallery-into-wordpress/</link>
		<comments>http://www.christianschenk.org/blog/integrate-smoothgallery-into-wordpress/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 21:45:33 +0000</pubDate>
		<dc:creator>Christian Schenk</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[smoothgallery]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.christianschenk.org/blog/integrate-smoothgallery-into-wordpress/</guid>
		<description><![CDATA[SmoothGallery doesn't play well with Prototype if you're using Internet Explorer so don't use them together]]></description>
			<content:encoded><![CDATA[<p>Lately I&#8217;ve been working on a <a href="/projects/wordpress-smoothgallery-plugin/">plugin</a> that integrates JonDesign&#8217;s <a href="http://smoothgallery.jondesign.net/">SmoothGallery</a> into WordPress. Basically this is pretty straightforward because all I had to do was to build some code around the JavaScript and CSS and put everything into a plugin.</p>
<p>Then I was <a href="/projects/wordpress-smoothgallery-plugin/comment-page-1/#comment-636">told</a> that the plugin as I built it wasn&#8217;t working with Internet Explorer. I booted up Windows and came up with a solution to this <em>problem</em> that I want to share here: don&#8217;t embed SmoothGallery and <a href="http://www.prototypejs.org/">Prototype</a> on the same page.</p>
<p><span id="more-68"></span></p>
<h2>SmoothGallery and Prototype</h2>
<p>Jonathan warns us on the <a href="http://smoothgallery.jondesign.net/download/">download page</a> that he doesn&#8217;t recommend the <code>namespaced</code> version of SmoothGallery because of incompatible frameworks like <a href="http://www.prototypejs.org/">Prototype</a> or <a href="http://jquery.com/">jQuery</a>.</p>
<p>I did some tests and found out that SmoothGallery doesn&#8217;t work with Prototype at all &#8211; if you&#8217;re using Internet Explorer. You can download the tests <a title="Tests using SmoothGallery and Prototype" href="http://data.christianschenk.org/integrate-smoothgallery-into-wordpress/sg-ie-test.zip">here</a>: Just open the HTML files and check whether the gallery is present.</p>
<p>Have a look at my results:</p>
<table class="cmpicons">
<thead>
<tr>
<th>SmoothGallery</th>
<th>Prototype</th>
<th>Internet Explorer</th>
<th>Firefox</th>
<th>Safari</th>
</tr>
</thead>
<tr>
<td>1.2</td>
<td class="present"><span>Present</span></td>
<td class="doesntwork"><span>Doesn&#8217;t work</span></td>
<td class="works"><span>Works</span></td>
<td class="works"><span>Works</span></td>
</tr>
<tr>
<td>1.2</td>
<td class="notpresent"><span>Not present</span></td>
<td class="works"><span>Works</span></td>
<td class="works"><span>Works</span></td>
<td class="works"><span>Works</span></td>
</tr>
<tr>
<td>2.0</td>
<td class="present"><span>Present</span></td>
<td class="doesntwork"><span>Doesn&#8217;t work</span></td>
<td class="works"><span>Works</span></td>
<td class="works"><span>Works</span></td>
</tr>
<tr>
<td>2.0</td>
<td class="notpresent"><span>Not present</span></td>
<td class="works"><span>Works</span></td>
<td class="works"><span>Works</span></td>
<td class="works"><span>Works</span></td>
</tr>
</table>
<p>If you try to use SmoothGallery with Prototype enabled in Internet Explorer the gallery won&#8217;t be rendered; I have tested this with version 6 and 7 of IE. No problems with Firefox or Safari though.</p>
<p>There&#8217;s another thing I noticed: if you change the order of the <code>script</code> entries in the HTML header IE will display the images of the gallery in two different ways. Either you&#8217;ll be able to see all pictures in the gallery or you&#8217;ll just see the first one.</p>
<p>Another observation is that SmoothGallery breaks apart if you insert an <code>a</code> tag with the <code>name</code> set to <em>options</em>. Once you&#8217;ve inserted such an anchor IE won&#8217;t render the gallery; again no problems with Firefox or Safari.</p>
<h2>Conclusion</h2>
<p>I&#8217;ve just explained what I observed testing JonDesign&#8217;s SmoothGallery and Prototype with Internet Explorer, Firefox and Safari. I didn&#8217;t take a look at the JavaScript and didn&#8217;t search for a solution there.</p>
<p>If you want IE users to watch a <em>smooth</em> gallery on your website it seems that there&#8217;s no other way than to get rid of Prototype &#8211; remove it at least from the specific page you&#8217;re using a SmoothGallery on.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.christianschenk.org/blog/integrate-smoothgallery-into-wordpress/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
