<?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>AmberWeinberg.com &#187; php</title>
	<atom:link href="http://www.amberweinberg.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.amberweinberg.com</link>
	<description>Design, Development and Freelance Articles and Tutorials</description>
	<lastBuildDate>Tue, 07 Sep 2010 14:30:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>XHTML &amp; CSS For Mobile Development</title>
		<link>http://www.amberweinberg.com/xhtml-css-for-mobile-development/</link>
		<comments>http://www.amberweinberg.com/xhtml-css-for-mobile-development/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 14:30:02 +0000</pubDate>
		<dc:creator>Amber Weinberg</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tutorial]]></category>
		<guid isPermaLink="false">http://www.amberweinberg.com/?p=3427</guid>
		<description><![CDATA[If you follow me on Twitter or on Facebook, you&#8217;ve probably heard me talk about...]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.amberweinberg.com/wp-content/uploads/2010/09/3158195615_3263e1cc6f_z-590x393.jpg" alt="" title="3158195615_3263e1cc6f_z" width="590" height="393" class="alignleft size-large wp-image-3432" /></p>
<p>If you follow me on Twitter or on Facebook, you&#8217;ve probably heard me talk about the mobile site I&#8217;ve been developing for Amazon Audible.</p>
<p>The mobile site consists of over 50 mockups that needed to be developed in HTML/CSS and made to work for the iPhone, Android and Blackberry. While coding simple HTML/CSS mockups sounded pretty easy, I found that there were several hurdles and differences from doing mobile HTML and normal HTML.</p>
<p>Doing a mobile site from scratch was a big learning experience, so I&#8217;d thought I&#8217;d share some of the things I learned, that differed greatly for mobile dev.</p>
<h3>Think Small</h3>
<p>Doing mobile development means you have to think small and in terms of percentages, not pixels. You can&#8217;t have a 320px layout for the iPhone, because if you rotate the phone into landscape mode, you&#8217;ll have a skinny site running down the middle. You have to make sure the layout stays consist, while expanding for both portrait and landscape modes on the phone.</p>
<h3>CSS3 Wonders</h3>
<p>One of the biggest changes that were difficult for me to get over, and one of the best, was the fact that I could use CSS3 freely. I no longer had to worry about Internet Explorer, and al of the prominent mobile devices support it.</p>
<p>When trying to do some tricky styling without adding additional markup, I caught myself remembering that I could actually do it with nth-of-type and not having to worry about it breaking! So feel free to break out your CSS3 and even some of your HTML5 skills.</p>
<h3>Special Meta Tags</h3>
<p>There are a lot of little quirks in some mobile devices, but since I have an iPhone I&#8217;ll mention the ones I found in that device. The iPhone has this neat trick, where it links phone numbers in the browser and allows you to click on them and call them instantly.</p>
<p>This is awesome, except for the fact when it tries to do it on non-phone numbers. It seems to have difficulty sometimes determining what is and isn&#8217;t a number, especially when it comes to things like part/order numbers.</p>
<p>The awesome thing about Apple, however, is the fact they came up with a ton of meta tags that allow you to manipulate the way the iPhone device reads the website. I think these tags may also work on the Android, but don&#8217;t quote me on that.</p>
<p>To disallow the linking of phone numbers of your site, simple add this in between your &lt;head&gt; tags:</p>
<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;meta name=&quot;format-detection&quot; content=&quot;telephone=no&quot;&gt;</pre></div></div>
<p>I also ran across a problem where the iPhone likes to blow up the size of text in landscape mode, which was obviously a no-no and broke our layout. This was fixed simply by adding this style to the body property:</p>
<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">body <span style="color: #00AA00;">&#123;</span> -webkit-text-size-adjust<span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>
<h3>The IE of Mobile</h3>
<p>Of course, there&#8217;s always something that has to make a developer&#8217;s life difficult, and in this case it&#8217;s Blackberry. While it&#8217;s not <em>as</em> bad as Internet Explorer, it still became a thorn in my side.</p>
<p>Apparently, some models of Blackberries don&#8217;t support CSS3 properties, like opacity. I haven&#8217;t had any problems with advanced selectors though, so I&#8217;m not sure what is and isn&#8217;t supported.</p>
<p>The Blackberry also seemed to interpret spacing and paddings differently from the Android and the iPhone. For the most part, besides a few text differences, the Android and iPhone were quite similar in rendering the site.</p>
<h3>Browser-Testing</h3>
<p>Browser, or device, testing for mobile is a bit more difficult to do than normal web browser testing. While you can download pretty much al of the web browsers if you&#8217;re on a Windows machine (or use a simulator on a Mac), I&#8217;m fairly sure most devs don&#8217;t have an iPhone, Android AND a Blackberry.</p>
<p>For beginning testing, it was enough to resize my Firefox window as small as possible, but most of the testing I did on my iPhone, especially because the iPhone renders inputs and some backgrounds and paddings quite differently than Firefox.</p>
<p>For Android and Blackberry testing, I had to rely on the help of several of my Twitter friends (thanks guys!). A lot of the simulators you can download, especially the iPhone ones, never seem to actually renders the site like the actual device would. The client also had access to all three devices, so there were a big help in finding bugs.</p>
<h3>Teaching the Client</h3>
<p>The problem with percentage based designs, is that it&#8217;s impossible to have it &#8220;pixel-perfect&#8221; with the mockups, because you&#8217;re not using pixels. This was something I discovered early on, and something I had to teach the client about as well, especially because they had handed me size guides with the exact pixels everything was spaced out to.</p>
<p>This is a bit difficult to explain to a client who wants the mockups to look exactly the same in portrait and landscape mode, but with a little persistence and documentation, it wasn&#8217;t impossible for them to become relaxed in their layout expectations. You just have to be a bit more fluid when it comes to the mobile world.</p>
<h3>Progress</h3>
<p>I haven&#8217;t completed all the mockups yet, but you can <a href="http://amberweinberg.com/clients/audible">check out the progress on the mobile site</a> I&#8217;m working on for Audible for the next week or so before it&#8217;s taken down to become live.</p>
<h3>Your Thoughts</h3>
<p>What are some of the differences and difficulties you&#8217;ve experienced while coding for mobile sites?</p>
<h3  class="related_post_title">Related Posts You Might Like</h3><ul class="related_post"><li><a href="http://www.amberweinberg.com/awesome-free-design-developer-resources/" title="Awesome Free Design &#038; Developer Resources">Awesome Free Design &#038; Developer Resources</a></li><li><a href="http://www.amberweinberg.com/35-books-all-freelance-web-developers-should-read/" title="35 Books All Freelance Web Developers Should Read">35 Books All Freelance Web Developers Should Read</a></li><li><a href="http://www.amberweinberg.com/the-best-development-articles-of-amberweinberg-com/" title="The Best Development Articles Of AmberWeinberg.com">The Best Development Articles Of AmberWeinberg.com</a></li><li><a href="http://www.amberweinberg.com/10-things-i-learned-while-building-an-app/" title="10 Things I Learned While Building An App">10 Things I Learned While Building An App</a></li><li><a href="http://www.amberweinberg.com/what-is-the-future-of-web-development/" title="What is The Future of Web Development?">What is The Future of Web Development?</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.amberweinberg.com/xhtml-css-for-mobile-development/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Hijinks: A WordPress Basic Theme</title>
		<link>http://www.amberweinberg.com/hijinks-a-wordpress-basic-framework/</link>
		<comments>http://www.amberweinberg.com/hijinks-a-wordpress-basic-framework/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 14:30:57 +0000</pubDate>
		<dc:creator>Amber Weinberg</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[extras]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">http://www.amberweinberg.com/?p=3415</guid>
		<description><![CDATA[A lot of people have been asking if I use a framework for WordPress. I...]]></description>
			<content:encoded><![CDATA[<p>A lot of people have been asking if I use a framework for WordPress. I use my own custom blankish framework that allows me to quickly get started on projects.</p>
<p>I&#8217;ve recently cleaned it up with the launch of WordPress 3.0 and thought I&#8217;d give it to you guys for free. It&#8217;s basically the core files, cleaned up, with all the nonsense divs removed, a basic structure and some basic CSS.</p>
<p>Have fun!</p>
<p><a href="http://www.amberweinberg.com/wp-content/uploads/2010/08/hijinksv1.zip"><strong>Download Hijinks Version 1.0</strong></a></p>
<h3>Features in V 1.0</h3>
<ul>
<li>XHTML 1.0 compliant</li>
<li>CSS Reset</li>
<li>Stripped Loops, Divs</li>
<li>Custom search form w/ javascript text remove on click</li>
<li>Built-in functions: Multiple excerpt lengths, except removed [...], custom menu support, sidebar</li>
</ul>
<h3>Any requests or bugs? Let me know and I&#8217;ll get on it <img src='http://www.amberweinberg.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </h3>
<h3  class="related_post_title">Related Posts You Might Like</h3><ul class="related_post"><li><a href="http://www.amberweinberg.com/useful-and-free-code-snippets/" title="Useful (and free!) Code Snippets">Useful (and free!) Code Snippets</a></li><li><a href="http://www.amberweinberg.com/contribute-fridays-web-platforms/" title="Contribute Fridays: Web Platforms">Contribute Fridays: Web Platforms</a></li><li><a href="http://www.amberweinberg.com/awesome-free-design-developer-resources/" title="Awesome Free Design &#038; Developer Resources">Awesome Free Design &#038; Developer Resources</a></li><li><a href="http://www.amberweinberg.com/creating-custom-taxonomies-in-wordpress/" title="Creating Custom Taxonomies in WordPress">Creating Custom Taxonomies in WordPress</a></li><li><a href="http://www.amberweinberg.com/20-must-have-wordpress-plugins-for-every-website/" title="20 Must Have WordPress Plugins For Every Website">20 Must Have WordPress Plugins For Every Website</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.amberweinberg.com/hijinks-a-wordpress-basic-framework/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Contribute Fridays: Web Platforms</title>
		<link>http://www.amberweinberg.com/contribute-fridays-web-platforms/</link>
		<comments>http://www.amberweinberg.com/contribute-fridays-web-platforms/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 14:47:19 +0000</pubDate>
		<dc:creator>Amber Weinberg</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[fridays]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">http://www.amberweinberg.com/?p=3391</guid>
		<description><![CDATA[Which web platform do you prefer to use and why? My choice is obviously&#8230;WordPress! Related...]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-3392" title="wordpress" src="http://www.amberweinberg.com/wp-content/uploads/2010/08/wordpress-300x267.png" alt="" width="210" height="187" />Which web platform do you prefer to use and why? My choice is obviously&#8230;WordPress!</p>
<h3  class="related_post_title">Related Posts You Might Like</h3><ul class="related_post"><li><a href="http://www.amberweinberg.com/hijinks-a-wordpress-basic-framework/" title="Hijinks: A WordPress Basic Theme">Hijinks: A WordPress Basic Theme</a></li><li><a href="http://www.amberweinberg.com/awesome-free-design-developer-resources/" title="Awesome Free Design &#038; Developer Resources">Awesome Free Design &#038; Developer Resources</a></li><li><a href="http://www.amberweinberg.com/creating-custom-taxonomies-in-wordpress/" title="Creating Custom Taxonomies in WordPress">Creating Custom Taxonomies in WordPress</a></li><li><a href="http://www.amberweinberg.com/useful-and-free-code-snippets/" title="Useful (and free!) Code Snippets">Useful (and free!) Code Snippets</a></li><li><a href="http://www.amberweinberg.com/contribute-friday-web-development-recommendations/" title="Contribute Friday: Web Development Recommendations">Contribute Friday: Web Development Recommendations</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.amberweinberg.com/contribute-fridays-web-platforms/feed/</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
		<item>
		<title>35 Books All Freelance Web Developers Should Read</title>
		<link>http://www.amberweinberg.com/35-books-all-freelance-web-developers-should-read/</link>
		<comments>http://www.amberweinberg.com/35-books-all-freelance-web-developers-should-read/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 14:30:59 +0000</pubDate>
		<dc:creator>Amber Weinberg</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[marketing]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[objective c]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[socialmedia]]></category>
		<category><![CDATA[strategy]]></category>
		<guid isPermaLink="false">http://www.amberweinberg.com/?p=3215</guid>
		<description><![CDATA[If you follow me on Goodreads, you know that I absolutely love to read. I&#8217;ve always been a...]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-3216" title="freelancefolder" src="http://www.amberweinberg.com/wp-content/uploads/2010/07/freelancefolder2.jpeg" alt="" width="590" height="277" /></p>
<p>If you follow me on <a href="http://www.goodreads.com/">Goodreads</a>, you know that I absolutely love to read. I&#8217;ve always been a big reader, but since I&#8217;ve become a freelance I&#8217;ve made sure to read even more than usual, in the field of business, development and the web in general.</p>
<p>Reading is essential to any developer&#8217;s improvement. While <a href="http://freelancefolder.com/20-must-read-blogs-for-online-entrepreneurs/">blogs and magazines are great to read</a> for a quick update, nothing replaces a good informative book. Even though web development isn&#8217;t the most interesting topic to read about, I&#8217;ve been able to find a lot of interesting and informative books over the years that have helped me to improve both my dev and business skills.</p>
<p><a href="http://freelancefolder.com/35-books-all-freelance-web-developers-should-read/">Read the rest of my post on FreelanceFolder »</a></p>
<h3  class="related_post_title">Related Posts You Might Like</h3><ul class="related_post"><li><a href="http://www.amberweinberg.com/101-things-to-do-in-2010-if-youre-a-freelance-developer/" title="101 Things To Do In 2010 If You&#039;re A Freelance Developer">101 Things To Do In 2010 If You&#039;re A Freelance Developer</a></li><li><a href="http://www.amberweinberg.com/the-best-development-articles-of-amberweinberg-com/" title="The Best Development Articles Of AmberWeinberg.com">The Best Development Articles Of AmberWeinberg.com</a></li><li><a href="http://www.amberweinberg.com/awesome-free-design-developer-resources/" title="Awesome Free Design &#038; Developer Resources">Awesome Free Design &#038; Developer Resources</a></li><li><a href="http://www.amberweinberg.com/xhtml-css-for-mobile-development/" title="XHTML &amp; CSS For Mobile Development">XHTML &amp; CSS For Mobile Development</a></li><li><a href="http://www.amberweinberg.com/building-findable-websites/" title="Building Findable Websites">Building Findable Websites</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.amberweinberg.com/35-books-all-freelance-web-developers-should-read/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Awesome Free Design &amp; Developer Resources</title>
		<link>http://www.amberweinberg.com/awesome-free-design-developer-resources/</link>
		<comments>http://www.amberweinberg.com/awesome-free-design-developer-resources/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 14:30:55 +0000</pubDate>
		<dc:creator>Amber Weinberg</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sdk]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">http://www.amberweinberg.com/?p=3064</guid>
		<description><![CDATA[I&#8217;ve had a ton of people asking me where to find great resources, and have...]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-large wp-image-3067" title="936394705_3de472288a_b" src="http://www.amberweinberg.com/wp-content/uploads/2010/07/936394705_3de472288a_b-590x354.jpg" alt="" width="590" height="354" /></p>
<p>I&#8217;ve had a ton of people asking me where to find great resources, and have actually come across a ton of them lately. I&#8217;d thought I&#8217;d share them all with you in one post. <img src='http://www.amberweinberg.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you&#8217;ve got some other resources, let me know in the comments!</p>
<h3>Podcasts</h3>
<ul>
<li><strong><a href="http://itunes.apple.com/us/podcast/the-big-web-show/id370445683">The Big Web Show</a></strong> &#8211; Hosted by Jeffery Zeldman and Dan Benjamin, The Big Web Show podcast invites different guests on each show and features a wide range of web topics.</li>
<li><strong><a href="http://audioboo.fm/users/2353/boos">Boagworld&#8217;s Audioboo</a></strong> &#8211; Boagworld Audioboo&#8217;s are only a few minutes short, but are on several different design, development and usability topics.</li>
<li><strong><a href="http://itunes.apple.com/us/podcast/boagworld-web-design-advice/id81014881">Boagworld Web Design Advice</a></strong> &#8211; Even though Boagworld is taking six months off from this podcast, it&#8217;s still a great resource for anything web design.</li>
<li><strong><a href="http://itunes.apple.com/us/podcast/boagworld-bites/id349507034">Boagworld Bites</a></strong> &#8211; Boagworld bites are pieces from the larger Web Design Advice show. These will continue to be published.</li>
<li><strong><a href="http://itunes.apple.com/us/podcast/the-dev-show/id352611845">The Dev Show</a></strong> &#8211; The dev show guys are kind of silly, but they&#8217;ve got great dev topics and resources. Just wished they&#8217;d stop talking about Ruby and MongoDB.</li>
<li><strong><a href="http://itunes.apple.com/us/podcast/freelance-radio/id265746983">Freelance Radio</a></strong><a href="http://itunes.apple.com/us/podcast/freelance-radio/id265746983"> </a>- Not necessarily about development, Freelance Radio from FreelanceSwitch still offers great advice on running your own web business.</li>
<li><strong><a href="http://itunes.apple.com/us/podcast/onmacdevelopment/id329872824">OnMacDevelopment</a></strong> &#8211; OnMacDevelopment caters specifically to Mac, iPhone and iPad development.</li>
<li><strong><a href="http://itunes.apple.com/us/podcast/the-pipeline/id354122274">The Pipeline</a></strong> &#8211; The Pipeline also isn&#8217;t specific to web development, but is an interview show that features some of the biggest names in the design and development world.</li>
<li><strong><a href="http://itunes.apple.com/us/podcast/sitepoint-podcast/id296180681">SitePoint Podcast</a></strong> &#8211; The official podcast of SitePoint.com, they offer news and opinions on design and development.</li>
<li><strong><a href="http://itunes.apple.com/us/podcast/think-vitamin-radio/id351340191">Think Vitamin</a> </strong> &#8211; Think Vitamin is Carsonified&#8217;s official podcast about web and development.</li>
<li><strong><a href="http://itunes.apple.com/us/podcast/37signals-podcast/id338108364">37signals Podcast</a></strong> &#8211; 37signals talks about the design and development of web apps. Great stuff.</li>
</ul>
<h3>E-Books</h3>
<ul>
<li><strong><a href="http://gettingreal.37signals.com/toc.php">Getting Real</a></strong> by 37signals</li>
<li><a href="http://designingfortheweb.co.uk/book/index.php"><strong>Designing for the Web</strong></a> by Mark Boulton</li>
</ul>
<h3>Blogs</h3>
<ul>
<li><a href="http://www.shareasale.com/r.cfm?b=205189&amp;u=395887&amp;m=24775&amp;urllink=&amp;afftrack="><strong>CoreCommerce</strong></a></li>
<li><a href="http://www.designm.ag/"><strong>DesignM.ag</strong></a></li>
<li><a href="http://echoenduring.com/"><strong>EchoEnduring</strong></a></li>
<li><a href="http://www.freelancefolder.com/"><strong>FreelanceFolder</strong></a></li>
<li><a href="http://www.freelanceswitch.com"><strong>FreelanceSwitch</strong></a></li>
<li><a href="http://lifehacker.com/"><strong>Lifehacker</strong></a></li>
<li><a href="http://mobile.tutsplus.com/"><strong>Mobiletuts</strong></a></li>
<li><a href="http://onextrapixel.com/"><strong>OnExtraPixel</strong></a></li>
<li><a href="http://www.scriptandstyle.com"><strong>Script &amp; Style</strong></a></li>
<li><a href="http://www.sixrevisions.com/"><strong>Six Revisions</strong></a></li>
<li><a href="http://www.spyrestudios.com/"><strong>SpyreStudios</strong></a></li>
<li><a href="http://carsonified.com/blog/"><strong>Think Vitamin</strong></a></li>
</ul>
<p><em>image by </em><a href="http://www.flickr.com/photos/hashir/"><em>hashmil</em></a></p>
<h3  class="related_post_title">Related Posts You Might Like</h3><ul class="related_post"><li><a href="http://www.amberweinberg.com/useful-and-free-code-snippets/" title="Useful (and free!) Code Snippets">Useful (and free!) Code Snippets</a></li><li><a href="http://www.amberweinberg.com/xhtml-css-for-mobile-development/" title="XHTML &amp; CSS For Mobile Development">XHTML &amp; CSS For Mobile Development</a></li><li><a href="http://www.amberweinberg.com/35-books-all-freelance-web-developers-should-read/" title="35 Books All Freelance Web Developers Should Read">35 Books All Freelance Web Developers Should Read</a></li><li><a href="http://www.amberweinberg.com/the-best-development-articles-of-amberweinberg-com/" title="The Best Development Articles Of AmberWeinberg.com">The Best Development Articles Of AmberWeinberg.com</a></li><li><a href="http://www.amberweinberg.com/10-things-i-learned-while-building-an-app/" title="10 Things I Learned While Building An App">10 Things I Learned While Building An App</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.amberweinberg.com/awesome-free-design-developer-resources/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Creating Custom Taxonomies in WordPress</title>
		<link>http://www.amberweinberg.com/creating-custom-taxonomies-in-wordpress/</link>
		<comments>http://www.amberweinberg.com/creating-custom-taxonomies-in-wordpress/#comments</comments>
		<pubDate>Thu, 17 Jun 2010 14:30:58 +0000</pubDate>
		<dc:creator>Amber Weinberg</dc:creator>
				<category><![CDATA[blog]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">http://www.amberweinberg.com/?p=2899</guid>
		<description><![CDATA[I had a client this week that wanted to install WordPress on the CoreCommerce site...]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-2901" title="screenshot_02" src="http://www.amberweinberg.com/wp-content/uploads/2010/06/screenshot_02-291x300.jpg" alt="" width="291" height="300" />I had a client this week that wanted to install WordPress on the CoreCommerce site I recently did for her. When I was checking out the mockups, I noticed a strange section in their sidebar. Basically, they wanted to have four different tag areas with different sections, one for &#8220;Materials&#8221;, &#8220;Colors&#8221;, &#8220;Country&#8221; and one called &#8220;Labels&#8221; that would house all of them.</p>
<p>My first instinct was to write an email telling them that this couldn&#8217;t be done.</p>
<p><img class="alignright size-medium wp-image-2903" title="screenshot_01" src="http://www.amberweinberg.com/wp-content/uploads/2010/06/screenshot_011-120x300.jpg" alt="" width="120" height="300" /></p>
<p>Then, I realized that WordPress offers custom taxonomies, so that my next instinct was to tell them they could all be done, except for &#8220;Labels&#8221;, as WordPress doesn&#8217;t actually have a native way of showing all the tags at once. After some thought, I was able to find a solution for that too.</p>
<p>So what, exactly, is a custom taxonomy? The &#8220;Tag&#8221; feature of WordPress is a taxonomy, or way of categorizing and organizing your site. You can actually add as many taxonomies as you want and they&#8217;ll show up in your sidebar when adding a post.</p>
<h3>Adding Multiple Taxonomies to Your Posts</h3>
<p>Simply add this code to your functions.php file, changing the names of the tag types:</p>
<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'init'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'create_my_taxonomies'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> create_my_taxonomies<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	register_taxonomy<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'country'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'hierarchical'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'label'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Country'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'query_var'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rewrite'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	register_taxonomy<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'colors'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'hierarchical'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'label'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Colors'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'query_var'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rewrite'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	register_taxonomy<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'materials'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'hierarchical'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'label'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Materials'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'query_var'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rewrite'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>
<h3>Displaying The New Tag Clouds In Your Sidebar</h3>
<p>Displaying your new tag clouds has to be done manually, but is super easy to implement:</p>
<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_tag_cloud<span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'taxonomy'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'country'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'number'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">45</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>
<h3>Displaying Custom Tags In Posts</h3>
<p>To display your custom taxonomy in your posts like you&#8217;d normally do at the bottom, simply add this:</p>
<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_the_term_list<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'materials'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">', '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>
<h3>Displaying All Tags Together</h3>
<p>I couldn&#8217;t really figure out a way to display all of the tags together, because calling the default the_tags function would only display the tags that were added via the regular taxonomy. Instead, I sort of &#8220;hacked&#8221; my way into making it work. (If anyone knows a better way to do this PLEASE share!)</p>
<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> the_tags<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Labels: '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">', '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>, <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_the_term_list<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'materials'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">', '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>, <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_the_term_list<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'colors'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">', '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>, <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_the_term_list<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'country'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">', '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>
<p>As you can see, I ended up just manually calling each taxonomy, and separating each with a space and comma. It actually ended up working quite nicely.</p>
<h3  class="related_post_title">Related Posts You Might Like</h3><ul class="related_post"><li><a href="http://www.amberweinberg.com/building-a-custom-subscriber-panel-with-stats-in-wordpress/" title="Building A Custom Subscriber Panel With Stats In WordPress">Building A Custom Subscriber Panel With Stats In WordPress</a></li><li><a href="http://www.amberweinberg.com/look-before-you-leap-into-thesis-theme/" title="Look Before You Leap Into Thesis Theme">Look Before You Leap Into Thesis Theme</a></li><li><a href="http://www.amberweinberg.com/post-thumbnails-via-wordpress/" title="Post Thumbnails via WordPress">Post Thumbnails via WordPress</a></li><li><a href="http://www.amberweinberg.com/how-to-add-buddypress-avatars-to-wordpress-mu/" title="How To Add BuddyPress Avatars To Wordpress MU">How To Add BuddyPress Avatars To Wordpress MU</a></li><li><a href="http://www.amberweinberg.com/how-to-create-a-dynamic-portfolio-in-wordpress-using-categories/" title="How To Create A Dynamic Portfolio in Wordpress Using Categories">How To Create A Dynamic Portfolio in Wordpress Using Categories</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.amberweinberg.com/creating-custom-taxonomies-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
