<?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>ThumNet &#187; wordpress</title>
	<atom:link href="http://blog.thumnet.com/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.thumnet.com</link>
	<description>- Jeffrey Tummers</description>
	<lastBuildDate>Fri, 23 Sep 2011 21:33:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Updated to Graphene theme</title>
		<link>http://blog.thumnet.com/updated-to-graphene-theme/226/</link>
		<comments>http://blog.thumnet.com/updated-to-graphene-theme/226/#comments</comments>
		<pubDate>Fri, 23 Sep 2011 21:33:48 +0000</pubDate>
		<dc:creator>ThumNet</dc:creator>
				<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[graphene]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.thumnet.com/?p=226</guid>
		<description><![CDATA[I&#8217;ve been a co-developer for the WordPress Graphene Theme since February 2011, and it&#8217;s about time a starting using this great theme on my own blog You can follow our development at Google Code &#8211; http://code.google.com/p/graphene/, here you can also report bugs and request new features. The original developer and designer of the theme is &#8230; </p><p><a class="more-link block-button" href="http://blog.thumnet.com/updated-to-graphene-theme/226/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been a co-developer for the <a href="http://wordpress.org/extend/themes/graphene">WordPress Graphene Theme</a> since February 2011, and it&#8217;s about time a starting using this great theme on my own blog <img src='http://blog.thumnet.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><a href="http://blog.thumnet.com/wp-content/uploads/2011/09/screenshot.png" rel="lightbox[226]"><img src="http://blog.thumnet.com/wp-content/uploads/2011/09/screenshot.png" alt="" title="Graphene Screenshot" width="300" height="225" class="aligncenter size-full wp-image-227" /></a></p>
<p>You can follow our development at Google Code &#8211; <a href="http://code.google.com/p/graphene/">http://code.google.com/p/graphene/</a>, here you can also report bugs and request new features.</p>
<p>The original developer and designer of the theme is Syahir Hakim, on his <a href="http://www.khairul-syahir.com/wordpress-dev/graphene-theme">blog</a> you can read a bit more about the theme.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thumnet.com/updated-to-graphene-theme/226/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress pages into nested tree array</title>
		<link>http://blog.thumnet.com/wordpress-pages-into-nested-tree-array/220/</link>
		<comments>http://blog.thumnet.com/wordpress-pages-into-nested-tree-array/220/#comments</comments>
		<pubDate>Fri, 23 Sep 2011 21:18:38 +0000</pubDate>
		<dc:creator>ThumNet</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.thumnet.com/?p=220</guid>
		<description><![CDATA[I was looking for a way to get a nested array (or tree array) from the pages or posts in WordPress, for a theme I&#8217;m currently working on. If you just want to display the links you could use the wp_list_pages() function. But this wont get you a nested array, then there are the functions &#8230; </p><p><a class="more-link block-button" href="http://blog.thumnet.com/wordpress-pages-into-nested-tree-array/220/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>I was looking for a way to get a nested array (or tree array) from the pages or posts in WordPress, for a theme I&#8217;m currently working on.</p>
<p>If you just want to display the links you could use the <a href="http://codex.wordpress.org/Template_Tags/wp_list_pages">wp_list_pages()</a> function.</p>
<p>But this wont get you a nested array, then there are the functions <a href="http://codex.wordpress.org/Function_Reference/get_pages">get_pages()</a> and <a href="http://codex.wordpress.org/Function_Reference/get_posts">get_posts()</a>. These return a one-dimensional array of pages or posts.</p>
<p>Using this array I&#8217;ve written a simple recursive function which creates a nested array.</p>
<pre class="brush: php; title: ; notranslate">
/**
 * Build a nested tree from an array of posts/pages.
 * @see WordPress::get_pages()
 * @see WordPress::get_posts()
 *
 * @param array $items The array of posts/pages
 * @param int $parentid The parent id to start with
 * @param array $tree
 * @return array The nested pages tree
 */
function thumnet_build_nested_tree($items, $parentid = 0, &amp;$tree = array()) {
    foreach ($items as $key =&gt; $item) {
        // we are only interested in the pages that have the current parent
        if ($item-&gt;post_parent == $parentid){
            // add the item to the parent node
            $tree[$item-&gt;ID] = array('self' =&gt; $item, 'children' =&gt; array());
            // remove the page from the pages array, so it's not iterated in the recursive call
            unset($items[$key]);
            // call the function recursively, but with the children node as the tree
            thumnet_build_nested_tree($items, $item-&gt;ID, $tree[$item-&gt;ID]['children']);
        }
        // if the parent page has no children remove the node
        if (count($tree[$item-&gt;ID]['children']) == 0){
            unset($tree[$item-&gt;ID]['children']);
        }
    }   

    return $tree;
}
</pre>
<p>And not to forget a quick sample on how to use this</p>
<pre class="brush: php; title: ; notranslate">
$pages = get_pages('sort_column=menu_order');
$tree = thumnet_build_nested_tree($pages);
thumnet_display_nested_tree($tree);

function thumnet_display_nested_tree($items, $indent = 0){
    foreach ($items as $item){
        echo str_repeat('&amp;nbsp;', $indent*3) . (count($item['children']) ? '+' : '-') . ' ' . $item['self']-&gt;post_title . '&lt;br /&gt;';
        if (count($item['children'])) { thumnet_display_nested_tree($item['children'], $indent+1); }
    }
}
</pre>
<p>Sample output:</p>
<pre class="brush: plain; title: ; notranslate">
+ Welcome
   + Subpage with children
      - Child 1
      - Child two
   - Subpage without children
- Top level page without children
+ About
   - Who am I
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.thumnet.com/wordpress-pages-into-nested-tree-array/220/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome to the ThumNet blog!</title>
		<link>http://blog.thumnet.com/welcome-thumnet-blog/1/</link>
		<comments>http://blog.thumnet.com/welcome-thumnet-blog/1/#comments</comments>
		<pubDate>Thu, 14 May 2009 18:45:45 +0000</pubDate>
		<dc:creator>ThumNet</dc:creator>
				<category><![CDATA[Theme]]></category>
		<category><![CDATA[pixeled]]></category>
		<category><![CDATA[welcome]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.thumnet.com/?p=1</guid>
		<description><![CDATA[Welcome to the ThumNet blog. This is actually my first blog post ever, and I hope there are many more to follow! As most of you already concluded this blog is build with WordPress After the WordPress installation, which was very easy thanks to InstallaTron, I went looking for a theme. On the WordPress Themes &#8230; </p><p><a class="more-link block-button" href="http://blog.thumnet.com/welcome-thumnet-blog/1/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Welcome to the ThumNet blog.</p>
<p>This is actually my first blog post ever, and I hope there are many more to follow!</p>
<p>As most of you already concluded this blog is build with <a href="http://www.wordpress.org">WordPress</a></p>
<p>After the WordPress installation, which was very easy thanks to <a href="http://installatron.com/">InstallaTron</a>, I went looking for a theme. On the WordPress Themes page there was the blue <a href="http://wordpress.org/extend/themes/pixeled">Pixeled</a> theme (version 1.9.2) which I really like, but there is one small problem. The developer (<a href="http://samk.ca">Sam</a>) also created an earlier version of the pixeled theme (version 1.0) which was in green, but this wasn&#8217;t really up to date anymore. For this blog I wanted to give visitors the ability to choose between these two colors.</p>
<p>So I took the latest version of Sam&#8217;s theme and changed the following:</p>
<ul>
<li>copied both bgbody.png files into the images directory and renamed them accordingly</li>
<li>created two partial StyleSheets with specific color settings, which will be loading on top of to the default StyleSheet</li>
<li>picked up the styleswitcher.js file from <a href="http://www.alistapart.com/articles/alternate/">A List Apart</a>, which had to be updated because the attachEvent function isn&#8217;t cross browser compatible</li>
<li>finally  added the links to change the theme&#8217;s color in the header.php file</li>
</ul>
<p>The links to change the color are located at the top right of the page, next to the text &#8220;color&#8221;.</p>
<p>Sources for the multicolor pixeled theme will be available through Sam&#8217;s or this site, but I first have to contact Sam to show him the modifications and ask him what he likes to do with them.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thumnet.com/welcome-thumnet-blog/1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

