<?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>Nicolas Kuttler &#187; WordPress</title>
	<atom:link href="http://www.nkuttler.de/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nkuttler.de</link>
	<description>WordPress Services, IT Services</description>
	<lastBuildDate>Wed, 28 Jul 2010 23:49:18 +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>wp_enqueue_style, versioning and conditional CSS comments</title>
		<link>http://www.nkuttler.de/2010/07/28/wordpress-style-version-conditional-comments/</link>
		<comments>http://www.nkuttler.de/2010/07/28/wordpress-style-version-conditional-comments/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 13:00:28 +0000</pubDate>
		<dc:creator>nicolas</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress theme]]></category>
		<category><![CDATA[wp_enqueue_style]]></category>

		<guid isPermaLink="false">http://nkuttler.wordpress-server.de/?p=1796</guid>
		<description><![CDATA[I like to enqueue my CSS styles because it has the benefit of adding a version string. A link like style.css?ver=0.7 is useful because it will force visitors to download an updated style.css when the version number is increased. Here&#8217;s what I currently use in my functions.php: if &#40; !is_admin&#40;&#41; &#41; &#123; $theme = get_theme&#40; [...]]]></description>
			<content:encoded><![CDATA[<p>I like to enqueue my CSS styles because it has the benefit of adding a version string. A link like <code>style.css?ver=0.7</code> is useful because it will force visitors to download an updated <code>style.css</code> when the version number is increased. Here&#8217;s what I currently use in my <code>functions.php</code>:<span id="more-1796"></span></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>is_admin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
    <span style="color: #000088;">$theme</span>  <span style="color: #339933;">=</span> get_theme<span style="color: #009900;">&#40;</span> get_current_theme<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    wp_register_style<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'your-style'</span><span style="color: #339933;">,</span> get_bloginfo<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'stylesheet_url'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #000088;">$theme</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Version'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    wp_enqueue_style<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'your-style'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>I don&#8217;t really like the <code>get_theme()</code> line, but I am not aware of a better way to get the version info. What&#8217;s good about that line is that it gets the version of the current child theme, if you&#8217;re using one.</p>
<p>One problem with enqueuing styles is that most themes need one or two additional CSS files inside conditional comments for a certain browser. <a href="http://www.andrewnacin.com/">Nacin</a> pointed me to a solution:</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>is_admin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
    <span style="color: #000088;">$theme</span>  <span style="color: #339933;">=</span> get_theme<span style="color: #009900;">&#40;</span> get_current_theme<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    wp_register_style<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'your-style'</span><span style="color: #339933;">,</span> get_bloginfo<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'stylesheet_url'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #000088;">$theme</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Version'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'wp_styles'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">add_data</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'your-style'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'conditional'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'lte IE 8'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    wp_enqueue_style<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'your-style'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>See also the relevant <a href="http://core.trac.wordpress.org/ticket/10891">discussion on trac</a>. Using this could lead to script concatenation problems in the WordPress core (which doesn&#8217;t concern a theme developer) and if a website uses plugins like <a href="http://wordpress.org/extend/plugins/wp-minify/">wp-minify</a>. So you probably only want to use this in your own themes, not public ones.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nkuttler.de/2010/07/28/wordpress-style-version-conditional-comments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax For All WordPress Blogs</title>
		<link>http://www.nkuttler.de/2010/07/22/automatic-ajax-for-wordpress-plugin/</link>
		<comments>http://www.nkuttler.de/2010/07/22/automatic-ajax-for-wordpress-plugin/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 18:25:37 +0000</pubDate>
		<dc:creator>nicolas</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress plugin]]></category>
		<category><![CDATA[WordPress theme]]></category>

		<guid isPermaLink="false">http://www.nkuttler.de/?p=1851</guid>
		<description><![CDATA[This is a new plugin of mine that will turn many existing WordPress blogs and their themes into Ajax-powered blogs. The best way to see what this plugin does is to look at the live demo. The theme on that site wasn&#8217;t tweaked at all to make the Ajax functionality work (except some irrelevant CSS [...]]]></description>
			<content:encoded><![CDATA[<p>This is a new plugin of mine that will turn many existing WordPress blogs and their themes into Ajax-powered blogs. The best way to see what this plugin does is to look at the <a href="http://ajax.nkuttler.de">live demo</a>.<span id="more-1851"></span></p>
<p>The theme on that site wasn&#8217;t  tweaked at all to make the Ajax functionality work (except some irrelevant CSS changes). It works out of the box on most WordPress themes that follow the <a href="http://codex.wordpress.org/Theme_Development#Anatomy_of_a_Theme">theme coding recommendations</a>, see the plugin&#8217;s <tt>readme.txt</tt> for details.</p>
<p>Downloads are available at <a href=http://wordpress.org/extend/plugins/ajax-for-all/">WordPress.org</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nkuttler.de/2010/07/22/automatic-ajax-for-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
		<item>
		<title>WordPress is stupid</title>
		<link>http://www.nkuttler.de/2010/07/13/wordpress-is-stupid/</link>
		<comments>http://www.nkuttler.de/2010/07/13/wordpress-is-stupid/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 15:00:28 +0000</pubDate>
		<dc:creator>nicolas</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://nkuttler.wordpress-server.de/?p=1823</guid>
		<description><![CDATA[In case you haven&#8217;t been aware of this, WordPress core developers think that potentially breaking thousands of links on thousands of sites is an accepatable edge case. Here&#8217;s a great summary of what has been said. I have another equally stupid pet bug. Basically, a CSS file can break core functionality which can lead to [...]]]></description>
			<content:encoded><![CDATA[<p>In case you haven&#8217;t been aware of this, WordPress core developers think that <a href="http://core.trac.wordpress.org/ticket/13583">potentially breaking thousands of links on thousands of sites</a> is <a href="http://lists.automattic.com/pipermail/wp-hackers/2010-July/032858.html">an accepatable edge case</a>. Here&#8217;s a <a href="http://justintadlock.com/archives/2010/07/08/lowercase-p-dangit">great summary</a> of what has been said.<span id="more-1823"></span></p>
<p>I have another <a href="http://core.trac.wordpress.org/ticket/14243">equally stupid</a> pet bug. Basically, a CSS file can break core functionality which can lead to bugs in plugins like my <a href="http://www.nkuttler.de/2008/10/07/theme-switch-and-preview-plugin/">theme switching</a> plugin. It&#8217;s a rather rare bug but the sloppiness of the coding is on the same level.</p>
<p>I have a code-centric blog. I post a lot of code, and of course readers post code themselves from time to time. Of course WordPress has to <a href="http://www.nkuttler.de/2010/06/08/wp_nav_menu-wordpress-3-0/#comment-2202">mess with comments as well</a>. I realize that removing potential XSS code is a good security measure. But seriously. Do <strong>not</strong> delete any content before it goes into the database (besides SQL sanitization). I can&#8217;t even recover that comment now.</p>
<p>Wordpress rant over <img src='http://www.nkuttler.de/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.nkuttler.de/2010/07/13/wordpress-is-stupid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Password protecting the wp-admin directory</title>
		<link>http://www.nkuttler.de/2010/06/14/htaccess-protect-wordpress-admin/</link>
		<comments>http://www.nkuttler.de/2010/06/14/htaccess-protect-wordpress-admin/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 13:16:07 +0000</pubDate>
		<dc:creator>nicolas</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.nkuttler.de/?p=1584</guid>
		<description><![CDATA[Several places recommend to block the WordPress admin area with a password. While this certainly is a good idea, implementing it properly is non-trivial. One of the problems is that the WordPress Ajax handler script is located in the admin directory. So password-protecting the admin area will break all Ajax functionality your blog might be [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://codex.wordpress.org/Hardening_WordPress">Several</a> <a href="http://wordpress.tv/2009/07/11/brad-williams-security-montreal09/">places</a> recommend to block the WordPress admin area with a password. While this certainly is a good idea, implementing it properly is non-trivial. <span id="more-1584"></span></p>
<p>One of the problems is that the WordPress Ajax handler script is located in the admin directory. So password-protecting the admin area will break all Ajax functionality your blog might be using.</p>
<p>First, see <a href="http://httpd.apache.org/docs/2.2/howto/auth.html">this tutorial</a> on how to password protect directories with an <tt>.htaccess</tt> file. <a href="http://sivel.net">Sivel</a> has an <a href="http://core.trac.wordpress.org/ticket/12400#comment:23">example</a> for whitelisting the Ajax handler, add these line to your <tt>.htaccess</tt> file:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;"># These are the lines that do the password protection.</span>
<span style="color: #adadad; font-style: italic;"># You probably already created them while reading through the tutorial linked above.</span>
<span style="color: #00007f;">AuthUserFile</span> /path/to/your/htpasswd
<span style="color: #00007f;">AuthType</span> basic
<span style="color: #00007f;">AuthName</span> <span style="color: #7f007f;">&quot;Restricted Resource&quot;</span>
<span style="color: #00007f;">require</span> valid-<span style="color: #00007f;">user</span>
&nbsp;
<span style="color: #adadad; font-style: italic;"># This is the whitelisting of the ajax handler</span>
&lt;<span style="color: #000000; font-weight:bold;">Files</span> admin-ajax.php&gt;
    <span style="color: #00007f;">Order</span> <span style="color: #00007f;">allow</span>,<span style="color: #00007f;">deny</span>
    <span style="color: #00007f;">Allow</span> <span style="color: #00007f;">from</span> <span style="color: #00007f;">all</span>
    <span style="color: #00007f;">Satisfy</span> any 
&lt;/<span style="color: #000000; font-weight:bold;">Files</span>&gt;</pre></div></div>

<p>Please notice that you absolutely need to create the <tt>htpasswd</tt> file, see the linked tutorial above.</p>
<p>Here&#8217;s the necessary configuration to whitelist a file in a password protected location in lighttpd:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #0000ff;">$HTTP</span><span style="color: #009900;">&#91;</span><span style="color: #ff0000;">&quot;url&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=~</span> <span style="color: #ff0000;">&quot;^<span style="color: #000099; font-weight: bold;">\/</span>wp-admin<span style="color: #000099; font-weight: bold;">\/</span>.*&quot;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #0000ff;">$HTTP</span><span style="color: #009900;">&#91;</span><span style="color: #ff0000;">&quot;url&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!~</span> <span style="color: #ff0000;">&quot;^<span style="color: #000099; font-weight: bold;">\/</span>wp-admin<span style="color: #000099; font-weight: bold;">\/</span>admin-ajax<span style="color: #000099; font-weight: bold;">\.</span>php&quot;</span> <span style="color: #009900;">&#123;</span>
        auth<span style="color: #339933;">.</span><span style="color: #000066;">require</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>
            <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900;">&#40;</span>
                <span style="color: #ff0000;">&quot;method&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;basic&quot;</span><span style="color: #339933;">,</span>
                <span style="color: #ff0000;">&quot;realm&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;Password protected area&quot;</span><span style="color: #339933;">,</span>
                <span style="color: #ff0000;">&quot;require&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;user=theuser&quot;</span><span style="color: #339933;">,</span>
            <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.nkuttler.de/2010/06/14/htaccess-protect-wordpress-admin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to add support for navigation menus to your WordPress theme</title>
		<link>http://www.nkuttler.de/2010/06/08/wp_nav_menu-wordpress-3-0/</link>
		<comments>http://www.nkuttler.de/2010/06/08/wp_nav_menu-wordpress-3-0/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 15:00:50 +0000</pubDate>
		<dc:creator>nicolas</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress theme]]></category>
		<category><![CDATA[wp_nav_menu]]></category>

		<guid isPermaLink="false">http://www.nkuttler.de/?p=1613</guid>
		<description><![CDATA[The new navigation menus system in WordPress 3.0 looks promising, but in my opinion it&#8217;s not very usable yet. Anyway, here&#8217;s one way to add navigation menus to your theme while maintaining backward compatibility: In your theme&#8217;s functions.php add something like the following code: 1 2 3 4 5 6 7 8 9 10 11 [...]]]></description>
			<content:encoded><![CDATA[<p>The new <a href="http://codex.wordpress.org/Appearance_Menus_SubPanel">navigation menus</a> system in WordPress 3.0 looks promising, but in my opinion it&#8217;s not very usable yet. Anyway, here&#8217;s one way to add navigation menus to your theme while maintaining backward compatibility:</p>
<p>In your theme&#8217;s <code>functions.php</code> add something like the following code:<span id="more-1613"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> mytheme_addmenus<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	register_nav_menus<span style="color: #009900;">&#40;</span>
		<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
			<span style="color: #0000ff;">'main_nav'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'The Main Menu'</span><span style="color: #339933;">,</span>
		<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'init'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mytheme_addmenus'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> mytheme_nav<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</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;">'wp_nav_menu'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
        wp_nav_menu<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'menu=main_nav&amp;container_class=pagemenu&amp;fallback_cb=mytheme_nav_fallback'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">else</span>
        mytheme_nav_fallback<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> mytheme_nav_fallback<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    wp_page_menu<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'show_home=Start&amp;menu_class=pagemenu'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>In line 1 we add support for the navigation menus. The <code>mytheme_nav()</code> function is what you will use in the theme to display the menu. Inside that function we check if <code>wp_nav_menu()</code> exists, that means if we&#8217;re running WordPress 3.0 (or later). If not we&#8217;ll use the fallback function <code>mytheme_nav_fallback()</code>.</p>
<p>Notice that the fallback also gets called if no navigation menus have been created in the admin area. That&#8217;s what the <code>fallback_cb</code> parameter on line 4 does.</p>
<p>To keep the HTM markup and the CSS consistent you&#8217;ll have to use the <code>container_class</code> parameter on <code>wp_nav_menu</code> but the <code>menu_class</code> parameter for <code>wp_page_menu</code>.</p>
<p>In your template use the following code to use your new custom function:</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> mytheme_nav<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></pre></div></div>

<h3>Resources</h3>
<ul>
<li><a href="http://codex.wordpress.org/Function_Reference/wp_nav_menu">wp_nav_menu() reference</a></li>
<li><a href="http://codex.wordpress.org/Template_Tags/wp_page_menu">wp_page_menu() reference</a></li>
<li><a href="http://justintadlock.com/archives/2010/06/01/goodbye-headaches-hello-menus">Informative article on nav menus by Justin Tadlock</a></li>
</ul>
<a name="wptoc_0_0_0"></a><h2>Ramblings</h2>
<p>What&#8217;s good about the new menu system:</p>
<ul>
<li>Total control over what appears in the menu</li>
<li>You can add posts, pages, categories and tags in the menu</li>
<li>Very nice drag and drop interface</li>
</ul>
<p>What&#8217;s bad:</p>
<ul>
<li>You will have to teach your users how to use the system properly.</li>
<li>If you create new pages they won&#8217;t be added to your existing menu (except for top level pages).</li>
<li>You can not control your page menus through the navigation menus interface. I think it is&#8230; very very odd that WordPress doesn&#8217;t have a simple drag-and-drop interface to arrange pages.</li>
<li>The previous point means that the new menu system is useless unless you update your theme.</li>
<li>The <code>wp_nav_menu()</code> call is inconsistent with the existing <code>wp_page_menu()</code> function.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.nkuttler.de/2010/06/08/wp_nav_menu-wordpress-3-0/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>WPMU fast backend switch</title>
		<link>http://www.nkuttler.de/2010/06/07/wpmu-switch-backend/</link>
		<comments>http://www.nkuttler.de/2010/06/07/wpmu-switch-backend/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 11:10:46 +0000</pubDate>
		<dc:creator>nicolas</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress plugin]]></category>
		<category><![CDATA[WPMU]]></category>

		<guid isPermaLink="false">http://nkuttler.wordpress-server.de/?p=1687</guid>
		<description><![CDATA[I recently converted several simple WordPress installs into a single WPMU install. As I use all of the blogs myself I wanted a quick way to switch between the various backends. This is probably only useful if you don&#8217;t have too many blogs and use all of them yourself. The switch links will be added [...]]]></description>
			<content:encoded><![CDATA[<p>I recently converted several simple WordPress installs into a single WPMU install. As I use all of the blogs myself I wanted a quick way to switch between the various backends. This is probably  only useful if you don&#8217;t have too many blogs and use all of them yourself. The switch links will be added to your super admin menu.<span id="more-1687"></span></p>
<p>By the way, I use the <a href="http://wordpress.org/extend/plugins/ozh-admin-drop-down-menu/">Ozh admin menu plugin</a>. You might need two clicks to switch if  you don&#8217;t. </p>
<p><a href="http://wordpress.org/extend/plugins/wpmu-fast-backend-switch/">Download the plugin</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nkuttler.de/2010/06/07/wpmu-switch-backend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 3.0 network lighttpd rewrite rules</title>
		<link>http://www.nkuttler.de/2010/06/06/wpmu-lighttpd-rewrite-rules/</link>
		<comments>http://www.nkuttler.de/2010/06/06/wpmu-lighttpd-rewrite-rules/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 13:00:31 +0000</pubDate>
		<dc:creator>nicolas</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[rewrite]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress network]]></category>
		<category><![CDATA[WPMU]]></category>

		<guid isPermaLink="false">http://www.nkuttler.de/?p=1609</guid>
		<description><![CDATA[I recently installed my first WordPress network on lighttpd and was looking for rewrite rules. This post is correct except for the rewrite rule for files. I supposed it&#8217;s a change that was introduced in 3.0, or maybe earlier. Anyway, here are updated rewrite rules: In your lighttpd.conf: $HTTP&#91;&#34;host&#34;&#93; =~ &#34;domain\.com&#34; &#123; simple-vhost.default-host = &#34;domain.com&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>I recently installed my first WordPress network on lighttpd and was looking for rewrite rules. <a href="http://blog.nix.is/lighttpd-rewrite-rules-for-wordpress">This post</a> is correct except for the rewrite rule for files. I supposed it&#8217;s a change that was introduced in 3.0, or maybe earlier. Anyway, here are updated rewrite rules:<span id="more-1609"></span></p>
<p>In your <code>lighttpd.conf</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #0000ff;">$HTTP</span><span style="color: #009900;">&#91;</span><span style="color: #ff0000;">&quot;host&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=~</span> <span style="color: #ff0000;">&quot;domain<span style="color: #000099; font-weight: bold;">\.</span>com&quot;</span> <span style="color: #009900;">&#123;</span>
    simple<span style="color: #339933;">-</span>vhost<span style="color: #339933;">.</span>default<span style="color: #339933;">-</span>host <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;domain.com&quot;</span>
    include <span style="color: #ff0000;">&quot;wpmu-rewrite.conf&quot;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>And <code>wpmu-rewrite.conf</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">url<span style="color: #339933;">.</span>rewrite<span style="color: #339933;">-</span>once <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>
    <span style="color: #ff0000;">&quot;^/(.*/)?files/$&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;/index.php&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #ff0000;">&quot;^/(.*/)?files/(.*)&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;/wp-includes/ms-files.php?file=$2&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #ff0000;">&quot;^(/wp-admin/.*)&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;$1&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #ff0000;">&quot;^/([_0-9a-zA-Z-]+/)?(wp-.*)&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;/$2&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #ff0000;">&quot;^/([_0-9a-zA-Z-]+/)?(.*<span style="color: #000099; font-weight: bold;">\.</span>php)$&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">&quot;/$2&quot;</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span></pre></div></div>

<p>What&#8217;s changed from the other site&#8217;s example is the <code>ms-files.php</code> rewrite rule.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nkuttler.de/2010/06/06/wpmu-lighttpd-rewrite-rules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nesting WordPress loops</title>
		<link>http://www.nkuttler.de/2010/05/30/wordpress-loop-inside-a-loop/</link>
		<comments>http://www.nkuttler.de/2010/05/30/wordpress-loop-inside-a-loop/#comments</comments>
		<pubDate>Sun, 30 May 2010 13:01:47 +0000</pubDate>
		<dc:creator>nicolas</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[shortcode]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress loop]]></category>
		<category><![CDATA[WordPress theme]]></category>

		<guid isPermaLink="false">http://www.nkuttler.de/?p=1559</guid>
		<description><![CDATA[Sometimes it&#8217;s useful to put a WordPress loop inside another loop. To do this you&#8217;ll have to create a new WP_Query object, as in this example: $my_query = new WP_Query&#40; &#34;cat=3&#34; &#41;; if &#40; $my_query-&#62;have_posts&#40;&#41; &#41; &#123; while &#40; $my_query-&#62;have_posts&#40;&#41; &#41; &#123; $my_query-&#62;the_post&#40;&#41;; the_content&#40;&#41;; &#125; &#125; $GLOBALS&#91;'post'&#93; = $GLOBALS&#91;'wp_query'&#93;-&#62;post; Restoring $post is necessary because $post->comment_status [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it&#8217;s useful to put a WordPress loop inside another loop. To do this you&#8217;ll have to create a new <code>WP_Query</code> object, as in this example:<span id="more-1559"></span></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">   <span style="color: #000088;">$my_query</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> WP_Query<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;cat=3&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$my_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">have_posts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
       <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$my_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">have_posts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
           <span style="color: #000088;">$my_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">the_post</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
           the_content<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
       <span style="color: #009900;">&#125;</span>
   <span style="color: #009900;">&#125;</span>
   <span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'post'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span>  <span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'wp_query'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post</span><span style="color: #339933;">;</span></pre></div></div>

<p>Restoring <code>$post</code> is necessary because <code>$post->comment_status</code> of the post in the outer loop can be wrong after running the inner loop. That was the only problem I found, by I prefer to restore <code>$post completely</code> just to be sure. WordPress 3.0 has a function <code>wp_reset_postdata()</code> that you can use to restore <code>$post</code>.</p>
<p>I use this technique to show an &#8220;excerpt cloud&#8221; in a post using a <a href="http://codex.wordpress.org/Shortcode_API">shortcode</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nkuttler.de/2010/05/30/wordpress-loop-inside-a-loop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visitor Movies for WordPress</title>
		<link>http://www.nkuttler.de/2010/05/21/record-movies-of-visitors/</link>
		<comments>http://www.nkuttler.de/2010/05/21/record-movies-of-visitors/#comments</comments>
		<pubDate>Fri, 21 May 2010 10:02:04 +0000</pubDate>
		<dc:creator>nicolas</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[clicktracking]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[marketing]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress plugin]]></category>

		<guid isPermaLink="false">http://www.nkuttler.de/?p=1530</guid>
		<description><![CDATA[Did you ever want to know what exactly your visitors are doing on your site? Watch them! A client of mine wanted a plugin to log what users type into forms. I kind of didn&#8217;t see the point at first. But a few days later I was a little annoyed that there was apparently no [...]]]></description>
			<content:encoded><![CDATA[<p>Did you ever want to know what exactly your visitors are doing on your site? Watch them!</p>
<p>A client of mine wanted a plugin to log what users type into forms. I kind of didn&#8217;t see the point at first. But a few days later I was a little annoyed that there was apparently no free alternative to websites like <a href="http://clixpy.com">clixpy</a>, clicktale and similar services.<span id="more-1530"></span></p>
<p>It occured to me that recording movies of visits isn&#8217;t really hard to do. And so i started a new plugin, loosely based on the unpublished form input tracking plugin.</p>
<p>I am very pleased with the results so far. Of course it&#8217;s no match for the professional services mentioned above. But it is good enough to gain a few insights into what can be improved on your website.</p>
<p>The recording script is pretty lightweight but has a rather hefty dependeny: jQuery. It also loads json2.js. I&#8217;m sure the logging could be rewritten without the jQuery dependency but that really wasn&#8217;t a priority for the first public release.</p>
<p>This plugin probably needs WordPress 2.8 and PHP 5. I didn&#8217;t bother to test older versions and won&#8217;t support them in the future.</p>
<p>Here is a sample movie of what a recorded session can look like. As you can see mouse movements, clicks, form input, select boxes, checkboxes and radio buttons are recorded.</p>
<p><object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/OTv8loMWDPU&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/OTv8loMWDPU&#038;fs=1" type="application/x-shockwave-flash" width="500" height="400" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><strong>Important</strong>: For the playback you should always use the same browser as the visitor. If you don&#8217;t, the mouse position will probably be very wrong. The plugin also doesn&#8217;t save a page&#8217;s state at the time of recording. This means if comments are added or the content changes, you will see the old movements on a new website.</p>
<p>Downloads at <a href="http://wordpress.org/extend/plugins/visitor-movies/">WordPress.org</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nkuttler.de/2010/05/21/record-movies-of-visitors/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Convert WordPress pages to posts</title>
		<link>http://www.nkuttler.de/2010/05/20/how-to-convert-wordpress-pages-to-posts/</link>
		<comments>http://www.nkuttler.de/2010/05/20/how-to-convert-wordpress-pages-to-posts/#comments</comments>
		<pubDate>Thu, 20 May 2010 10:20:34 +0000</pubDate>
		<dc:creator>nicolas</dc:creator>
				<category><![CDATA[Content Management]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress page]]></category>
		<category><![CDATA[WordPress post]]></category>

		<guid isPermaLink="false">http://www.nkuttler.de/?p=1535</guid>
		<description><![CDATA[I like WordPress, but I don&#8217;t like the WordPress page system at all. That&#8217;s why I recently converted all my plugin pages to posts. My main reasons for doing so were: Pages can&#8217;t be tagged Pages don&#8217;t have categories Pages and posts don&#8217;t mix too well in custom loops Pages don&#8217;t appear in your RSS [...]]]></description>
			<content:encoded><![CDATA[<p>I like WordPress, but I don&#8217;t like the WordPress page system at all. That&#8217;s why I recently converted all my plugin pages to posts. My main reasons for doing so were:<span id="more-1535"></span></p>
<ul>
<li>Pages can&#8217;t be <strong>tagged</strong></li>
<li>Pages don&#8217;t have <strong>categories</strong></li>
<li>Pages and posts don&#8217;t mix too well in <strong>custom loops</strong></li>
<li>Pages don&#8217;t appear in your RSS <strong>feed</strong></li>
<li>Posts are better for <strong>usability</strong> and <strong>SEO</strong></li>
</ul>
<p>I converted the pages with the help of the excellent <a href="http://www.briandgoad.com/blog/downloads/p2pConverter">p2pConverter</a> plugin. Converting the pages is very easy. The plugin adds a &#8220;convert to post&#8221; button to every page on the page overview. Just click it, confirm, and you&#8217;re basically done. Of course, having more features for posts makes it necessary to perform a few additional steps after the conversion to get the full benefit:</p>
<ul>
<li>The category will be your default category, you probably want to change that</li>
<li>The new post has no tags. The whole point of converting the pages (for me) was to add tags.</li>
<li>As a safeguard I added 301 redirects to my server config from the old page address to the new post. The plugin or WordPress seems to do this anyway, but I wanted to be 100% sure nothing breaks in the future. Besides, doing this in the webserver saves a few PHP calls.</li>
</ul>
<p>One thing that isn&#8217;t ideal is that all converted posts were added to the top of my RSS feed, even though their publishing date is the same as that of the former page. I&#8217;m not sure it&#8217;s possible to work around this, but I don&#8217;t think it&#8217;s a big deal if you&#8217;re only dealing with a few pages.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nkuttler.de/2010/05/20/how-to-convert-wordpress-pages-to-posts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
