<?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 Kode</title>
	<atom:link href="http://wpkode.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpkode.com</link>
	<description>Tips, code snippets and a bunch of stuff for WordPress</description>
	<lastBuildDate>Thu, 08 Oct 2009 19:22:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>The secret WordPress Options page</title>
		<link>http://wpkode.com/2009/10/the-secret-wordpress-options-page/</link>
		<comments>http://wpkode.com/2009/10/the-secret-wordpress-options-page/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 19:22:27 +0000</pubDate>
		<dc:creator>Moises Kirsch</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[options]]></category>
		<category><![CDATA[options.php]]></category>

		<guid isPermaLink="false">http://wpkode.com/?p=49</guid>
		<description><![CDATA[Here is a quick tip. If you enter the URL http://www.yourblog.com/wp-admin/options.php you&#8217;ll get a page with all the options that are stored in your database. From there you can see or edit anything instantly. Alltought on must cases is better to do it using the regular settings page, it is a very easy and fast [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick tip.</p>
<p>If you enter the URL <em>http://www.yourblog.com/wp-admin/options.php</em> you&#8217;ll get a page with all the options that are stored in your database. From there you can see or edit anything instantly.</p>
<p>Alltought on must cases is better to do it using the regular settings page, it is a very easy and fast way to check some of the small settings while working on something.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpkode.com/2009/10/the-secret-wordpress-options-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Declutter WordPress: Remove widgets from the WordPress Dashboard</title>
		<link>http://wpkode.com/2009/08/declutter-wordpress-remove-widgets-from-the-wordpress-dashboard/</link>
		<comments>http://wpkode.com/2009/08/declutter-wordpress-remove-widgets-from-the-wordpress-dashboard/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 17:26:39 +0000</pubDate>
		<dc:creator>Moises Kirsch</dc:creator>
				<category><![CDATA[Declutter]]></category>
		<category><![CDATA[dashboard]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[simplify]]></category>
		<category><![CDATA[widgets]]></category>
		<category><![CDATA[wp-admin]]></category>
		<category><![CDATA[wp_dashboard_setup]]></category>
		<category><![CDATA[wp_meta_boxes]]></category>

		<guid isPermaLink="false">http://wpkode.com/?p=44</guid>
		<description><![CDATA[For most users the WordPress Dashboard can be overwhelming. Recently I had to show a client how to add, remove and edit content using WordPress and as easy as it might seem, he was very confused with all the extra options that most users don&#8217;t understand or even use. So I decided to hide must [...]]]></description>
			<content:encoded><![CDATA[<p>For most users the WordPress Dashboard can be overwhelming.</p>
<p>Recently I had to show a client how to add, remove and edit content using WordPress and as easy as it might seem, he was very confused with all the extra options that most users don&#8217;t understand or even use.</p>
<p>So I decided to hide must of the stuff and simplify the administration panel as much as possible. To accomplish this, I used a few tricks that I&#8217;ll be posting about in a series of posts.</p>
<p>The first page that any user sees after log-in in is the Dashboard. It is full with technical news, WordPress related stuff and things that a lawyer or a doctor wouldn&#8217;t understand and they don&#8217;t even care.</p>
<p>So the first thing that I did was to remove everything from that screen.</p>
<pre class="brush: plain; title: ; notranslate">
// Remove Dashboard Widgets
function remove_dashboard_widgets(){

// Globalize the metaboxes array that holds all the widgets for wp-admin
global $wp_meta_boxes;

// Unset the unwanted widgets
// unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
}

// Hoook into the 'wp_dashboard_setup' action to register our function
add_action('wp_dashboard_setup', 'remove_dashboard_widgets');
</pre>
<p>You could even create an IF statement and only hide this from certain user role.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpkode.com/2009/08/declutter-wordpress-remove-widgets-from-the-wordpress-dashboard/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>An even better body_class for WordPress</title>
		<link>http://wpkode.com/2009/07/an-even-better-body_class-for-wordpress/</link>
		<comments>http://wpkode.com/2009/07/an-even-better-body_class-for-wordpress/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 06:11:53 +0000</pubDate>
		<dc:creator>Moises Kirsch</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[body_class]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[WordPress 2.8]]></category>

		<guid isPermaLink="false">http://wpkode.com/?p=39</guid>
		<description><![CDATA[Here is a little update to my better body_class code: So what does this thing do? It adds a the slug of the current page to the class just like the old one but it also combines Nathan Rice code for browser detection with even a little extra class called notie a.k.a. Not Internet Explorer. [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a little update to my <a href="http://wpkode.com/2009/06/a-better-body_class-for-wordpress-2-8/">better body_class code</a>:</p>
<pre class="brush: php; title: ; notranslate">
add_filter('body_class','better_body_class');
function better_body_class($classes){
	global $post, $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;
	if($is_lynx){
		$classes[] = 'lynx';
		$classes[] = 'notie';
	}
	elseif($is_gecko){
		$classes[] = 'gecko';
		$classes[] = 'notie';
	}
	elseif($is_opera){
		$classes[] = 'opera';
		$classes[] = 'notie';
	}
	elseif($is_NS4){
		$classes[] = 'ns4';
		$classes[] = 'notie';
	}
	elseif($is_safari){
		$classes[] = 'safari';
		$classes[] = 'notie';
	}
	elseif($is_chrome){
		$classes[] = 'chrome';
		$classes[] = 'notie';
	}
	elseif($is_IE){
		$classes[] = 'ie';
	}
	elseif($is_iphone){
		$classes[] = 'iphone';
		$classes[] = 'notie';
	}
	else $classes[] = 'unknown';
	$other_classes = explode('/', get_page_uri($post-&gt;ID));
	return array_merge($classes, $other_classes);
}
</pre>
<p>So what does this thing do?</p>
<p>It adds a the slug of the current page to the class just like the old one but it also combines <a href="http://www.nathanrice.net/blog/browser-detection-and-the-body_class-function/">Nathan Rice code for browser detection</a> with even a little extra class called <code>notie</code> a.k.a. <strong>Not Internet Explorer</strong>.</p>
<p>The notie class is very useful when you are debugging your CSS and trying to fix all the annoying things that IE doesn&#8217;t get right.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpkode.com/2009/07/an-even-better-body_class-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Use a thumbnail (or feature image) for your post automatically</title>
		<link>http://wpkode.com/2009/06/use-a-thumbnail-or-feature-image-for-your-post-automatically/</link>
		<comments>http://wpkode.com/2009/06/use-a-thumbnail-or-feature-image-for-your-post-automatically/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 04:34:40 +0000</pubDate>
		<dc:creator>Moises Kirsch</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Images]]></category>
		<category><![CDATA[attachments]]></category>
		<category><![CDATA[get_children]]></category>
		<category><![CDATA[thumbnails]]></category>

		<guid isPermaLink="false">http://wpkode.com/?p=25</guid>
		<description><![CDATA[Instead of creating thumbnails or special images for each post, I found that it is better to upload a full size image and then have it resized on the server on the fly (with some type of cache mechanism of course). For this, I usually use a script such as Smart Image Resizer working together [...]]]></description>
			<content:encoded><![CDATA[<p>Instead of creating thumbnails or special images for each post, I found that it is better to upload a full size image and then have it resized on the server on the fly (with some type of cache mechanism of course).</p>
<p>For this, I usually use a script such as <a href="http://shiftingpixel.com/2008/03/03/smart-image-resizer/">Smart Image Resizer</a> working together with the following code in my funtions.php file:</p>
<pre class="brush: php; title: ; notranslate">
function get_first_image($id){
	$attachments = get_children( array(
		'post_parent' =&gt; $id,
		'post_status' =&gt; 'inherit',
		'post_type' =&gt; 'attachment',
		'post_mime_type' =&gt; 'image',
		'order' =&gt; 'ASC',
		'orderby' =&gt; 'menu_order ID'
	));

	// If the post has no image return a default
	if(empty($attachments)){
		return get_bloginfo('template_directory').'/images/default.jpg';
	}
	else{
		$attachment = current($attachments);
		return $attachment-&gt;guid;
	}
}
</pre>
<p>Then you use the Smart Image Resizer inside the loop like this:</p>
<pre class="brush: php; title: ; notranslate">
&lt;img src=&quot;&lt;?php echo get_bloginfo('template_directory').'/images/image.php?width=200&amp;amp;height=200&amp;amp;cropratio=1:1&amp;amp;image='.get_first_image($post-&gt;ID); ?&gt;&quot; alt=&quot;The Great Image&quot; /&gt;
</pre>
<p>This example would display a 200 pixels squared thumbnail of the first image attached to the post.</p>
<p>With this technique you could display your posts in tons of different way&#8230; you can mix it up with some CSS for backgrounds, with some javascript to create a slider or a carousel, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpkode.com/2009/06/use-a-thumbnail-or-feature-image-for-your-post-automatically/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A better body_class for WordPress 2.8</title>
		<link>http://wpkode.com/2009/06/a-better-body_class-for-wordpress-2-8/</link>
		<comments>http://wpkode.com/2009/06/a-better-body_class-for-wordpress-2-8/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 19:17:45 +0000</pubDate>
		<dc:creator>Moises Kirsch</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[body_class]]></category>
		<category><![CDATA[tags]]></category>
		<category><![CDATA[WordPress 2.8]]></category>

		<guid isPermaLink="false">http://wpkode.com/?p=3</guid>
		<description><![CDATA[WordPress 2.8 introduced a very useful new tag called body_class which normally will be used like this: The only problem is that it uses the ID&#8217;s instead of the page slugs making it a little harder to use the classes on your CSS (or Javascript). A very easy way to fix this is to call [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress 2.8 introduced a very useful new tag called <a href="http://www.nathanrice.net/blog/wordpress-2-8-and-the-body_class-function/">body_class</a> which normally will be used like this:</p>
<pre class="brush: php; title: ; notranslate">&lt;body &lt;?php body_class(); ?&gt;&gt;</pre>
<p>The only problem is that it uses the ID&#8217;s instead of the page slugs making it a little harder to use the classes on your CSS (or Javascript).</p>
<p>A very easy way to fix this is to call the function with an argument like this:</p>
<pre class="brush: php; title: ; notranslate">&lt;body &lt;?php body_class( str_ireplace( '/', ' ', get_page_uri($post-&gt;ID) ) ); ?&gt;&gt;</pre>
<p>What we are doing is adding the permalink structure as classes. That way you could target all the pages with the same parent, from the same category or so on without needing to know the ID. This is great if you are developing a theme and there is no way for you to know the ID of certain category or page.</p>
]]></content:encoded>
			<wfw:commentRss>http://wpkode.com/2009/06/a-better-body_class-for-wordpress-2-8/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://wpkode.com/2009/06/hello-world/</link>
		<comments>http://wpkode.com/2009/06/hello-world/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 19:02:21 +0000</pubDate>
		<dc:creator>Moises Kirsch</dc:creator>
				<category><![CDATA[WP Kode]]></category>

		<guid isPermaLink="false">http://wpkode.com/?p=1</guid>
		<description><![CDATA[Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!]]></description>
			<content:encoded><![CDATA[<p>Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!</p>
]]></content:encoded>
			<wfw:commentRss>http://wpkode.com/2009/06/hello-world/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

