<?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>unsignedint &#187; WordPress</title>
	<atom:link href="http://unsignedint.net/blog/category/development/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://unsignedint.net/blog</link>
	<description>adding noise to the signal</description>
	<lastBuildDate>Sat, 10 Jul 2010 10:32:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Como obter o ID de um post dentro e fora do Loop do WordPress</title>
		<link>http://unsignedint.net/blog/2010/01/16/obter-id-de-um-post-no-wordpress/</link>
		<comments>http://unsignedint.net/blog/2010/01/16/obter-id-de-um-post-no-wordpress/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 11:46:29 +0000</pubDate>
		<dc:creator>lmmendes</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[post_id]]></category>

		<guid isPermaLink="false">http://www.unsignedint.net/blog/?p=342</guid>
		<description><![CDATA[Ultimamente tenho andado a fazer algumas modificações ao meu blog e surgiu-me a necessidade de obter o ID de um post fora do loop (The Loop) do WordPress: &#60;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&#62; Dentro do loop para obter o ID basta fazer o seguinte: $post->ID Já fora [...]]]></description>
			<content:encoded><![CDATA[<p>Ultimamente tenho andado a fazer algumas modificações ao meu blog e surgiu-me a necessidade de obter o ID de um post fora do <a href="http://codex.wordpress.org/The_Loop">loop (The Loop)</a> do WordPress:</p>
<pre name="code" class="php">
&lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt;
</pre>
<p>Dentro do <em>loop </em>para obter o ID basta fazer o seguinte:</p>
<pre name="code" class="php">
$post->ID
</pre>
<p>Já fora do <em>loop</em> para termos acesso ao ID do post vamos ter que aceder á variável global <em>$wp_query</em>, ou seja, para obtermos acesso ao ID do post:</p>
<pre name="code" class="php">
global $wp_query;
$wp_query->post->ID
</pre>
<p>É tão simples como isso, para saberem mais informação sobre o <em>$wp_query</em> consultem o <a href="http://codex.wordpress.org/Function_Reference/WP_Query">Codex aqui.</a></p>
<div class="shr-publisher-342"></div>]]></content:encoded>
			<wfw:commentRss>http://unsignedint.net/blog/2010/01/16/obter-id-de-um-post-no-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove WordPress iNove theme sidebar using custom fields</title>
		<link>http://unsignedint.net/blog/2010/01/16/hide-inove-wordpress-theme-sidebar-using-custom-fields/</link>
		<comments>http://unsignedint.net/blog/2010/01/16/hide-inove-wordpress-theme-sidebar-using-custom-fields/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 01:35:37 +0000</pubDate>
		<dc:creator>lmmendes</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[inove wordpress nosidebar]]></category>

		<guid isPermaLink="false">http://www.unsignedint.net/blog/?p=295</guid>
		<description><![CDATA[I&#8217;m using WordPress iNove theme v.1.4.6 and i needed a way to hide the sidebar for a specific post so i dove in the iNove theme code and figured out how to do this with the minimum changes to the original theme code. First open the iNove theme &#8216;header.php&#8217; file using your favorite editor, usually [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using <a href="http://wordpress.org/extend/themes/inove">WordPress iNove theme</a> v.1.4.6 and i needed a way to hide the sidebar for a specific post so i dove in the iNove theme code and figured out how to do this with the minimum changes to the original theme code.</p>
<p>First open the iNove theme &#8216;header.php&#8217; file using your favorite editor, usually found at <em>&lt;wp install folder&gt;/wp-content/themes/inove/header.php</em>.</p>
<p>Now look for this piece of code (starting from the top of the file):</p>
<pre name="code" class="php">
... some code ...
			$feed = 'http://' . $options['feed_url'];
		}
	} else {
		$feed = get_bloginfo('rss2_url');
	}
?&gt;
</pre>
<p><span id="more-295"></span><br />
Now append at the end of that code the following snippet:</p>
<pre name="code" class="php">
&lt;?php
    global $wp_query;
    if( get_post_meta( $wp_query->post->ID, 'nosidebar', 'true') ){
        $inove_nosidebar = true;
    }
?&gt;
</pre>
<p>You should get some thing like this:</p>
<pre name="code" class="php">
... some code ...
			$feed = 'http://' . $options['feed_url'];
		}
	} else {
		$feed = get_bloginfo('rss2_url');
	}
?&gt;

&lt;?php
    global $wp_query;
    if( get_post_meta( $wp_query->post->ID, '', 'true') ){
        $inove_nosidebar = true;
    }
?&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
</pre>
<p>Now when you need to disable the sidebar in a post you simply add  a new &#8216;Custom Field&#8217; named &#8216;nosidebar&#8217; and set it&#8217;s value to &#8216;true&#8217; like you see in the figure.</p>
<p><a href="http://www.unsignedint.net/blog/wp-content/uploads/2010/01/wp_nosidebar_custom_fields.png"><img src="http://www.unsignedint.net/blog/wp-content/uploads/2010/01/wp_nosidebar_custom_fields.png" alt="Wordpress setting &#039;nosidebar&#039; custom field" title="Wordpress &#039;nosidebar&#039; Custom Fields" width="582" height="233" class="alignnone size-full wp-image-320" /></a></p>
<p>Et voilà, all done! </p>
<div class="shr-publisher-295"></div>]]></content:encoded>
			<wfw:commentRss>http://unsignedint.net/blog/2010/01/16/hide-inove-wordpress-theme-sidebar-using-custom-fields/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

