<?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>WP Wizard &#187; Customizing WordPress</title>
	<atom:link href="http://wpwizard.net/category/customizing-wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpwizard.net</link>
	<description>I ❤ WordPress</description>
	<lastBuildDate>Sat, 05 Mar 2011 12:30:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Setting up a multilingual WordPress site</title>
		<link>http://wpwizard.net/customizing-wordpress/setting-up-a-multilingual-wordpress-site/</link>
		<comments>http://wpwizard.net/customizing-wordpress/setting-up-a-multilingual-wordpress-site/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 14:25:40 +0000</pubDate>
		<dc:creator>Stian Andreassen</dc:creator>
				<category><![CDATA[Customizing WordPress]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[languages]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://stianandreassen.com/?p=316</guid>
		<description><![CDATA[With just a simple Template and script in place of wp_list_pages(), you can make multilingual WordPress sites.]]></description>
			<content:encoded><![CDATA[<p>I often have clients who need a <strong>multilingual website</strong>. This isn&#8217;t plug &amp; play when it comes to WordPress (though rumor has it WP 3.0 will support multiple sites in one install, which probably will make multilingual WP sites a breeze), but there are sollutions. WordPress’s <strong>Page</strong> system is pretty flexible, and can with just a few moderations be used for multiple languages.</p>
<h3><span id="more-316"></span>How-To:</h3>
<p>First off I add the <a href="http://www.wprecipes.com/wordpress-page-template-to-redirect-to-first-child-page">Redirect To First Child Template</a> to the <strong>Theme</strong>. What this does, is look for the first <strong>Child</strong> of a <strong>Page</strong>, and redirect to it. (To controll which Child is the first, I use the plugin <a href="http://wordpress.org/extend/plugins/my-page-order/">My Page Order</a>.) I then create a Page for each of the languages I want, employing the <strong>Redirect-Template</strong> on them. I then add what is to be the main menu items for each language, and add them as Children of their respective language Page. If the site has any subnavigation, I simply add these as Children to the Child-of-language-Pages. Follow me?</p>
<p>This gives me a rough navigation along the lines of:</p>
<ul>
<li>ENGLISH
<ul>
<li>Main Page</li>
<li>Products</li>
<li>About Us</li>
<li>Contact</li>
</ul>
</li>
<li>GERMAN
<ul>
<li>Startseite</li>
<li>Produkte</li>
<li>Wir über uns</li>
<li>Kontakt</li>
</ul>
</li>
<li>FRENCH
<ul>
<li>Page principale</li>
<li>Produits</li>
<li>A propos de nous</li>
<li>Contact</li>
</ul>
</li>
</ul>
<p>(Apologies for poor translation, if any, had to use Google Translator.)</p>
<p>Then I add the code for the navigation to the <strong>Theme</strong>. We can&#8217;t simply use <code>wp_list_pages()</code> for this, as it will simply output a list like the one above. Instead we use this script where we want our navigation to appear:</p>
<pre class="brush: php; highlight: [40]; title: ;">
&lt;?php
// CHECK IF WE ARE ON A PAGE
 if(is_page()) {
 $currenttitle = $post-&gt;post_title.'&lt;/a&gt;';
 $subpages = wp_list_pages('title_li=&amp;echo=0&amp;sort_column=menu_order&amp;depth=1&amp;child_of='.$post-&gt;ID);

 $id = $post-&gt;post_parent;
 $sidebar_title = get_page($id);
 if($sidebar_title) {
 $prevpageparent = $sidebar_title-&gt;post_parent;
 }
 rewind_posts();

 if($subpages) {
 $pages=wp_list_pages(&quot;title_li=&amp;echo=1&amp;sort_column=menu_order&amp;depth=1&amp;echo=0&amp;child_of=&quot;.$post-&gt;post_parent);
 $pagelisting = str_replace($currenttitle, $currenttitle.'&lt;div id=&quot;submenu&quot;&gt;&lt;ul&gt;'.$subpages.'&lt;/ul&gt;&lt;/div&gt;', $pages);
 echo $pagelisting;
 }

 elseif($post-&gt;post_parent &amp;&amp; $prevpageparent&gt;'0') {
 $parent = $post-&gt;post_parent;

 $id = $post-&gt;post_parent;
 $myquery = new WP_Query(&quot;page_id=$id&quot;);
 $currenttitle = $myquery-&gt;post-&gt;post_title.'&lt;/a&gt;';

 $subpages = wp_list_pages('title_li=&amp;echo=0&amp;sort_column=menu_order&amp;depth=1&amp;echo=0&amp;child_of='.$post-&gt;post_parent);

 $pages = wp_list_pages(&quot;title_li=&amp;echo=1&amp;sort_column=menu_order&amp;depth=1&amp;echo=0&amp;child_of=&quot;.$prevpageparent);
 $pagelisting = str_replace($currenttitle, $currenttitle.'&lt;div id=&quot;submenu&quot;&gt;&lt;ul&gt;'.$subpages.'&lt;/ul&gt;&lt;/div&gt;', $pages);
 echo $pagelisting;
 }

 else { wp_list_pages(&quot;title_li=&amp;echo=1&amp;sort_column=menu_order&amp;depth=1&amp;child_of=&quot;.$post-&gt;post_parent);
 }
 rewind_posts();
} else {
// WE ARE NOT ON A PAGE, BUT A POST, CATEGORY VIEW, ETC
// SO WE HAVE TO DEFINE THE DEFAULT LANGUAGE MANUALLY AT THE END OF THE STRING
 wp_list_pages(&quot;title_li=&amp;echo=1&amp;sort_column=menu_order&amp;depth=1&amp;child_of=1&quot;);
} ?&gt;
</pre>
<p><strong>Line 40 is important</strong>; if we&#8217;re <em>not</em> on a <strong>Page</strong> the script can&#8217;t traverse back to it&#8217;s source (the Page that defines the language), so we have to manually put in the ID for the language Page we want to use as default, f.i. ENGLISH, at the end of <code>child_of=</code>.</p>
<p><strong>Also note</strong> that this script is custom made to show vertical navigation, with any subnavigation positioned directly below its Parent both <em>when the Parent is active</em> and <em>when the Child is active</em>, like this:</p>
<ul>
<li>Main Page</li>
<li><strong>Products</strong>
<ul>
<li>Software</li>
<li><em>Hardware</em></li>
<li>Upgrades</li>
</ul>
</li>
<li>About us</li>
<li>Contact</li>
</ul>
<p>It can be shortened and/or modified for other needs and types of navigation.</p>
<h3>A few notes:</h3>
<ul>
<li>It&#8217;s easiest to add the links for each language into the <strong>Theme</strong> manually. If you want to use flag icons, or simply text links, you can simply add: <code>&lt;a href="&lt;?php echo get_bloginfo('home').'/english/'; ?&gt;"&gt;English&lt;/a&gt;</code> and so forth.</li>
<li>If you want the <em>ENGLISH &gt; Main Page</em> to be the default Front Page, simply go to <strong>Settings &gt; Reading</strong> in <strong>WP-admin</strong> and set Static Page: ENGLISH to display as Front Page.</li>
<li><strong>And most important:</strong> This won&#8217;t take you from the English <strong>Product</strong> Page to the French <strong>Produits</strong> Page by clicking the flag. When you change language, you will be redirected to the Front Page of the selected language!</li>
</ul>
<div class="shr-publisher-316"></div>]]></content:encoded>
			<wfw:commentRss>http://wpwizard.net/customizing-wordpress/setting-up-a-multilingual-wordpress-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up WordPress as a CMS – part 2</title>
		<link>http://wpwizard.net/customizing-wordpress/setting-up-wordpress-as-a-cms-part-2/</link>
		<comments>http://wpwizard.net/customizing-wordpress/setting-up-wordpress-as-a-cms-part-2/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 10:00:18 +0000</pubDate>
		<dc:creator>Stian Andreassen</dc:creator>
				<category><![CDATA[Customizing WordPress]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[dashboard]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp-admin]]></category>

		<guid isPermaLink="false">http://www.stianandreassen.com/?p=234</guid>
		<description><![CDATA[How to exclude Pages from page navigation and add alternate titles (different from navigation titles) to Pages.]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://wpwizard.net/customizing-wordpress/setting-up-wordpress-as-a-cms-part-1/">part 1</a> I discussed how cleaning up the <strong>Dashboard </strong>in <strong>WordPress </strong>by removing excess admin panels and editor sections makes it easier to use, especially for users who are new to WordPress. In this part I&#8217;ll be discussing how to add options for excluding pages from navigation and how to add alternate titles.</p>
<h3><span id="more-234"></span>Exclude Pages from Navigation</h3>
<p>I often want to add <strong>Pages </strong>to my WordPress site, without showing it in <code>wp_list_pages()</code>. So far WordPress doesn&#8217;t have an option for excluding <strong>Pages </strong>from navigation menus without setting <em>Visibility </em>to <em>Private </em>(which makes them unavailable for non-logged-in users). For this we have to use a <strong>Plugin</strong>: <a href="http://wordpress.org/extend/plugins/exclude-pages/">Exclude Pages</a>. This plugin adds a checkbox to the <strong>Page Editor</strong>; “Include this page in menus”. Simply uncheck this to exclude <strong>Pages </strong>from the page navigation that users see on your site.</p>
<h3>Alternate Titles</h3>
<p>When creating <strong>Pages </strong>in WordPress, what you put in the <strong>Title Field</strong> will show up both in navigation and as a title on the website. This can be very impractical, not to say downright frustrating. Often I want the menu item to be &#8220;About Us&#8221;, but the Page title to be &#8220;Who We Are&#8221;, or something of the same. Not possible in WordPress out-of-the-box. The sollution is <strong>Custom Fields</strong>. In the Page Editor, add a new custom field called &#8220;alttitle&#8221;. Then edit your <code>page.php</code>, and replace <code>&lt;h2&gt;&lt;?php the_title();  ?&gt;&lt;/h2&gt;</code> with:</p>
<pre class="brush: php; title: ;">
&lt;?php $alttitle = get_post_meta($post-&gt;ID, 'alttitle', true); ?&gt;
&lt;h2&gt;&lt;?php if(!$alttitle) { the_title(); } else { echo $alttitle; } ?&gt;&lt;/h2&gt;
</pre>
<p>That&#8217;s it. The code checks if an alternate title is exists, and if so, displays it. Otherwise the default <strong>Page</strong> title is displayed.</p>
<h3>Make an Alternate Title Section in the Editor</h3>
<p>If you have hidden the custom fields section from your users, or just simply want to make the sollution more elegant, you can use the <a href="http://wordpress.org/extend/plugins/more-fields/">More Fields</a> plugin i mentioned in part 1. Here&#8217;s how to do it:</p>
<ol>
<li>Install and activate the plugin</li>
<li>Go to Settings &gt; More Fields and click &#8220;Add a new box!&#8221;</li>
<li>In <em>Box title</em> put &#8220;Alternate Title&#8221;, and select &#8220;Left&#8221; in the <em>Position </em>pull-down, save</li>
<li>Click the &#8220;Add new field!&#8221; button</li>
<li>In <em>Key </em>put &#8220;alttitle&#8221;, in <em>Title </em>put &#8220;Alternate Title is used as page heading, while Title field (above) is used for navigation items&#8221;, leave the rest as is, save</li>
<li>Click &#8220;Manage post types&#8221; in the top menu, click &#8220;Page&#8221;, scroll down to the bottom and check the checkbox next to <strong>Alternate Title</strong>, save</li>
</ol>
<p>You will now have a new editor section in the Page Editor, where you can write alternate titles for your <strong>Pages</strong>.</p>
<p style="text-align: center;"><img class="size-full wp-image-253 alignnone" title="alttitle_dump" src="http://wpwizard.net/wp-content/uploads/2009/12/alttitle_dump.png" alt="alttitle_dump" width="380" height="104" /></p>
<div class="shr-publisher-234"></div>]]></content:encoded>
			<wfw:commentRss>http://wpwizard.net/customizing-wordpress/setting-up-wordpress-as-a-cms-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting up WordPress as a CMS &#8211; part 1</title>
		<link>http://wpwizard.net/customizing-wordpress/setting-up-wordpress-as-a-cms-part-1/</link>
		<comments>http://wpwizard.net/customizing-wordpress/setting-up-wordpress-as-a-cms-part-1/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 08:55:01 +0000</pubDate>
		<dc:creator>Stian Andreassen</dc:creator>
				<category><![CDATA[Customizing WordPress]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[dashboard]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[user]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp-admin]]></category>

		<guid isPermaLink="false">http://www.stianandreassen.com/?p=3</guid>
		<description><![CDATA[By removing the excess funtions the users never need, WordPress feels more complete and functional as a CMS.]]></description>
			<content:encoded><![CDATA[<p><strong><a href="http://wordpress.org/">WordPress</a></strong> is best known as the leading (free) <strong>blogging software</strong> on the web. But it can also be used as a full-fledged <strong><abbr title="content management system">CMS</abbr> </strong> if you know how to take advantage of its flexibility. However, WordPress comes with a host of features which you probably won&#8217;t need if you&#8217;re using it as a CMS rather than a blogg &#8211; such as <strong>Comments</strong>, <strong>Links</strong>, and even <strong>Posts</strong>. So you might want to remove these, especially if you&#8217;re setting up a CMS for someone who&#8217;s inexperienced and/or have never used WordPress before. Cleaning up the <strong>Dashbaord </strong>and <strong>Editor </strong>by removing sections the users don&#8217;t need, users who are new to WordPress won&#8217;t be distracted by menu items and editor sections they&#8217;ll never need to use.</p>
<p><strong>Basically, by removing the excess funtions the users never need, WordPress feels more complete and functional as a CMS. This might make the learning curve a little less steep.</strong></p>
<p><span id="more-3"></span>Here&#8217;s a few things you might want to do:</p>
<h3>Hide Admin Panels</h3>
<p>It&#8217;s a good idea to clean up the <strong>Dashboard</strong>, and hide admin panels the users don&#8217;t need. For this I use <a href="http://wordpress.org/extend/plugins/hide-admin-panels/">Hide Admin Panels</a>, a plugin that let&#8217;s you do just what the name implies; hide panels from the <strong>Dashboard </strong>main menu, on a per-user-basis. If your users don&#8217;t use <strong>Links </strong>or <strong>Comments</strong>, they don&#8217;t need to see them in the <strong>Dashboard</strong>. Likewise, if your users only use <strong>Pages</strong>, hide the <strong>Post</strong> panel, et cetera.</p>
<p>(This, of course, has more potenial uses. For example, if the site you&#8217;re setting up has several users, where only some (or one) of them should have access to publish news, you simply hide the <strong>Post </strong>panel for those who shouldn&#8217;t have access.)</p>
<h3>&#8230; and rename the rest</h3>
<p>If you&#8217;re using WordPress as a CMS, some of the admin panels have names that average users don&#8217;t necessarily relate to. Maybe you want to change <strong>Posts </strong>to <strong>News</strong>, <strong>Pages </strong>to <strong>Content</strong>, and <strong>Media </strong>to <strong>Files</strong>? This is easily done. All you have to do is download <a href="http://svn.automattic.com/wordpress-i18n/pot/trunk/wordpress.pot">the latest language file</a> (or the latest one <a href="http://codex.wordpress.org/WordPress_in_Your_Language">in your language</a>, if you&#8217;re using a translation), open it in a POT-editor, for example <a href="http://www.poedit.net/">POEdit</a>, and change all instances of &#8220;Posts&#8221; to &#8220;News&#8221;, or whatever you like. This is a tedious and time-consuming task, but the good news is, once you&#8217;re done you can reuse your new language file on all your WordPress-sites.</p>
<p><strong>Read more about editing language files on <a href="http://codex.wordpress.org/Translating_WordPress">Translating WordPress</a>.</strong></p>
<h3>Hide Editor Sections</h3>
<p>It&#8217;s also a good idea to clean up the <strong>Editor</strong> (for <strong>Pages </strong>and <strong>Posts</strong>), by removing sections the users don&#8217;t need to see or use. For this I use <a href="http://wordpress.org/extend/plugins/more-fields/">More Fields</a>, a plugin with many uses (I&#8217;ll get back to some of them later), among them the opportunity to remove sections from the <strong>Editor</strong>. If your users don&#8217;t need <strong>Comments/Pingback</strong>, you hide that section. Likewise with <strong>Custom Fields</strong>, especially if you use them for certain functions you don&#8217;t want or need the users to see. Your users don&#8217;t need <strong>Excerpt</strong>? Remove it! You get the picture &#8230;</p>
<div class="shr-publisher-3"></div>]]></content:encoded>
			<wfw:commentRss>http://wpwizard.net/customizing-wordpress/setting-up-wordpress-as-a-cms-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

