<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Valen Designs</title>
	
	<link>http://valendesigns.com</link>
	<description>Build Market Empower</description>
	<lastBuildDate>Mon, 26 Jul 2010 12:07:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/ValenDesigns" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="valendesigns" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Envato Marketplace Items</title>
		<link>http://valendesigns.com/wordpress/envato-marketplace-items/</link>
		<comments>http://valendesigns.com/wordpress/envato-marketplace-items/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 11:55:25 +0000</pubDate>
		<dc:creator>Derek Herman</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Envato]]></category>
		<category><![CDATA[Free]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://valendesigns.com/?p=606</guid>
		<description><![CDATA[The Envato Marketplace Items plugin retrieves items from an Envato Marketplace and API set of your choice, then caches those results in your WordPress database before finally displaying the results as an image gallery of 80px square thumbnails. 
You can view examples of what the plugin does by checking out the sidebar of any Envato [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://valendesigns.com/wp-content/uploads/2009/10/marketplace.jpg" alt="marketplace" title="marketplace" width="460" height="120" class="alignnone size-full wp-image-607" />The <a href="http://wordpress.org/extend/plugins/envato-marketplace-items/" rel="external">Envato Marketplace Items</a> plugin retrieves items from an Envato Marketplace and API set of your choice, then caches those results in your WordPress database before finally displaying the results as an image gallery of 80px square thumbnails. </p>
<p>You can view examples of what the plugin does by checking out the sidebar of any Envato Marketplace blog and look at the <strong>Popular Files</strong> section. A quick note, the code for those sections is in the functions.php and it is not currently using this new plugin, but they are basically the same code just less option oriented since we only need them to use one API set and not pull from multiple ones.</p>
<p>EDIT: I added it to my sidebar so you can see it right here in action.</p>
<h3>Installation</h3>
<ul class="notebook-ul">
<li>Upload the envato-marketplace-itmes folder to the /wp-content/plugins/ directory</li>
<li>Activate the plugin through the Plugins menu in WordPress</li>
<li>Anywhere on your blog you would like to see the thumbnail gallery add the following code to you theme files (sidebar.php recommended).</li>
</ul>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</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;">'envato_marketplace_items'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
  envato_marketplace_items<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: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<h3>Download File</h3><ul class="notebook-file"><li><a title="Download File" href="http://downloads.wordpress.org/plugin/envato-marketplace-items.1.0.3.zip">Envato Marketplace Items</a></li></ul> <h3>Donations</h3><ul class="notebook-donate"><li>Make a <a class="donateLink" href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=accounts@valendesigns.com&item_name=Donation+for+Code+Snippet" rel="external">donation</a> and help keep the awesomeness flowing.</li></ul> <h3>Disclaimer</h3><div class="disclaimer"><p>Valen Designs grants you a nonexclusive copyright license to use all programming code examples from which you can generate similar function tailored to your own specific needs.</p> <p>Valen Designs, cannot guarantee or imply reliability, serviceability, or function of these programs.</p> <p>All programs contained herein are provided to you "AS IS" without any warranties of any kind. The implied warranties of non-infringement, merchantability and fitness for a particular purpose are expressly disclaimed.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://valendesigns.com/wordpress/envato-marketplace-items/feed/</wfw:commentRss>
		<slash:comments>55</slash:comments>
		</item>
		<item>
		<title>The New Creattica Daily</title>
		<link>http://valendesigns.com/news/the-new-creattica-daily/</link>
		<comments>http://valendesigns.com/news/the-new-creattica-daily/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 01:07:28 +0000</pubDate>
		<dc:creator>Derek Herman</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Envato]]></category>
		<category><![CDATA[SimplePie]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[Upgrade]]></category>

		<guid isPermaLink="false">http://valendesigns.com/?p=592</guid>
		<description><![CDATA[
Creattica Daily has gotten a pretty sweet makeover, not that it wasn&#8217;t already awesome. Collis (CEO of Envato) was itching to try out a new larger 1200px wide design, and one that will pretty much update and maintain itself without the need to post daily roundups or cost tons of cash since the site has [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://valendesigns.com/wp-content/uploads/2009/07/creattica-daily-top.jpg" alt="creattica-daily-top" title="creattica-daily-top" width="460" height="120" class="alignnone size-full wp-image-593" /><br />
<a href="http://daily.creattica.com" rel="external">Creattica Daily</a> has gotten a pretty sweet makeover, not that it wasn&#8217;t already awesome. Collis (CEO of Envato) was itching to try out a new larger 1200px wide design, and one that will pretty much update and maintain itself without the need to post daily roundups or cost tons of cash since the site has not been very profitable. Don&#8217;t worry though, the Creative License comic will still be going strong for all who enjoy some good clean humor. As well, there will continue to be plenty of content to sink your teeth into, it will just be pulled from various sources around the web vs. manual submission.</p>
<h3>SimplePie, Oh Yeah!</h3>
<p>Yes, we are using the amazing <a href="http://simplepie.org/" rel="external">SimplePie</a> feed parser to aggregate feeds and give you fresh daily links, images, and even twitter updates with the ability to paginate all the content independently and at the same time. By &#8220;at the same time&#8221; I mean you can paginate one section and it will not loose the place of the other section. Just a little added bonus I thought might be good to have. Also, I opted to not use the WordPress plugin for SimplePie due to it&#8217;s restrictive feel, I needed to do some very customized code and the plugin was getting in the way.</p>
<p>I have to say that this was by far the most complex and interesting use of SimplePie I have ever created. Normally you would not use SimplePie to pull twitter updates because the RSS output is void of any links but with a little PHP string manipulation everything is working perfectly (I hope) and the main thing is we can paginate the updates; I&#8217;ve yet to see a JavaScript version that can paginate twitter forward and back.</p>
<h3>Snapshot</h3>
<p><img src="http://valendesigns.com/wp-content/uploads/2009/07/creattica-daily-bottom.jpg" alt="creattica-daily-bottom" title="creattica-daily-bottom" width="460" height="800" class="alignnone size-full wp-image-594" /></p>
<h3>Some Final Words</h3>
<p>Well, I hope you enjoy the new site and I am very interested to see if the new larger design is going to be a hit or not. Also, to clarify only 8% of the users who visit <a href="http://daily.creattica.com" rel="external">Creattica Daily</a> have a screen that is not 1200px or above. So, this was the perfect place to test out this kind of design.</p>
]]></content:encoded>
			<wfw:commentRss>http://valendesigns.com/news/the-new-creattica-daily/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>A Sneak Peak of the New Freelance Switch!</title>
		<link>http://valendesigns.com/news/a-sneak-peak-of-the-new-freelance-switch/</link>
		<comments>http://valendesigns.com/news/a-sneak-peak-of-the-new-freelance-switch/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 00:47:06 +0000</pubDate>
		<dc:creator>Derek Herman</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Custom]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Launch]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[Upgrade]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://valendesigns.com/?p=553</guid>
		<description><![CDATA[
UPDATE: Sites Live&#8230; 
After many months of hard work, Collis Ta&#8217;eed (design), Mathias Meyer (Rails), and I have reached the final stages in pre-launch testing for the new Freelance Switch. Within a week or two we will have thoroughly tested the staging site to account for what I&#8217;m hoping is almost all bugs. The site [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://valendesigns.com/wp-content/uploads/2009/05/freelance_switch_teaser.jpg" alt="freelance_switch_teaser" title="freelance_switch_teaser" width="460" height="120" class="alignnone size-full wp-image-554" /><br />
UPDATE: Sites Live&#8230; </p>
<p>After many months of hard work, Collis Ta&#8217;eed (design), Mathias Meyer (Rails), and I have reached the final stages in pre-launch testing for the new Freelance Switch. Within a week or two we will have thoroughly tested the staging site to account for what I&#8217;m hoping is almost all bugs. The site is the mashup of three different applications and a seriously cool plugin. Below I&#8217;ll let you in on what technologies we used to build this very awesome web site.</p>
<h3>Blog &amp; Plugin</h3>
<p>For the blog and most of the sites regular content (i.e. contact, about, etc.) I built a WordPress theme that is extremely custom and sexy. In addition to the WordPress theme there are a number of custom &amp; downloaded plugins but only one that really is worth mentioning, an improved version of the Community Links plugin you see at Psd.tuts+ or any of the other tuts+ sites. The plugin works in a similar fashion as the old one but allows the user to upload an image and associate a category with the link. Now everything will be categories and have a thumbnail next to it, nice right?</p>
<h3>Forum</h3>
<p>Here we used BBpress and a custom theme I coded to match the blog. However, I also had to re-create many of the functions that BBpress comes with to change the output because the theme was not going to show content in a tabular style so I had to un-table the forum. A bit of extra work but well worth it in the end.</p>
<h3>Job Board &amp; Freelance Directory</h3>
<p>The very talented Mathias Meyer build the backend of this amazing Rails app, my job was to skin it. In the end the old job board got a new makeover and had a directory of freelancer added to it. Some amazing stuff, the addition of the directory is going to be huge in my opinion, but I&#8217;ll let you guys be the judge. </p>
<h3>All Together</h3>
<p>In the end, the Rails app and forum are bridged together so they will share user info between the two databases. As well, the search feature in the header is something I really enjoyed creating. You can choose from a drop down list of different section that you want to submit your search to and the form will will return the proper output based on your query. Basically, you can choose to search between the blog, forum, resources, jobs, directory, and podcasts. Anyhow, the site should be live very soon and ready for feedback and blissful enjoyment. This is really just a teaser to whet your appetite, so hold out cause the real thing is coming shortly to a computer screen near you.</p>
]]></content:encoded>
			<wfw:commentRss>http://valendesigns.com/news/a-sneak-peak-of-the-new-freelance-switch/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>4 Reasons to use Web Standards</title>
		<link>http://valendesigns.com/general/4-reasons-to-use-web-standards/</link>
		<comments>http://valendesigns.com/general/4-reasons-to-use-web-standards/#comments</comments>
		<pubDate>Fri, 29 May 2009 20:54:18 +0000</pubDate>
		<dc:creator>Derek Herman</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Strict]]></category>
		<category><![CDATA[Valid]]></category>
		<category><![CDATA[W3C]]></category>
		<category><![CDATA[Web Standards]]></category>

		<guid isPermaLink="false">http://valendesigns.com/?p=366</guid>
		<description><![CDATA[
First, lets start with some sort of definition of what Web standards are. In my best effort to encompass the concept in a short phrase, Web standards are the guidelines most widely accepted on the World Wide Web. These guidelines are to ensure that the web sites someone like me builds are created in a [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-367" title="Web Standards" src="http://valendesigns.com/wp-content/uploads/2009/03/web_standards.jpg" alt="Web Standards" width="460" height="120" /><br />
First, lets start with some sort of definition of what Web standards are. In my best effort to encompass the concept in a short phrase, Web standards are the guidelines most widely accepted on the World Wide Web. These guidelines are to ensure that the web sites someone like me builds are created in a way to allow the information to be accessible and to as many people in the most efficient manner. By that I mean you separate the content from the presentation so anyone who needs to view, or in some cases listen to your web site, can do so without any effort on their part.</p>
<p>A quick history reveals that Web standards are the brainchild of the World Wide Web Consortium (W3C), which was founded by Sir Timothy John Berners-Lee, who has also been credited with inventing the internet. That guy seems to be getting around. Anyhow, the idea behind standardization is to make it possible for all of us to be building off the same set of blueprints in a way. For example, if you know what the standard is for how to write HTML, XHTML or CSS then you can write code that will be both valid and superior to the old bloated circa 1996 style of nested tables (you know who you are) and helps ensure your site is accessible to the largest possible audience. Some points I want to touch on below encompass just a few of the things that make standards great from a self serving standpoint. If you want to know some of the reasons standards will help you, and in the process your audience, read on.</p>
<h3>1. Search Engine Exposure</h3>
<p>One of the most important reason to use standards is search traffic. Search engines such as Google actually rank valid code higher than invalid crappy code. I don&#8217;t know about you, but to me that&#8217;s a pretty big deal. Especially if your main source of income is your freelance job and the referrals that search traffic might bring your way. Research shows that the leaner and cleaner your code is written the better search engines can index the content inside the site and start sending you traffic. However, if you are using a lot of images for text, then you really should be using the alt and title tag to the fullest to counteract the negative effects that can have on your rank. Seriously, let people know what they are seeing, if for some reason they&#8217;re not seeing it. It&#8217;s so important to not have a broken image, but if you must, make it accessible. </p>
<h3>2. You Become Elite</h3>
<p>Anyone who has worked hard for something in their life knows that if you follow directions and practice you&#8217;ll eventually become better at whatever it is you&#8217;re trying to do. The same thing is true when you follow web standards; you become a better web developer. Don&#8217;t hold yourself back by trying to learn everything on your own. Follow some guidelines and you&#8217;ll thank yourself later when you run into some obscure bug that only effects a certain browser because the nested &lt;ul&gt; tag is out of place. Trust me, I&#8217;ve been there. If you can learn to spot the waldo in a sea of red you&#8217;re on your way to becoming a pro.</p>
<h3>3. Your Impact on the Virtual World is Positive</h3>
<p>Karma isn&#8217;t just some guy named Earl running around making up for all the bad things he&#8217;s done? It also about you or me just being a good citizen and the internet is no different, there are good and bad citizens all over the place. Bottom line, don&#8217;t be a jackass and plague the internet with crappy code, it&#8217;s just good Karma to do the right thing. And to tell you the truth, I feel a great sense of accomplishment when the Markup Validation returns green! I feel like I did something good for the internet and instantly want to strike my Captain Morgan pose. Anyhow, I&#8217;ve learned that good things happen to people who continually do good things. Standards are good, so do it for your rent and some new shit. God knows you need another pair of shoes. </p>
<h3>4. It&#8217;s marketable</h3>
<p>Telling people you follow web standards is a selling point, and it makes you sound cool LOL. But really, if you know what you are doing and walk and talk like a pro chances are people will take what you say with some serious thought. It&#8217;s a fact that web standards are going to teach you how to be better at what you do and therefore make you more money. So you can buy shit! Or blow it on Computers like me. Really what it boils down to is you need to be able to write clean well thought out code or you will not make it very far in this business for very long.</p>
<p>In summary, use good clean code and get paid cold hard cash dollars for being such an elite web ninja! Seriously though, standards are awesome and you should try to adopt as many as you can. Granted, it is unrealistic to think you will use them all because it would be super difficult to abide by every rule, but it&#8217;s reasonable to assume you can create valid code all the time. And&#8230; sales pitch finished.</p>
]]></content:encoded>
			<wfw:commentRss>http://valendesigns.com/general/4-reasons-to-use-web-standards/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Added Plugin to WordPress Directory</title>
		<link>http://valendesigns.com/news/added-plugin-to-wordpress-directory/</link>
		<comments>http://valendesigns.com/news/added-plugin-to-wordpress-directory/#comments</comments>
		<pubDate>Fri, 29 May 2009 14:21:47 +0000</pubDate>
		<dc:creator>Derek Herman</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Upgrade]]></category>

		<guid isPermaLink="false">http://valendesigns.com/?p=518</guid>
		<description><![CDATA[
I recently added an updated version of the is_page_or_sub() function now called is_page_or_ancestor() to the plugins directory over at WordPress.org. The new version of the function is a recursive test to see if the page ID or name you pass into the function is actually the current page or one of its ancestors. Basically you [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://valendesigns.com/wp-content/uploads/2009/05/is-page-or-ancestor.jpg" alt="is-page-or-ancestor" title="is-page-or-ancestor" width="460" height="120" class="alignnone size-full wp-image-522" /><br />
I recently added an updated version of the is_page_or_sub() function now called is_page_or_ancestor() to the plugins directory over at WordPress.org. The new version of the function is a recursive test to see if the page ID or name you pass into the function is actually the current page or one of its ancestors. Basically you can test to see if you are viewing an ancestor of the About page and if so execute some code (i.e. change a pages class or id).</p>
<p>I use this function on my site and pretty much on every other site I&#8217;ve ever built. However, the only different is this new code is leaner and will test many levels deep. A very handy tool for the custom type themes that seem to be popping up in the wake of what I am calling a WordPress feeding frenzy. The popularity of this platform has been growing exponentially and who can blame it, I absolutely love working with WordPress.</p>
<p>Anyhow, this is the first plugin I have submitted to be hosted in the Directory, mostly I just wanted to test out committing a plugin to the directory and this seemed like a logical place to start. If you&#8217;re interested in what was changed here is the code. Also, you can update the old functions code with this much better code.</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
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * The parameter can contain the page ID, or page name
 *
 * @since 1.0
 * @uses $post
 * @uses $wpdb
 *
 * @param mixed $page either int or string
 * @return bool
 */</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'is_page_or_ancestor'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">function</span> is_page_or_ancestor<span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> 
  <span style="color: #009900;">&#123;</span> 
    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$post</span><span style="color: #339933;">,</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// If is not numeric get page ID</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_numeric</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$page</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_var</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT ID FROM <span style="color: #006699; font-weight: bold;">$wpdb-&gt;posts</span> WHERE post_name = '&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$page</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;' AND post_type = 'page'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Recursive search through page hierarchy</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> is_page<span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">is_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ancestors</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span><span style="color: #339933;">,</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ancestors</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h3>Sample Usage</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_page_or_ancestor<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'about'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
    DISPLAY SOMETHING
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    DISPLAY SOMETHING DIFFERENT
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h3>Download File</h3><ul class="notebook-file"><li><a title="Download File" href="http://downloads.wordpress.org/plugin/is-page-or-ancestor.zip">Version 1.1</a></li></ul> <h3>Donations</h3><ul class="notebook-donate"><li>Make a <a class="donateLink" href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=accounts@valendesigns.com&item_name=Donation+for+Code+Snippet" rel="external">donation</a> and help keep the awesomeness flowing.</li></ul> <h3>Disclaimer</h3><div class="disclaimer"><p>Valen Designs grants you a nonexclusive copyright license to use all programming code examples from which you can generate similar function tailored to your own specific needs.</p> <p>Valen Designs, cannot guarantee or imply reliability, serviceability, or function of these programs.</p> <p>All programs contained herein are provided to you "AS IS" without any warranties of any kind. The implied warranties of non-infringement, merchantability and fitness for a particular purpose are expressly disclaimed.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://valendesigns.com/news/added-plugin-to-wordpress-directory/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Is Category or Subcategory WP Function</title>
		<link>http://valendesigns.com/wordpress/is-category-or-subcategory-wp-function/</link>
		<comments>http://valendesigns.com/wordpress/is-category-or-subcategory-wp-function/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 10:26:59 +0000</pubDate>
		<dc:creator>Derek Herman</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Category]]></category>
		<category><![CDATA[Child]]></category>
		<category><![CDATA[Functions]]></category>
		<category><![CDATA[Parent]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://valendesigns.com/?p=508</guid>
		<description><![CDATA[
Here is another great WordPress function to test if you are in a subcategory or the actual parent category and if so return true. This function is pretty much identical in concept to the is_page_or_sub() function I released previously. However, it just tests categories and not pages. Also, the code is significantly different since there [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://valendesigns.com/wp-content/uploads/2009/04/is_category_or_sub.jpg" alt="Is Category or Subcategory Function" title="Is Category or Subcategory Function" width="460" height="120" class="alignnone size-full wp-image-511" /><br />
Here is another great WordPress function to test if you are in a subcategory or the actual parent category and if so return true. This function is pretty much identical in concept to the is_page_or_sub() function I released previously. However, it just tests categories and not pages. Also, the code is significantly different since there are a few more available pre existing function we can build upon here.</p>
<p>For example, the cat_is_ancestor_of() function comes in really handy and does a lot of the heavy lifting for this simple but very powerful function. I use this very function to build complex category based navigation and test for active states and use the appropriate CSS in the change we&#8217;re actually in one of the categories we&#8217;re testing for. If you have question feel free to ask by commenting below and enjoy mastering WordPress! </p>
<h3>The Function</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// If is category or subcategory of $cat_id</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'is_category_or_sub'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">function</span> is_category_or_sub<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cat_id</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span>get_the_category<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$cat</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: #000088;">$cat_id</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$cat</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cat_ID</span> <span style="color: #339933;">||</span> cat_is_ancestor_of<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cat_id</span><span style="color: #339933;">,</span> <span style="color: #000088;">$cat</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span>
	    <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h3>Sample Usage</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_category_or_sub<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
    DISPLAY SOMETHING
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    DISPLAY SOMETHING DIFFERENT
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h3>Donations</h3><ul class="notebook-donate"><li>Make a <a class="donateLink" href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=accounts@valendesigns.com&item_name=Donation+for+Code+Snippet" rel="external">donation</a> and help keep the awesomeness flowing.</li></ul> <h3>Disclaimer</h3><div class="disclaimer"><p>Valen Designs grants you a nonexclusive copyright license to use all programming code examples from which you can generate similar function tailored to your own specific needs.</p> <p>Valen Designs, cannot guarantee or imply reliability, serviceability, or function of these programs.</p> <p>All programs contained herein are provided to you "AS IS" without any warranties of any kind. The implied warranties of non-infringement, merchantability and fitness for a particular purpose are expressly disclaimed.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://valendesigns.com/wordpress/is-category-or-subcategory-wp-function/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>Valen Designs Gets an Overhaul!</title>
		<link>http://valendesigns.com/news/valen-designs-gets-an-overhaul/</link>
		<comments>http://valendesigns.com/news/valen-designs-gets-an-overhaul/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 10:45:04 +0000</pubDate>
		<dc:creator>Derek Herman</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Custom]]></category>
		<category><![CDATA[Functions]]></category>
		<category><![CDATA[Launch]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[Upgrade]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://valendesigns.com/?p=330</guid>
		<description><![CDATA[
I&#8217;m very happy to announce the redesign. Over the past year or so since the last update things have really been progressing and my portfolio is looking very respectable with a few projects that I am very happy to be a part of. However, I have been so busy that the simple task of launching [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://valendesigns.com/wp-content/uploads/2009/03/new_design.jpg" alt="New Designs" title="New Designs" width="460" height="120" class="alignnone size-full wp-image-335" /><br />
I&#8217;m very happy to announce the redesign. Over the past year or so since the last update things have really been progressing and my portfolio is looking very respectable with a few projects that I am very happy to be a part of. However, I have been so busy that the simple task of launching a new and improved version of this site has been something of a challenge. I wanted to completely rewrite the code and make the design as awesome as I could with the spare time I had, but I also wanted to keep the logo and expand on the colors and not change the overall feel of the site. As far as I can tell from my extremely biased eyes things are looking good and the enhancements convey my vision.</p>
<p>The code behind this WordPress web site is very custom to say the least and I took every chance to build upon my personal WordPress functions library. Some of the code behind the site I will be sharing in a few articles over the next few weeks. But to give you an idea of what powers this site is a short list of features I have cooked up. But before I go to far into this I have to say that I removed probably 20 or so pages if you&#8217;ve been here before and are wondering, basically the whole services section was removed because most people, based on my analytics, only want to see the portfolio section anyhow. As well, I&#8217;m trying to focus mostly on WordPress based projects for a while. Not to say I will automatically turn something down it&#8217;s just what I excel at. WordPress themes, plugins, and functions with some sexy designs for good measure. Moving on.</p>
<h3>The XHTML/CSS</h3>
<p>100% valid, if you find a page that doesn&#8217;t validate please I encourage you to let me know. I am a big stickler for valid semantic code and do my best in client projects but you can&#8217;t always control what people do after you build the thing. So for that very reason I make damn sure my site is valid. I always write my code in XHTML 1.0 Strict. It&#8217;s very important to me that you separate the content from the presentation and only use tables for tabular content. However, you will find that I use some CSS3 that will not validate but I keep it in a file names invalid.css which is basically the rounded borders you see scattered around the site.</p>
<h3>The WordPress</h3>
<p>In the functions.php file for this WordPress theme you&#8217;d find some serious hidden gems. I have for example, a function that queries my portfolio page and finds all of it&#8217;s children and allows me to dynamically pull information from them and display it back as a gallery of thumbnail images, titles and a short descriptions for each child. In addition to never having to update my portfolio page because it&#8217;s completely dynamic, I can also use the same code to show the last two projects in my portfolio on the home page. Basically, it drastically reduces the amount of work needed to maintain a portfolio web site without turning my pages into blog posts like many of the other themes you find on the internet. I think it&#8217;s important to separate your blog posts from your pages. It&#8217;s just seems unnatural to me to try and fool your blog into being two things at the same time., but that&#8217;s just my opinion.</p>
<p>Another great feature that I wrote a while back and refined into what it is now, is the ability to know if you are on a certain page or any of it&#8217;s children, including grandchildren. With that, you can do some pretty sweet conditional stuff like show only certain scripts on a set of pages or maybe a different sidebar than regular pages have. Also, I did the same thing for categories. The functions are: is_category_or_sub() and is_page_or_sub() and work just like their WordPress counterparts is_page() and is_category(), but just with the added ability to check if it&#8217;s a child, as well. Something that I think WordPress is seriously lacking and should consider adding to the core. </p>
<p>There is tons of things I could go into that make up this theme and it&#8217;s very custom little bits but I&#8217;ll save some for a tutorial or two very shortly. If you want to see the <a href="http://valendesigns.com/wordpress/is-page-or-subpage-wordpress-function/">is_page_or_sub();</a> functions I wrote about that the other day.</p>
<h3>The JavaScript</h3>
<p>Oh yes, I use a lot of custom written JavaScript piggy backed on the fantastic jQuery library. It&#8217;s such an awesome library that you would have to be blind not to see how fantastic it is. Anyhow, The forms are AJAX driven with a custom tooltips script that displays a little extra info to direct my users and help to make the form data a little more meaningful. And the form will work with JavaScript turned off, which is extremely important if you want to make sure people can contact you regardless of if they want to be anti awesome or not.  </p>
<p>A feature that I&#8217;m really proud to have on my site is on the home page. It&#8217;s not blindingly noticeable but if you click one of the three large images in the header they rotate in both right and left directions. A very sweet effect if I say so myself. Subtle, but if for some reason you get the feeling to click one of those images you&#8217;re not disappointing. </p>
<p>In summation I love the new site and am extremely happy to roll it out for everyone to critique and hopefully enjoy. I hope you love it as much as I do and if you don&#8217;t, well that&#8217;s just OK, I can live with that.</p>
]]></content:encoded>
			<wfw:commentRss>http://valendesigns.com/news/valen-designs-gets-an-overhaul/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Is The MacBook Missing Something?</title>
		<link>http://valendesigns.com/reviews/is-the-macbook-missing-something/</link>
		<comments>http://valendesigns.com/reviews/is-the-macbook-missing-something/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 07:33:45 +0000</pubDate>
		<dc:creator>Derek Herman</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Computer]]></category>
		<category><![CDATA[Firewire]]></category>
		<category><![CDATA[Laptop]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Review]]></category>

		<guid isPermaLink="false">http://valendesigns.com/?p=414</guid>
		<description><![CDATA[
More people are using Macs as their personal computer of choice these days. Mac has effectively marketed itself as the all-your-bases-are-covered computer brand and are supposed to be powerful and easy to work with.
Well, that whole notion hit a speed bump with their newest line of MacBooks. The mid-range MacBook (as opposed to the MacBook [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://valendesigns.com/wp-content/uploads/2009/03/macbook.jpg" alt="Mac Book" title="Mac Book" width="460" height="120" class="alignnone size-full wp-image-415" /><br />
More people are using Macs as their personal computer of choice these days. Mac has effectively marketed itself as the all-your-bases-are-covered computer brand and are supposed to be powerful and easy to work with.</p>
<p>Well, that whole notion hit a speed bump with their newest line of MacBooks. The mid-range MacBook (as opposed to the MacBook Pro or the white base model) is missing a Firewire port. Firewire, or IEEE 1394, is a faster way to transfer data between computers or peripherals. USB 2.0 does perform most of the same functions at a slightly lower speed than Firewire 400. However, until about two years ago, nearly all consumer level camcorders were Firewire only, and not USB.</p>
<p>As this realization began to sink among consumers, outrage emerged across the blogosphere and among shoestring-budget creatives. For the family wanting to edit their home video, they would now have to decide whether to upgrade to the MacBook Pro, a $700 jump; downgrade to the white 13-inch Macbook, which has less drive space and less upgradability; or buy a new camcorder that has USB 2.0 connectivity, an extra couple hundred dollars out of pocket.</p>
<p>Admittedly, times do change, and technology with it, but this particular shift was neither smooth nor were consumers really prepped for the transition. It just happened, which left Apple fending off complaints left and right.</p>
<p>In the end, Apple CEO Steve Jobs just laid it out there: &#8220;Actually, all of the new HD camcorders of the past few years use USB 2.&#8221; And some argue that the MacBook is not what should be used to edit video, mix down multi-track audio, and do other niche tasks usually performed by professionals. The MacBook is a consumer model laptop, and the MacBook Pro is just what it says it is: a professional model laptop meant to handle projects that utilize Firewire peripherals.</p>
<p>Understood. I just think consumers and creatives could have been given some advance notice. Better yet, people shouldn&#8217;t have to decide if they need to buy a new peripheral because their $1300 MacBook doesn&#8217;t support it. And yes, I get that it&#8217;s not a MacBook Pro, but I do have a POS Dell &#038; HP laptop that both have firewire and even the cheaper white base model has it. Don&#8217;t get me wrong, I love Mac and is why I own a Mac Pro, but I just think everyone should have access to firewire speeds. Who knows, they might fix this and maybe they might start selling iMacs with non glossy super reflective screens again; I&#8217;d go buy one tomorrow if that were the case. Until then I&#8217;ll just have to be satisfied with my Mac Pro (very) and the new MacBook Pro I plan on buying in the near future (awesome). </p>
]]></content:encoded>
			<wfw:commentRss>http://valendesigns.com/reviews/is-the-macbook-missing-something/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Is Page or Subpage WP Function</title>
		<link>http://valendesigns.com/wordpress/is-page-or-subpage-wordpress-function/</link>
		<comments>http://valendesigns.com/wordpress/is-page-or-subpage-wordpress-function/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 12:47:13 +0000</pubDate>
		<dc:creator>Derek Herman</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Child]]></category>
		<category><![CDATA[Functions]]></category>
		<category><![CDATA[Parent]]></category>

		<guid isPermaLink="false">http://valendesigns.com/?p=374</guid>
		<description><![CDATA[
Have you ever wanted to know if the page you&#8217;re on is a child of a certain page because you needed to know that information in order to add a snippet of code to the sidebar or remove something or whatever you had planned but you tried and just couldn&#8217;t figure out a solution that [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://valendesigns.com/wp-content/uploads/2009/03/is_page_or_sub.jpg" alt="Is Page or Subpage Function" title="Is Page or Subpage Function" width="460" height="120" class="alignnone size-full wp-image-388" /><br />
Have you ever wanted to know if the page you&#8217;re on is a child of a certain page because you needed to know that information in order to add a snippet of code to the sidebar or remove something or whatever you had planned but you tried and just couldn&#8217;t figure out a solution that was simple and easy to maintain? Well, here is a piece of code that will do just that. I use this very code all over the place, on pretty much every project I do. The concept is simple. I need to know more than if the is_page(&#8216;portfolio&#8217;); I need to know if this is_page_or_sub(&#8216;portfolio&#8217;); </p>
<p>This is pretty much the same function as is_page(), it lets you pass in a page ID or slug, your choice, but the only real difference is that it goes beyond a single page and looks for a family relationship. The function will return true for all children and grandchildren of the page id or slug you pass in. For example, you want to show two different sidebars, one for normal content and one for the portfolio section. You would use this function to do that. First, copy and paste this code into your functions.php and then take a look at the usage example below.</p>
<p>EDIT:<br />
You can get an updated version if this function and as a plugin if you got to <a href="http://valendesigns.com/news/added-plugin-to-wordpress-directory/">here</a>.</p>
<h3>The Function</h3>

<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
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//If is page or subpage of $my_page, works with both ID or name.</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'is_page_or_sub'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">function</span> is_page_or_sub<span style="color: #009900;">&#40;</span><span style="color: #000088;">$my_page</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$post</span><span style="color: #339933;">,</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$grand_parent</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_var</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT post_parent FROM <span style="color: #006699; font-weight: bold;">$wpdb-&gt;posts</span> WHERE ID = '&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_parent</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;' AND post_type = 'page'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #666666; font-style: italic;">// If you pass in a string, get the page ID of $my_page to use below</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">is_numeric</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$my_page</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$my_page</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_var</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT ID FROM <span style="color: #006699; font-weight: bold;">$wpdb-&gt;posts</span> WHERE post_name = '&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$my_page</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;' AND post_type = 'page'&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #666666; font-style: italic;">// If this is $my_page or the child or grandchild of $my_page return true </span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> is_page<span style="color: #009900;">&#40;</span><span style="color: #000088;">$my_page</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post_parent</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$my_page</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$grand_parent</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$my_page</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	    <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> 
	<span style="color: #666666; font-style: italic;">// Else return false</span>
        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h3>Sample Usage</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>is_page_or_sub<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'portfolio'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
    DISPLAY PORTFOLIO SIDEBAR
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    DISPLAY REGULAR SIDEBAR
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>If you have any question feel free to comment below. Have fun taking over the internet one WordPress blog at a time.</p>
<h3>Donations</h3><ul class="notebook-donate"><li>Make a <a class="donateLink" href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=accounts@valendesigns.com&item_name=Donation+for+Code+Snippet" rel="external">donation</a> and help keep the awesomeness flowing.</li></ul> <h3>Disclaimer</h3><div class="disclaimer"><p>Valen Designs grants you a nonexclusive copyright license to use all programming code examples from which you can generate similar function tailored to your own specific needs.</p> <p>Valen Designs, cannot guarantee or imply reliability, serviceability, or function of these programs.</p> <p>All programs contained herein are provided to you "AS IS" without any warranties of any kind. The implied warranties of non-infringement, merchantability and fitness for a particular purpose are expressly disclaimed.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://valendesigns.com/wordpress/is-page-or-subpage-wordpress-function/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Tuts+ Network Gets Complete Makeover</title>
		<link>http://valendesigns.com/news/tutsplus-network-gets-complete-makeover/</link>
		<comments>http://valendesigns.com/news/tutsplus-network-gets-complete-makeover/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 14:54:16 +0000</pubDate>
		<dc:creator>Derek Herman</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Functions]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://valendesigns.com/?p=124</guid>
		<description><![CDATA[
Finally, all five of the Envato Tuts+ sites have now been switched to the new theme and updated branding, and I just completed the much anticipated Flashtuts+ the other day. The staff in charge of content are feverishly getting ready for a launch, which should be anytime now. So many exciting things have been happening [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://valendesigns.com/wp-content/uploads/2009/03/tuts_plus.jpg" alt="Tutsplus" title="Tutsplus" width="460" height="120" class="alignnone size-full wp-image-392" /><br />
Finally, all five of the <a rel="external" href="http://envato.com">Envato</a> Tuts+ sites have now been switched to the new theme and updated branding, and I just completed the much anticipated <a href="http://flash.tutsplus.com">Flashtuts+</a> the other day. The staff in charge of content are feverishly getting ready for a launch, which should be anytime now. So many exciting things have been happening over at Envato recently. A couple new tutorial sites, a new marketplace and one of the coolest things in my opinion to happen in the last few months is the addition of a completely new <a href="http://tutsplus.com">Tuts+</a> dashboard and redesigned members section.</p>
<p>Now when you sign up for the plus program you only pay $9 per month for access to all three of the available sites that participate in supplying the plus program with content. Or you can get three months at a time for only $22. The best thing is that the price isn&#8217;t going to change when they add more sites to the mix. So when Ae, Audio, or even the Flash sites start adding content to the plus program you will just get even more for your money. Awesome!</p>
<p>Anyhow, go check out the <a href="http://tutsplus.com">dashboard</a> and if you have any question on how I built it, feel free to ask or just comment that it&#8217;s awesome and you freakin love it!</p>
]]></content:encoded>
			<wfw:commentRss>http://valendesigns.com/news/tutsplus-network-gets-complete-makeover/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 2.666 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-01-31 03:28:50 -->

