<?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>New2WP &#187; Pro</title>
	<atom:link href="http://new2wp.com/levels/pro/feed/" rel="self" type="application/rss+xml" />
	<link>http://new2wp.com</link>
	<description>Wordpress Tips for Noobs, Rookies and Pros</description>
	<lastBuildDate>Mon, 29 Aug 2011 13:00:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-RC2</generator>
		<item>
		<title>New2WP Latest Posts For Custom Types Sidebar Widget WordPress Plugin</title>
		<link>http://new2wp.com/pro/latest-custom-post-type-posts-sidebar-widget/</link>
		<comments>http://new2wp.com/pro/latest-custom-post-type-posts-sidebar-widget/#comments</comments>
		<pubDate>Fri, 19 Nov 2010 13:00:14 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Pro]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Post types]]></category>
		<category><![CDATA[Widgets]]></category>
		<category><![CDATA[wp3.0]]></category>

		<guid isPermaLink="false">http://new2wp.com/?p=2806</guid>
		<description><![CDATA[<p>For a long time now there has been a huge need for a sidebar widget that allows you to choose from any WordPress post type to show a list of the latest posts in the sidebar.</p>
<p>I've created a fully customizable sidebar widget for doing just that, packed up as a plugin for you to use now!</p>]]></description>
			<content:encoded><![CDATA[<h2>Finally, Just What We All Needed!</h2>
<p>If you've been using WordPress custom post types at all on your site, like I have been now for about 10 months or so... since 3.0 Alpha version, then you'll probably love this.</p>
<p>I've created a new custom sidebar widget for WordPress, to display the latest posts for other post types besides the 'post' post type. This widget actually lets you show not only custom post types, but you can choose to display content from any <em>public</em> post type which includes the built-in post types 'page' and 'attachment', and of course 'post'.</p>
<p>So as long as your custom post types are publicly available, you can display the latest posts for them in your widgetized sidebar areas. What I mean when I say public, that means you must have specified in your code when registering your post type the property <span id="fixed">'public' => true</span> in the $args array which you must set up when you use <span id="fixed">register_post_type()</span>. </p>
<p>Since I don't use custom post type plugins I don't know if you have that capability to set 'public' => true or not. I assume you would be able to, but I'm not sure.</p>
<div align="center"><a href="https://www.e-junkie.com/ecom/gb.php?cl=12635&#038;c=ib&#038;aff=81542" target="ejejcsingle"><img src="http://new2wp.com/wp-content/uploads/2010/06/WProckstar_468x60.jpg" alt="questions" title="questions" class="aligncenter size-full wp-image-1691" /></a></div>
<h2>Plugin Features:</h2>
<p>This plugin is similar to another plugin widget I made and <a href="http://new2wp.com/noob/new2wp-sidebar-twitter-widget-plugin/">recently released for showing your latest Tweets</a>. It simply adds a new custom widget to your Widgets page in the WordPress dashboard, which you can use in your widgetized sidebars.</p>
<p>I have yet to see or hear about anything like this which displays the latest published custom post type posts in your sidebar. It's a replacement for the well-known Latest Posts widget which only displays the latest posts from the 'post' post type, and that's it.</p>
<h3>Features Built Into this Plugin/Widget</h3</p>
<ul>
<li>Ability to choose which post type to display the latest posts from.</li>
<li>Able to control the heading HTML tag for formatting the widget title depending on how your theme displays the headings of widgets.</li>
<li>Control the number of posts to display.</li>
<li>Customizable widget title text.</li>
<li>Full localization of text to support use with non-English languages.</li>
<li>Link to view all posts from XXXX post type, whichever it is you have selected to display.</li>
</ul>
<h2>Plugin Installation:</h2>
<p>You will need to <a href="https://github.com/downloads/jaredwilli/latest-cpt-posts-widget/latest-cpt-posts-widget.zip">Download the n2wp-latest-ptypes.zip</a> file.</p>
<ol type="1">
<li>Unzip the folder `<em>/n2wp-latest-ptypes/</em>` to your computer.</li>
<li>Upload the entire contents of `/n2wp-latest-ptypes/` to the `<strong>/wp-content/plugins/</strong>` directory of your WordPress installation.</li>
<li>Activate the plugin through the 'Plugins' menu in the WordPress dashboard.</li>
<li>Go to your Widgets panel in the dashboard, and drag the New2WP Latest Custom Posts widget to your sidebar, and configure the settings to your liking.</li>
</ol>
<p></p>
<div class="post-next">
<a href="https://github.com/downloads/jaredwilli/latest-cpt-posts-widget/latest-cpt-posts-widget.zip">Download Latest Posts For Custom Types</a>
</div>
<div class="post-next">
<a href="https://github.com/jaredwilli/latest-cpt-posts-widget">Fork Me And Watch The Git Repository...</a>
</div>
<p>If you like this, you might like some of <a href="/tag/plugins/">my other crappy plugins</a> that I've made.</p>
<p><strong>You can see this widget in the sidebar right here showing Latest Snippets &rarr;</strong></p>
<p>Let me know what you think of it in the comments, and if you find any bugs please tell me so I can fix them. I really like this widget myself, and would like to get it added to the WordPress plugin directory if I can.</p>
<div id="crp_related"><h3>Related Posts</h3><ul class="relatedposts"><li><a href="http://new2wp.com/noob/new2wp-sidebar-twitter-widget-plugin/" rel="bookmark" class="crp_title">New2WP Basic Sidebar Twitter Widget Plugin</a></li><li><a href="http://new2wp.com/noob/show-multiple-custom-post-type-posts-query-sidebar/" rel="bookmark" class="crp_title">Showing Posts From Multiple Custom Post Types In The Loop</a></li><li><a href="http://new2wp.com/pro/basic-theme-framework-wordpress3-custom-post-type/" rel="bookmark" class="crp_title">3.0 Basics WordPress Theme Framework</a></li><li><a href="http://new2wp.com/noob/wordpress-plugin-new2wp-author-box-version-1-0/" rel="bookmark" class="crp_title">WordPress Plugin: New2WP Author Box Version 1.0</a></li><li><a href="http://new2wp.com/rookie/new-post-form-wordpress-custom-post-types/" rel="bookmark" class="crp_title">[Guest Post] Submit WordPress Posts From The Frontend Of Your Site</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://new2wp.com/pro/latest-custom-post-type-posts-sidebar-widget/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Create A WordPress 3.0 jQuery Drop Down Nav Menu</title>
		<link>http://new2wp.com/pro/jquery-drop-down-menu-wordpress-3-menu/</link>
		<comments>http://new2wp.com/pro/jquery-drop-down-menu-wordpress-3-menu/#comments</comments>
		<pubDate>Mon, 18 Oct 2010 12:00:47 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Pro]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Menus]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[wp3.0]]></category>

		<guid isPermaLink="false">http://new2wp.com/?p=2225</guid>
		<description><![CDATA[Stop searching for a way to make a drop down menu using WP nav menu in WordPress 3.0 only to not be able to find a solution because you've just found it.

Learn how to make a WP drop down nav menu 3.0, right here, including the use of jQuery to add some nice effects to it as well.]]></description>
			<content:encoded><![CDATA[<h2>Finally!! A Drop Down WP Nav Menu!</h2>
<p>This is what you will be thinking if you're like me and have been searching the web for days on how to use the new <span id="fixed">wp_nav_menu()</span> to create a nice drop down menu, and finally have full control over how the links are nested and arranged from the dashboard Menus page, and have probably been unable to find much of anything that is helpful in doing so. Am I right? If you know of any other sources please share in the comments.</p>
<p>I know this because I have been searching not just for days, but for months now for any kind of information I could find on making a drop down menu that doesn't use the disgusting way of the past using <span id="fixed">wp_page_menu()</span>, <span id="fixed">wp_list_pages()</span>, <span id="fixed">wp_list_categories()</span>, or any one of the other <span id="fixed">wp_list_xxx()</span> methods that you were able to do this in the past. </p>
<p>Then this week I found myself in desperate need of a custom <span id="fixed">wp_nav_menu()</span> that dropped down and was all fancy pants, so I had to suck it up and create it from scratch. This is the WP drop down nav menu I made.<br />
<a href="http://new2wp.com/wp-content/uploads/2010/07/nav3.png"><img src="http://new2wp.com/wp-content/uploads/2010/07/nav3.png" alt="Drop Down WP Nav Menu" title="Drop Down WP Nav Menu" width="500" height="160" class="aligncenter size-full wp-image-2247" /></a></p>
<p>As you can see it is rather big, though I wouldn't consider it a <a href="http://www.sohtanaka.com/web-design/mega-drop-downs-w-css-jquery/">mega menu</a>, just a long list that I found a way to display in not only 4 colums but 2 or 3 columns as well to see which would look best. In the interest of time, I will not make you create 20 menu items for making a menu like this, but it is possible with 4 items, if displaying as 4 columns.</p>
<h2>Got Menus?</h2>
<p>So first thing we should do is register some menus. This I'll go over quickly since it is more documented and you probably already have it done at least to some extent. </p>
<p>Adding theme support for nav menus has recently changed with an update that was made. You should now be adding support to themes for menus like this.</p>
<pre class="brush: php; title: ; notranslate">
// Theme support adding changed from 'nav-menus' to just 'menus'
add_theme_support( 'menus' );
</pre>
<p>Once that is done, you need should register a menu or 3 and give it a location for use. I recommend that when you make your menus that you don't go crazy and make a whole bunch, at least not until there is a released fix for the quirk that having more than 4 menu tabs causes. You have to scroll horizontally to view all the tabs for each menu. </p>
<p>Once you have added theme support for menus, you can no register some wp_nav_menus and the location they will be used to give them a context.</p>
<pre class="brush: php; title: ; notranslate">
// Function for registering wp_nav_menu() in 3 locations
add_action( 'init', 'register_navmenus' );
function register_navmenus() {
	register_nav_menus( array(
		'Header' 	=&gt; __( 'Header Navigation' ),
		'Sidebar'	=&gt; __( 'Sidebar Navigation' ),
		'Footer'	=&gt; __( 'Footer Navigation' ),
		)
	);
}
</pre>
<p>Once your theme supports the use of menus, and registered at least one which you want to use, you then need to open the template file which should display your menu. Using <span id="fixed">wp_nav_menu()</span>, pass the arguments to it that you need to show different menus and settings. </p>
<p><a href="http://new2wp.com/wp-content/uploads/2010/07/nav4.png"><img src="http://new2wp.com/wp-content/uploads/2010/07/nav4.png" alt="Drop Down WP Nav Menu" title="Drop Down WP Nav Menu" width="299" height="363" class="alignright size-full" /></a></p>
<ul>
<li>The nav menu for will show any menu that is defined for it.</li>
<li>If one isn't filled out, <span id="fixed">wp_nav_menu</span> falls back to <span id="fixed">wp_page_menu</span></li>
<li>The menu assiged to the primary position is the one used</li>
<li>If none is assigned, the menu with the lowest ID is used</li>
</ul>
<p>Since this is the case, on the Menu page of the dashboard I have created a menu named 'Header'. Then added the following code to the header.php temeplate.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
// Using wp_nav_menu() to display menu
wp_nav_menu( array(
	'menu' =&gt; 'Header', // Select the menu to show by Name
	'class' =&gt; '',
	'container' =&gt; false, // Remove the navigation container div
	'theme_location' =&gt; 'Header'
	)
);
?&gt;
</pre>
<p>You can view a list of other arguments here which can be useful depending on your needs.<br />
Now let's check out the HTML code that is output by the <span id="fixed">wp_nav_menu()</span> function so that you can see what we're working with. I </p>
<h2>The HTML Output Of wp_nav_menu()</h2>
<p>The structure of the menu that I am going to be building for this tutorial will be able to have custom post types, custom taxonomies, pages, categories and tags, and custom links combined in one menu that I'll be able to reorder simply by dragging and dropping them on the menu page in the dashboard. </p>
<p>Here is what my example menu structure looks like:</p>
<p><a href="http://new2wp.com/wp-content/uploads/2010/07/nav5.png"><img src="http://new2wp.com/wp-content/uploads/2010/07/nav5.png" alt="Drop Down WP Nav Menu" title="Drop Down WP Nav Menu" width="480" height="546" class="aligncenter size-full" /></a></p>
<p>The HTML code that this menu structure will output when <span id="fixed">wp_nav_menu()</span> is called will give me something like this, only with the links and page titles.</p>
<pre class="brush: php; title: ; notranslate">
&lt;div id=&quot;menu-header&quot;&gt;
	&lt;ul id=&quot;menu-main-menu&quot; class=&quot;menu&quot;&gt;

		&lt;li id=&quot;menu-item-57&quot; class=&quot;menu-item menu-item-type-post_type current_page_item&quot;&gt;
			&lt;a href=&quot;#&quot;&gt;No Drop&lt;/a&gt;
		&lt;/li&gt;

		&lt;li id=&quot;menu-item-58&quot; class=&quot;menu-item menu-item-type-post_type&quot;&gt;
			&lt;a href=&quot;#&quot;&gt;Drop Down&lt;/a&gt;
			&lt;ul class=&quot;sub-menu&quot;&gt;

				&lt;li id=&quot;menu-item-81&quot; class=&quot;menu-item menu-item-type-page&quot;&gt;
					&lt;a href=&quot;#&quot;&gt;Link&lt;/a&gt;
				&lt;/li&gt;
				&lt;li id=&quot;menu-item-85&quot; class=&quot;menu-item menu-item-type-category&quot;&gt;
					&lt;a href=&quot;#&quot;&gt;Link&lt;/a&gt;
				&lt;/li&gt;
				&lt;li id=&quot;menu-item-82&quot; class=&quot;menu-item menu-item-type-taxonomy&quot;&gt;
					&lt;a href=&quot;#&quot;&gt;Link&lt;/a&gt;
				&lt;/li&gt;
				&lt;li id=&quot;menu-item-83&quot; class=&quot;menu-item menu-item-type-tag&quot;&gt;
					&lt;a href=&quot;#&quot;&gt;Link&lt;/a&gt;
				&lt;/li&gt;

			&lt;/ul&gt;
		&lt;/li&gt;

		&lt;li id=&quot;menu-item-60&quot; class=&quot;menu-item menu-item-type-post_type&quot;&gt;
			&lt;a href=&quot;#&quot;&gt;Drop Down&lt;/a&gt;
			&lt;ul class=&quot;sub-menu&quot;&gt;

				&lt;li id=&quot;menu-item-81&quot; class=&quot;menu-item menu-item-type-page&quot;&gt;
					&lt;a href=&quot;#&quot;&gt;Link&lt;/a&gt;
				&lt;/li&gt;
				&lt;li id=&quot;menu-item-85&quot; class=&quot;menu-item menu-item-type-category&quot;&gt;
					&lt;a href=&quot;#&quot;&gt;Link&lt;/a&gt;
				&lt;/li&gt;
				&lt;li id=&quot;menu-item-82&quot; class=&quot;menu-item menu-item-type-taxonomy&quot;&gt;
					&lt;a href=&quot;#&quot;&gt;Link&lt;/a&gt;
				&lt;/li&gt;
				&lt;li id=&quot;menu-item-83&quot; class=&quot;menu-item menu-item-type-tag&quot;&gt;
					&lt;a href=&quot;#&quot;&gt;Link&lt;/a&gt;
				&lt;/li&gt;

			&lt;/ul&gt;
		&lt;/li&gt;

		&lt;li id=&quot;menu-item-59&quot; class=&quot;menu-item menu-item-type-page&quot;&gt;
			&lt;a href=&quot;#&quot;&gt;No Drop&lt;/a&gt;
		&lt;/li&gt;

	&lt;/ul&gt;
&lt;/div&gt;
</pre>
<p>The most important part in this code are the things that can be selected using CSS and jQuery. More specifically, what selectors will select a groups of items. Anything that shows up more than once, can be used to style all that have it.</p>
<h3>Which CSS And jQuery Selectors To Use</h3>
<ul>
<li>div.menu-header</li>
<li>ul</li>
<li>li</li>
<li>a</li>
<li>menu-main-menu</li>
<li>menu</li>
<li>ul.sub-menu</li>
<li>menu-item</li>
<li>current_page_item</li>
</ul>
<p>For now just leave the selectors that are specific to a type alone. The selectors that indicate whether its a post_type, _page, _tag, etc. can be used for selecting a set of those items, but with the menu being easily changeable the set list of items may be altered accidently later on.</p>
<p>So now that we know a little more about what were dealing with, we can style it with some CSS code using these ID and class selectors. You can also enable the CSS Classes option under the Screen Options slide down menu of the dashboard menu page.</p>
<p><a href="http://new2wp.com/wp-content/uploads/2010/07/nav1.png"><img src="http://new2wp.com/wp-content/uploads/2010/07/nav1.png" alt="Drop Down WP Nav Menu" title="Drop Down WP Nav Menu" width="560" height="135" class="aligncenter size-full" /></a></p>
<h2>Why Won't This Menu Drop Down, Damnit?!</h2>
<p>If you are not familiar with making drop down menus you might come to find it frustrating. If you're like me and other people I know, then you try to avoid having to make them at all costs. That is why I've made it simple for you, and have already done the work. Below is the CSS for my drop down menu, which uses CSS3 gradients, border radius and other things.</p>
<pre class="brush: php; title: ; notranslate">
&lt;style type=&quot;text/css&quot;&gt;
#menu-header { margin: 0 auto; width: 960px; display:block; }
#menu-header { border-bottom:5px solid #A5C3DE; height:41px; left:0; position:relative; top:30px; z-index:3; }

/***************** SUB MENU - Main Tabs **********************/
#menu-header ul.menu { position:absolute; list-style:none; margin-bottom:0px; width:400px; display:inline-block; }
#menu-header ul.menu li {
	background:#deeff7;
	margin:0 12px 0 0; padding:0px; width:160px; float:left;
	background-image: -moz-linear-gradient(top, #d6e7f7, #deeff7);
	background-image: -webkit-gradient(linear,left top,left bottom, color-stop(0, #d6e7f7),color-stop(1, #deeff7));
	border:1px solid #a5c3de;
	-moz-border-radius-topleft: 6px;
	-moz-border-radius-topright: 6px;
	-webkit-border-top-left-radius: 6px;
	-webkit-border-top-right-radius: 6px;
}
#menu-header ul.menu li a {
	padding:10px 6px; margin:0; display:block; overflow:hidden;
	color:#666666; text-shadow:0 1px 0 rgba(255,255,255,.9);
	text-align:center; text-decoration:none;
	font-size:15px; font-weight:bold;
	font-family: Helvetica, Verdana;
}
#menu-header ul.menu li a:hover, ul.menu li a:active {
	background:#c6d7ef;
	color:#444; text-shadow:0 1px 0 rgba(255,255,255,.7);
	background-image: -moz-linear-gradient(top, #a5c3de, #c6d7ef);
	background-image: -webkit-gradient(linear,left top,left bottom, color-stop(0, #a5c3de),color-stop(1, #c6d7ef));
}

/****************** SUB MENU - LEVEL 2 ***********************/
#menu-header .sub-menu {
	/* Width of drop menu for changing number of columns:
	  2 columns: 424px;
	  3 columns: 638px;
	  4 columns: 848px;
	  */
	width: 424px;
	background: #c6d7ef;
	position:relative;
	overflow:hidden;
	padding:0px; margin:0px;
}
#menu-header ul.menu li a:hover ul.sub-menu {
	background:#c6d7ef;
}
#menu-header ul.sub-menu li {
	background:#c6d7ef;
	border:1px solid #9cb3c8;
	display:block; float:left; margin:-1px; padding:0; width:212px;
	-moz-border-radius:0px; border-radius:0px; -webkt-border-radius:0px;
}
#menu-header ul ul.sub-menu li a {
	line-height:1.3em; font-size:13px; color:#333; text-shadow:0 1px 0 rgba(255,255,255,.7);
	margin:0px; padding:10px 5px; text-align:center;
}
#menu-header ul ul.sub-menu a:hover {
	color:#345; text-shadow:0 1px 0 rgba(255,255,255,.9);
	background-image: -moz-linear-gradient(top, #d6e7f7, #deeff7);
	background-image: -webkit-gradient(linear,left top,left bottom, color-stop(0, #d6e7f7),color-stop(1, #deeff7));
}

#menu-header ul ul {
	display: none; /* For testing, change to display: block; */
	list-style:none;
	z-index:100;
}
#menu-header ul li:hover &gt; ul {
/*  Uncomment to show drop down for testing purposes
	display: block;
*/
}
&lt;/style&gt;
</pre>
<p>There are a few comments in this code that you should notice. First, you can control the width of the drop menu and the number of columns the list items form using the width amounts I've outlined here.</p>
<pre class="brush: php; title: ; notranslate">
	/* Width of drop menu for changing number of columns:
	  2 columns: 424px;
	  3 columns: 638px;
	  4 columns: 848px;
	  */
</pre>
<p>The other part that is very important and one of the single things you should get from this tutorial is below. The trick to making drop menus is to make the parent item of the child items visible using <span id="fixed">display: block;</span>. That way you can position it correctly and design the desired look and feel while it is visible without hovering. Once that's done you can hide it with <span id="fixed">display: none;</span>.</p>
<pre class="brush: php; title: ; notranslate">
#menu-header ul ul {
	display: none; /* For testing, change to display: block; to make visible */
	list-style:none;
	z-index:100;
}
#menu-header ul li:hover &gt; ul {
/*  Uncomment to show drop down for testing purposes
	display: block;
*/
}
</pre>
<h2>Animating The Drop Menu With jQuery</h2>
<p>This is the jQuery code that I wrote for making my drop down menu a little more slick. It's a basic animation that simply slides up and down when hovering on and off of the tabs and drop menu.</p>
<pre class="brush: php; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
$(function() {

	$(&quot;#menu-header ul.menu ul&quot;).css({ display: 'none' });
	$(&quot;#menu-header ul.menu li&quot;).hover(function() {
		$(this).find('ul.sub-menu')
			.stop(true, true).delay(50).animate({ &quot;height&quot;: &quot;show&quot;, &quot;opacity&quot;: &quot;show&quot; }, 200 );
	}, function(){
		$(this).find('ul.sub-menu')
			.stop(true, true).delay(50).animate({ &quot;height&quot;: &quot;hide&quot;, &quot;opacity&quot;: &quot;hide&quot; }, 200 );
	});

});
&lt;/script&gt;
</pre>
<p>There is a .delay() that prevents the animation from firing immediately when your mouse touch the tab buttons. Without the .delay() whenever you move your mouse over the tabs, but not intending to open the menu, it would cause it to flicker from your moving too fast for it to drop. I've made it so you have to stop on the tab for it to drop. Just thought I'd explain that since it was something I learned the hard way doing this. That's pretty much all there is to it.</p>
<h2>Check This Out On WPHonors</h2>
<p>You can see another example of this drop menu as a single column drop down over on <a href="http://wphonors.com" target="_blank">WPHonors.com</a>. The menu I made for that site is much nicer looking because I used much more CSS3 styling and customizing.</p>
<p>Also, I wrote this post a long time ago, and realized I never published it. So don't kill me if it turns out to be incomplete or doesn't work. If you have any questions you're always welcome to post a comment below.</p>
<div id="crp_related"><h3>Related Posts</h3><ul class="relatedposts"><li><a href="http://new2wp.com/noob/adding-backwards-compatible-wordpress-menus-to-your-theme/" rel="bookmark" class="crp_title">Adding Backwards Compatible WordPress Menus To Your Theme</a></li><li><a href="http://new2wp.com/noob/new2tip-allow-visitors-to-search-by-category/" rel="bookmark" class="crp_title">New2Tip: Allow Visitors To Search By Category</a></li><li><a href="http://new2wp.com/rookie/just-html5-making-a-basic-page-the-right-way/" rel="bookmark" class="crp_title">Just HTML5 &#8211; Making A Basic Page The Right Way</a></li><li><a href="http://new2wp.com/pro/wordpress-dashboard-themes/" rel="bookmark" class="crp_title">How To Create WordPress Dashboard Themes And Styles</a></li><li><a href="http://new2wp.com/noob/how-to-make-a-simple-image-sliding-animation-with-jquery/" rel="bookmark" class="crp_title">How To Make A Simple Image Sliding Animation With jQuery</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://new2wp.com/pro/jquery-drop-down-menu-wordpress-3-menu/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>OOPost Types: Objects Part 3 &#8211; Object Oriented WordPress 3.0 App</title>
		<link>http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series3/</link>
		<comments>http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series3/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 12:00:35 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Pro]]></category>
		<category><![CDATA[Objects]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[Post types]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[wp3.0]]></category>

		<guid isPermaLink="false">http://new2wp.com/?p=2004</guid>
		<description><![CDATA[If you've been following along you now know how to create a class and custom post types. The next step is to use it to display the posts on your site as a custom page.

Learn how to create new objects of your post type class using a custom page template in WordPress.]]></description>
			<content:encoded><![CDATA[<h2>Time To Make Some Magic Happen</h2>
<p>Continuing where we left of in <a href="http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series2/">part 2 of OOPost Types</a> where we finished building a Php class for setting up methods that our Sites custom post type will use, we now need to put all that code to use. </p>
<p>If you haven't yet read either one of the previous tutorials, you may want to go back and do that before you continue. You will learn how to create the class and functions which are used in this part.</p>
<ul>
<li><a href="http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series1/">OOPost Types: Classes Part 1 - Object Oriented WordPress 3.0 App</a></li>
<li><a href="http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series2/">OOPost Types: Methods Part 2 - Object Oriented WordPress 3.0 App</a></li>
</ul>
<p>This part of the OOPost Types series will go over how to make use of the custom post type WordPress class created in the previous posts, to easily display the Sites post content on a custom page template. That means we will be instantiating the class to create an new object of it.</p>
<p>I've added a method to the class finished in part 2 that is what our object for showing the sites url and screenshot. If you haven't already, add this function below the meta_options() function at the bottom of the post type class.</p>
<pre class="brush: php; title: ; notranslate">
    public function mshot($mshotsize) {
        global $post;
        $imgWidth = $mshotsize;
        $myurl = get_post_meta($post-&gt;ID, 'siteurl', true);
		if ( $myurl != '' ) {
			$mshoturl = '';
			if ( preg_match( &quot;/http(s?):\/\//&quot;, $myurl )) {
				$siteurl = get_post_meta( $post-&gt;ID, 'siteurl', true );
				$mshoturl = 'http://s.wordpress.com/mshots/v1/' . urlencode( $myurl );
			} else {
				$siteurl = 'http://' . get_post_meta( $post-&gt;ID, 'siteurl', true );
				$mshoturl = 'http://s.wordpress.com/mshots/v1/' . urlencode('http://'.$myurl );
			}
		}
        $mshotimg = '&lt;img src=&quot;'.$mshoturl.'?w='.$imgWidth.'&quot; alt=&quot;'.get_the_title().'&quot; title=&quot;'.get_the_title().'&quot; /&gt;';

        return array( $siteurl, $mshotimg );
	}
</pre>
<p>This returns an array consisting of the site url which was entered for each site, and the output of the screenshot image that is created with the use of that url.</p>
<h2>Creating Custom Page Template</h2>
<p>In order to display the content of our Sites post type, we need to either create a custom query to be used in the default WordPress theme templates, or better yet, create new custom WordPress page templates. To learn the best and most stress free way to create new custom templates you should read a previous post I wrote on <a href="http://new2wp.com/noob/wordpress-custom-templates-the-easy-and-most-logical-method/">making custom WordPress page templates</a>.</p>
<p>The format mentioned in that post to create new page templates using <span id="fixed">page-[slug].php</span>, so what we need to do for displaying the list of submitted Sites is create a new file named <span id="fixed">page-sites.php</span>. </p>
<p>In order to display the information of the Site posts, we need to make a custom query which we pass to <a href="http://codex.wordpress.org/The_Loop">the Loop</a>. </p>
<p>First create your page-sites.php template. You can copy and paste the code from page.php or index.php into this new file and remove the IF statement that loops through the posts. It should be something like <span id="fixed">if( have_posts()) : while( have_posts()) : the_post();</span></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php get_header(); ?&gt;

&lt;div id=&quot;content&quot; class=&quot;inner clearfix&quot;&gt;
	&lt;div class=&quot;post&quot; role=&quot;main&quot;&gt;

	&lt;?php // Do stuff ?&gt;

	&lt;/div&gt;&lt;!-- end .post --&gt;
&lt;/div&gt;&lt;!-- end #content --&gt;

&lt;?php get_sidebar(); ?&gt;
&lt;?php get_footer(); ?&gt;
</pre>
<h2>Custom Post Type Queries For The Loop</h2>
<p>Below is the loop which will display the sites. It first checks to see if were on the right page, and then if so it runs the code. We create an object of the class we made to display the screenshot image of the sites, which is done just with the use of the site url entered when posting. The custom loop query will be done <a href="http://new2wp.com/noob/query_posts-wp_query-differences/">by using WP_Query()</a> to query the post_type.</p>
<p>I've commented the code for further explanation. Pay specific attention to the part that instantiates the custom post type class that was made in the previous posts. The <span id="fixed">$s = new TypeSites();</span> and <span id="fixed">$a = $s->mshot(250);</span> are important for showing the submitted site information.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
	$q = new WP_query();
	$q-&gt;query( 'post_type=site' );

	/* Begin the Loop */
	if ($q-&gt;have_posts()) :
		while ($q-&gt;have_posts()) : $q-&gt;the_post();

			/**
			 * Now instantiate the Sites class we made in posttypes.php setting the $s variable
			 * Create a new variable $a set to the value of the mshot(250) function from the class.
			 */
			$s = new TypeSites();
			$a = $s-&gt;mshot(250);

			/**
			 * Output the content of the Site posts
			 */
			?&gt;

			&lt;div id=&quot;site-&lt;?php the_ID(); ?&gt;&quot; class=&quot;sites clearfix user_id_&lt;?php the_author_ID(); ?&gt;&quot;&gt;
				&lt;div class=&quot;site-thumbnail&quot;&gt;
					&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot; title=&quot;&lt;?php the_title(); ?&gt;&quot;&gt;
						&lt;?php
						/**
						 * Here we echo out the value of the $a which is an array.
						 * The [1] will retreive the 2nd value of mshot() which returns the
						 * site thumbnai image which is generated by the Url entered in the post.
						 */
						 echo $a[1];
						 ?&gt;
					&lt;/a&gt;
				&lt;/div&gt;

				&lt;h2 class=&quot;site-title&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;&lt;?php the_title();?&gt;&lt;/a&gt;&lt;/h2&gt;
				&lt;div class=&quot;meta&quot;&gt;
					&lt;?php __( 'Added by: '. the_author_posts_link() .' on '. the_time( &quot;F j&quot; ) .' | '. comments_popup_link( __( &quot;0 Comments&quot; ), __( &quot;1 Comment&quot; ), __( &quot;% Comments&quot; ) ); ?&gt;
				&lt;/div&gt;

				&lt;div class=&quot;entry&quot;&gt;
					&lt;?php the_content( __( '(More ...)' )); ?&gt;
				&lt;/div&gt;
				&lt;div class=&quot;fl post-tags&quot;&gt;&lt;?php the_tags( __( ' ' ), ' , ', ' ' ); ?&gt;&lt;/div&gt;
				&lt;div class=&quot;fr edit-link&quot;&gt;&lt;?php edit_post_link( __( 'Edit' ) ); ?&gt;&lt;/div&gt;
			&lt;/div&gt;

		&lt;?php endwhile; ?&gt;

		&lt;?php if( function_exists( 'wp_pagenavi' )) { wp_pagenavi(); } else { ?&gt;
			&lt;div class=&quot;navigation clearfix&quot;&gt;
				&lt;div class=&quot;alignleft&quot;&gt;&lt;?php next_posts_link('&amp;laquo; Previous Entries'); ?&gt;&lt;/div&gt;
				&lt;div class=&quot;alignright&quot;&gt;&lt;?php previous_posts_link('Next Entries &amp;raquo;'); ?&gt;&lt;/div&gt;
			&lt;/div&gt;
		&lt;?php } ?&gt;

&lt;?php endif; ?&gt;
</pre>
<h2>Make A Custom Single Template</h2>
<p>We also need to create a new custom single post template which is what will display the single posts for the Sites. So also create a new file named <span id="fixed">single-site.php</span>. You might remember the reference to single-site.php was made in the template redirect function we made in the class. If you neglected to create this single template, then later down the line you might find yourself getting a Php error saying that it does not exist.</p>
<p>So create another new file named single-site.php and use this code for the Loop.</p>
<pre class="brush: php; title: ; notranslate">
	&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;
	&lt;?php $s = new TypeSites();
	$a = $s-&gt;mshot(600);
	?&gt;

	&lt;div id=&quot;site-&lt;?php the_ID(); ?&gt;&quot; class=&quot;user_id_&lt;?php the_author_ID(); ?&gt;&quot;&gt;
		&lt;h2 class=&quot;post-title&quot;&gt;&lt;a href=&quot;&lt;?php echo $a[0]; ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
		&lt;div class=&quot;meta&quot;&gt;
			Added by: &lt;?php the_author_posts_link(); ?&gt; on &lt;?php the_time(&quot;F j&quot;); ?&gt; |
			&lt;?php comments_popup_link( __( '0 Comments' ), __( '1 Comment' ), __( '% Comments' )); ?&gt;
		&lt;/div&gt;

		&lt;div class=&quot;entry&quot;&gt;
			&lt;?php the_content( __( '(More ...)' )); ?&gt;
			&lt;div class=&quot;fl post-tags&quot;&gt;&lt;?php the_tags( __( ' ' ), ' , ', ' ' ); ?&gt;&lt;/div&gt;
			&lt;div class=&quot;fr edit-link&quot;&gt;&lt;?php edit_post_link( __( 'Edit' ) ); ?&gt;&lt;/div&gt;
			&lt;div class=&quot;site-bigthumb&quot; align=&quot;center&quot;&gt;
				&lt;a href=&quot;&lt;?php echo $a[0]; ?&gt;&quot; title=&quot;&lt;?php the_title(); ?&gt;&quot;&gt;
					&lt;?php echo $a[1]; ?&gt;
				&lt;/a&gt;
			&lt;/div&gt;
		&lt;/div&gt;
	&lt;/div&gt;

	&lt;?php endwhile; ?&gt;
	&lt;?php endif; ?&gt;
</pre>
<p>This is all you need to display your custom post types in WordPress. This is more specifically used for the particular post type we've set up using the class, but you can use this same idea to display custom post types that are not created using a class as well.</p>
<h2>Full page-sites.php Code</h2>
<pre class="brush: php; title: ; notranslate">
&lt;?php get_header(); ?&gt;

&lt;div id=&quot;content&quot; class=&quot;inner clearfix&quot;&gt;
	&lt;div class=&quot;post&quot; role=&quot;main&quot;&gt;

	$q = new WP_query();
	$q-&gt;query( 'post_type=site' );

	/* Begin the Loop */
	if ($q-&gt;have_posts()) :
		while ($q-&gt;have_posts()) : $q-&gt;the_post();

			/**
			 * Now instantiate the Sites class we made in posttypes.php setting the $s variable
			 * Create a new variable $a set to the value of the mshot(250) function from the class.
			 */
			$s = new TypeSites();
			$a = $s-&gt;mshot(250);

			/**
			 * Output the content of the Site posts
			 */
			?&gt;

			&lt;div id=&quot;site-&lt;?php the_ID(); ?&gt;&quot; class=&quot;sites clearfix user_id_&lt;?php the_author_ID(); ?&gt;&quot;&gt;
				&lt;div class=&quot;site-thumbnail&quot;&gt;
					&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot; title=&quot;&lt;?php the_title(); ?&gt;&quot;&gt;
						&lt;?php
						/**
						 * Here we echo out the value of the $a which is an array.
						 * The [1] will retreive the 2nd value of mshot() which returns the
						 * site thumbnai image which is generated by the Url entered in the post.
						 */
						 echo $a[1];
						 ?&gt;
					&lt;/a&gt;
				&lt;/div&gt;

				&lt;h2 class=&quot;site-title&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;&lt;?php the_title();?&gt;&lt;/a&gt;&lt;/h2&gt;
				&lt;div class=&quot;meta&quot;&gt;
					&lt;?php __( 'Added by: '. the_author_posts_link() .' on '. the_time( &quot;F j&quot; ) .' | '. comments_popup_link( __( &quot;0 Comments&quot; ), __( &quot;1 Comment&quot; ), __( &quot;% Comments&quot; ) ); ?&gt;
				&lt;/div&gt;

				&lt;div class=&quot;entry&quot;&gt;
					&lt;?php the_content( __( '(More ...)' )); ?&gt;
				&lt;/div&gt;
				&lt;div class=&quot;fl post-tags&quot;&gt;&lt;?php the_tags( __( ' ' ), ' , ', ' ' ); ?&gt;&lt;/div&gt;
				&lt;div class=&quot;fr edit-link&quot;&gt;&lt;?php edit_post_link( __( 'Edit' ) ); ?&gt;&lt;/div&gt;
			&lt;/div&gt;

		&lt;?php endwhile; ?&gt;

		&lt;?php if( function_exists( 'wp_pagenavi' )) { wp_pagenavi(); } else { ?&gt;
			&lt;div class=&quot;navigation clearfix&quot;&gt;
				&lt;div class=&quot;alignleft&quot;&gt;&lt;?php next_posts_link('&amp;laquo; Previous Entries'); ?&gt;&lt;/div&gt;
				&lt;div class=&quot;alignright&quot;&gt;&lt;?php previous_posts_link('Next Entries &amp;raquo;'); ?&gt;&lt;/div&gt;
			&lt;/div&gt;
		&lt;?php } ?&gt;

&lt;?php endif; ?&gt;

	&lt;/div&gt;&lt;!-- end .post --&gt;
&lt;/div&gt;&lt;!-- end #content --&gt;

&lt;?php get_sidebar(); ?&gt;
&lt;?php get_footer(); ?&gt;
</pre>
<h2>Full single-site.php Code</h2>
<pre class="brush: php; title: ; notranslate">
&lt;?php get_header(); ?&gt;

&lt;div id=&quot;content&quot; class=&quot;inner clearfix&quot;&gt;
	&lt;div class=&quot;post&quot; role=&quot;main&quot;&gt;

	&lt;?php if (have_posts()) : while (have_posts()) : the_post(); ?&gt;
	&lt;?php $s = new TypeSites();
	$a = $s-&gt;mshot(600);
	?&gt;

	&lt;div id=&quot;site-&lt;?php the_ID(); ?&gt;&quot; class=&quot;user_id_&lt;?php the_author_ID(); ?&gt;&quot;&gt;
		&lt;h2 class=&quot;post-title&quot;&gt;&lt;a href=&quot;&lt;?php echo $a[0]; ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
		&lt;div class=&quot;meta&quot;&gt;
			Added by: &lt;?php the_author_posts_link(); ?&gt; on &lt;?php the_time(&quot;F j&quot;); ?&gt; |
			&lt;?php comments_popup_link( __( '0 Comments' ), __( '1 Comment' ), __( '% Comments' )); ?&gt;
		&lt;/div&gt;

		&lt;div class=&quot;entry&quot;&gt;
			&lt;?php the_content( __( '(More ...)' )); ?&gt;
			&lt;div class=&quot;fl post-tags&quot;&gt;&lt;?php the_tags( __( ' ' ), ' , ', ' ' ); ?&gt;&lt;/div&gt;
			&lt;div class=&quot;fr edit-link&quot;&gt;&lt;?php edit_post_link( __( 'Edit' ) ); ?&gt;&lt;/div&gt;
			&lt;div class=&quot;site-bigthumb&quot; align=&quot;center&quot;&gt;
				&lt;a href=&quot;&lt;?php echo $a[0]; ?&gt;&quot; title=&quot;&lt;?php the_title(); ?&gt;&quot;&gt;
					&lt;?php echo $a[1]; ?&gt;
				&lt;/a&gt;
			&lt;/div&gt;
		&lt;/div&gt;
	&lt;/div&gt;

	&lt;?php endwhile; ?&gt;
	&lt;?php endif; ?&gt;

	&lt;/div&gt;&lt;!-- end .post --&gt;
&lt;/div&gt;&lt;!-- end #content --&gt;

&lt;?php get_sidebar(); ?&gt;
&lt;?php get_footer(); ?&gt;
</pre>
<p>If you have any questions on this let me know in the comments below. Also, let me know if there are any errors in my code. I have tested this, and it does work for me but based on the last post there may be issues for other people that I was not aware of.</p>
<div class="postprev"><a href="/pro/wordpress-custom-post-types-object-oriented-series2">&laquo; Part 2</a></div>
<div class="postnext"><a href="/pro/wordpress-custom-post-types-object-oriented-series4">Part 4 &raquo;</a></div>
<div id="crp_related"><h3>Related Posts</h3><ul class="relatedposts"><li><a href="http://new2wp.com/rookie/create-social-bookmark-buttons/" rel="bookmark" class="crp_title">Create Your Own Social Bookmark Button Links</a></li><li><a href="http://new2wp.com/noob/new2tip-allow-visitors-to-search-by-category/" rel="bookmark" class="crp_title">New2Tip: Allow Visitors To Search By Category</a></li><li><a href="http://new2wp.com/noob/how-to-make-a-simple-image-sliding-animation-with-jquery/" rel="bookmark" class="crp_title">How To Make A Simple Image Sliding Animation With jQuery</a></li><li><a href="http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series2/" rel="bookmark" class="crp_title">OOPost Types: Methods Part 2 &#8211; Object Oriented WordPress 3.0 App</a></li><li><a href="http://new2wp.com/rookie/sexy-rss-feeds-custom-content/" rel="bookmark" class="crp_title">Making Your RSS Feeds Sexy With Custom Content In WordPress</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series3/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>3.0 Basics WordPress Theme Framework</title>
		<link>http://new2wp.com/pro/basic-theme-framework-wordpress3-custom-post-type/</link>
		<comments>http://new2wp.com/pro/basic-theme-framework-wordpress3-custom-post-type/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 12:00:05 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Pro]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Downloads]]></category>
		<category><![CDATA[Post types]]></category>
		<category><![CDATA[Taxonomies]]></category>
		<category><![CDATA[Themes]]></category>
		<category><![CDATA[wp3.0]]></category>

		<guid isPermaLink="false">http://new2wp.com/?p=2369</guid>
		<description><![CDATA[Announcing the release of a WordPress 3.0 Basic theme. This is a theme framework that has all kinds of great 3.0 features including a custom post type I made. It's a great starter theme for WP theme developers, and just as great to use as is. 

Check out everything included in this theme, and download it to try it out for yourself.]]></description>
			<content:encoded><![CDATA[<h2>Develop It Or Use As A Social Bookmarking Site</h2>
<p>This is a New2WP 3.0 theme framework that started out as more of a basic starter theme to use when making new WordPress themes and quickly became a bigger project than was planned. In it I have included the Sites custom post type which I wrote about in the <a href="http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series2/">first two parts</a> of my <a href="http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series1/">OOPost Types series</a> tutorial. With this, and many other added features make this theme truly 3.0 ready.</p>
<p>Well one thing led to another and it sort of became not just a theme to use as a starting point for theme developers, but it can now be used the way it is out of the box as a sort of social bookmarking type of theme. So whether you're a theme dev, or just someone looking to make a somewhat unique style WP site, you should check out <strong><a href="http://zrz8.com">3.0 Basics</a></strong>.</p>
<div align="center"><a href="http://zrz8.com" title="3.0 Basics theme demo"><img src="http://new2wp.com/wp-content/uploads/2010/08/3.0basics1.jpg" style="border:1px solid #182431;" /></a></div>
<h2>Built-In Features</h2>
<p>Included in this theme are numerous features that are working and functional as soon as you activate the theme, and there's tons of various functions, code customizations, CSS and CSS3 styles and jQuery scripts that will make your life easier.</p>
<p><strong>Custom Post Type</strong></p>
<ul>
<li>Custom post type for submitting Sites.</li>
<li>Custom page and single templates for Sites posts</li>
<li>Simple site live Site screenshots generated on the fly from the URL of a posted Site. No need to upload thumbnail images.</li>
</ul>
<p><strong>Pre-made Nav Menus</strong></p>
<ul>
<li>Pre-registered menu locations (Top, Header, Footer).</li>
<li>Pre-created WP nav menus to go with each registered location.</li>
<li>Default Home menu item for each menu. (prevents the default 'show all' if menu is empty).</li>
</ul>
<p><strong>Other Features</strong></p>
<ul>
<li>User login form in header</li>
<li>Custom background image</li>
<li>Custom dashboard styles</li>
<li>CSS 3 Styling</li>
<li>Ajax live screenshots and post thumbnails</li>
<li>Over 50 different useful functions</li>
<li>And so much more!</li>
</ul>
<p>There's way to much to list here, so you'll have to download it and see for yourself all the great things it has, and what it's capable of doing.</p>
<h2>3.0 Basics Theme Screenshots</h2>
<div align="center" class="alignleft">
<strong>Sites Custom Post Type</strong><br />
<img src="http://new2wp.com/wp-content/uploads/2010/08/3.0basics4.png" style="border:1px solid #182431;" /></div>
<div align="center" class="alignright">
<strong>Upload Background Images</strong><br />
<img src="http://new2wp.com/wp-content/uploads/2010/08/3.0basics3.png" style="border:1px solid #182431;" /></div>
<p><br clear="all" /></p>
<div align="center" class="alignleft">
<strong>Custom Dashboard</strong><br />
<img src="http://new2wp.com/wp-content/uploads/2010/08/3.0basics2.png" style="border:1px solid #182431;" /></div>
<div align="center" class="alignright">
<strong>A Blog Post</strong><br />
<img src="http://new2wp.com/wp-content/uploads/2010/08/3.0basics5.png" style="border:1px solid #182431;" /></div>
<p><br clear="all" /></p>
<h2>Downloading 3.0 Basics</h2>
<p>I will be adding it to the theme repository on WordPress.org and should be downloadable soon from there. I have also made a repository for it on Github, and you can download it from there now, as well as watch or fork it if you want.</p>
<p><a href="http://zrz8.com" title="Demo site for 3.0 Basics theme"><strong>View 3.0 Basics Demo Site</strong></a></p>
<p><a href="http://github.com/jaredwilli/3.0basics" title="Github repository for 3.0 Basics theme"><strong>Github repository for 3.0 Basics</strong></a> </p>
<p><a href="https://github.com/downloads/jaredwilli/3.0basics/New2WP_3.0basics.zip" title="Download 3.0 Basics from Github"><strong>Download 3.0 Basics from Github</strong></a></p>
<h3>Found Bugs or Have Suggestions?</h3>
<p>This theme is not perfect of course. Here's a list of some things you may find buggy that I am working on fixing for future version releases. Please let me know of any not listed here that you come across by posting a <a href="#respond">comment below</a>, so I can add them to this list and keep track of what needs to be done still.</p>
<p>Of course I am always open to suggestions, so let me know what you'd like to see included in this in the comments below as well.</p>
<h2>Change log</h2>
<p><strong>* Version: 1.5.6</strong> ~ <em>12/5/2010</em></p>
<p>- Updated theme to meet the requirements and suggestions from the theme review on WP.org for adding it to the WordPress theme directory.<br />
- Added custom post type functions for the Right Now dashboard widget, and showing custom post types on the user manage panel.<br />
- Fixed existing bugs and error Notices.</p>
<p><strong>* Version: 1.5.5</strong> ~ <em>8/10/2010</em></p>
<p>- First official release of this theme. </p>
<h3>Thoughts?</h3>
<p>If you like this theme, be sure to recommend it, share it, tweet it, and comment below. It is still a work in progress. After all, it is a development theme. So I will be updating the repositories with new version releases.</p>
<p>Now that this is done, I can get back to writing part 3 of <a href="http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series/">OOPost Types</a>. If you don't want to wait for that, I'll be finishing the makings of this themes custom post type object, so you can download this and use it now.</p>
<div id="crp_related"><h3>Related Posts</h3><ul class="relatedposts"><li><a href="http://new2wp.com/pro/latest-custom-post-type-posts-sidebar-widget/" rel="bookmark" class="crp_title">New2WP Latest Posts For Custom Types Sidebar Widget WordPress Plugin</a></li><li><a href="http://new2wp.com/rookie/ocd-freak-auto-capitalization/" rel="bookmark" class="crp_title">OCD Freak: Automatically Capitalize Your Post Titles</a></li><li><a href="http://new2wp.com/noob/textmate-coda-plugins-wordpress-development/" rel="bookmark" class="crp_title">New Textmate and Coda Starter Plugins For WordPress Developers</a></li><li><a href="http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series1/" rel="bookmark" class="crp_title">OOPost Types: Classes Part 1 – Object Oriented WordPress 3.0 App</a></li><li><a href="http://new2wp.com/rookie/press-tools-wordpress-plugin-review/" rel="bookmark" class="crp_title">[Review] GD Press Tools Plugin For WordPress</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://new2wp.com/pro/basic-theme-framework-wordpress3-custom-post-type/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>OOPost Types: Methods Part 2 &#8211; Object Oriented WordPress 3.0 App</title>
		<link>http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series2/</link>
		<comments>http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series2/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 11:00:33 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Pro]]></category>
		<category><![CDATA[Methods]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[Post types]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[wp3.0]]></category>

		<guid isPermaLink="false">http://new2wp.com/?p=1934</guid>
		<description><![CDATA[This is the second part of building a WordPress 3.0 custom post type class. In this tutorial we'll build the methods that the class can use, and that any objects you build later on can access and use as well.]]></description>
			<content:encoded><![CDATA[<h2>Second Day Of Classes And OOPost Types</h2>
<p>In the first tutorial - <a href="http://new2wp.com/pro/WordPress-custom-post-types-object-oriented-series1/">Classes part 1 of OOPost Types</a>, I showed you how to start building the class for a <a href="http://new2wp.com/pro/wordpress-custom-post-types-and-taxonomies-done-right/">custom post type</a> to submit sites, essentially making a type of social bookmarking sort of post type. If you didn't read through that post and just skipped to this one I would recommend that you go back and <a href="http://new2wp.com/pro/WordPress-custom-post-types-object-oriented-series1/">review it first</a>. Otherwise here is the code that I left off with in posttypes.php.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
// Create a post type class for site posts
// To use as a bookmarking post type for sites you want to save/share.
class TypeSites {
    public $meta_fields = array( 'title', 'description', 'siteurl', 'category', 'post_tags' );

	public function TypeSites() {

        $siteArgs = array(
			'labels' =&gt; array(
                'name' =&gt; __( 'Sites', 'post type general name' ),
                'singular_name' =&gt; __( 'Site', 'post type singular name' ),
                'add_new' =&gt; __( 'Add New', 'site' ),
                'add_new_item' =&gt; __( 'Add New Site' ),
                'edit_item' =&gt; __( 'Edit Site' ),
                'new_item' =&gt; __( 'New Site' ),
                'view_item' =&gt; __( 'View Site' ),
                'search_items' =&gt; __( 'Search Sites' ),
                'not_found' =&gt;  __( 'No sites found in search' ),
                'not_found_in_trash' =&gt; __( 'No sites found in Trash' ),
			),
			'public' =&gt; true, 'show_ui' =&gt; true,
			'_builtin' =&gt; false,
			'capability_type' =&gt; 'post',
			'hierarchical' =&gt; false,
			'rewrite' =&gt; array('slug' =&gt; 'site'), // Permalinks. Fixes a 404 bug
			'query_var' =&gt; 'site',
			'taxonomies' =&gt;  array('category', 'post_tag'), // Add tags and categories taxonomies
			'supports' =&gt; array('title','editor','author','comments')
        );

        register_post_type( 'site', $siteArgs );	

	}

} // end of TypeSites{} class
?&gt;
</pre>
<p><a href="http://www.servage.net/?coupon=cust12648"><img src="http://images.servage.net/img/banners/smart/banner.php?type=fullbanner&amp;south=false" class="aligncenter" alt="Excellent Hosting- You Will Never Need Another Web Host Again" /></a>  </p>
<h2>Adding Methods To The Class Madness</h2>
<p>Starting where I left off, let's continue building our class by adding some methods, or functions as many people call them. First let's set up some custom columns for the Sites manage page. You've probably seen this code before but here it is again. </p>
<p><strong>UPDATED!</strong></p>
<pre class="brush: php; title: ; notranslate">
	// Create the columns and heading title text
	public function site_edit_columns($columns) {
        $columns = array(
			'cb' 		=&gt; '&lt;input type=&quot;checkbox&quot; /&gt;',
			'title' 		=&gt; 'Site Title',
			'url'	 	=&gt; 'URL',
			'category'	=&gt; 'Category',
			'post_tags' =&gt; 'Tags',
			'siteurl' 	=&gt; 'Screenshot',
        );
        return $columns;
    }
	// switching cases based on which $column we show the content of it
    public function site_custom_columns($column) {
		global $post;
        switch ($column) {
            case &quot;title&quot; : the_title();
                break;
            case &quot;url&quot; : $m = $this-&gt;mshot(150); echo '&lt;a href=&quot;'.$m[0].'&quot; target=&quot;_blank&quot;&gt;'.$m[0].'&lt;/a&gt;';
				break;
            case &quot;category&quot; : the_category();
				break;
            case &quot;post_tags&quot; : the_tags('',', ');
                break;
            case &quot;siteurl&quot; : $m = $this-&gt;mshot(150); echo $m[1];
				break;
        }
    }
</pre>
<p>The difference with this custom column code compared to other custom columns codes is that it is invoking a method to generate the content displayed in two of the columns. This is a method that I have added below as an update to this post. </p>
<p>It sets the variable $m to the method mshot() with a size of 150. The number is used to make the image size. It is required, but will not affect the output when just getting the Url. The mshot() function returns an array containing the values of the url and image output. In order to retrieve them, we echo $m[0] for Url, and $m[1] for the auto generated site screenshot. This might be difficult to follow, as it is hard to explain. It took me a while to figure out how to get it to work, hence the lateness in my update.</p>
<p>Now let's add two more functions. First is a function for hooking into the template redirect action in WordPress, which will be used for setting up use of <a href="http://new2wp.com/noob/wordpress-custom-templates-the-easy-and-most-logical-method/">custom templates</a> for Sites, which I'll explain more when we create new objects of this class.</p>
<p><strong>UPDATE</strong>: $wp variable should be $wp_query or you get Notice: Undefined index 'post_type' in... I just realized this sorry.</p>
<pre class="brush: php; title: ; notranslate">
	// Template redirect for custom templates
    public function template_redirect() {
        global $wp_query;
        if ($wp_query-&gt;query_vars['post_type'] == 'site') {
            include(TEMPLATEPATH . '/single-site.php'); // a custom single-slug.php template
            die();
        } else {
			$wp_query-&gt;is_404 = true;
		}
    }
</pre>
<p><a href="https://www.e-junkie.com/ecom/gb.php?cl=12635&#038;c=ib&#038;aff=81542" target="ejejcsingle"><img src="http://new2wp.com/wp-content/uploads/2010/06/WProckstar_468x60.jpg" alt="questions" title="questions" class="aligncenter size-full wp-image-1691" /></a><br />
This function is used for inserting new Site posts using the <span id="fixed">wp_insert_post()</span> function <a href="http://codex.wordpress.org/Function_Reference/wp_insert_post">now available in WordPress 3.0</a>. It will be extremely useful later on in the series, too.</p>
<pre class="brush: php; title: ; notranslate">
	// For inserting posts
    public function wp_insert_post($post_id, $post = null) {
        if ($post-&gt;post_type == &quot;site&quot;) {
            foreach ($this-&gt;meta_fields as $key) {
                $value = @$_POST[$key];
                if (empty($value)) {
                    delete_post_meta($post_id, $key);
                    continue;
                }
                if (!is_array($value)) {
                    if (!update_post_meta($post_id, $key, $value)) {
                        add_post_meta($post_id, $key, $value);
                    }
                } else {
                    delete_post_meta($post_id, $key);
                    foreach ($value as $entry) add_post_meta($post_id, $key, $entry);
                }
            }
        }
    }
</pre>
<p>Notice that the <span id="fixed">wp_insert_post()</span> function uses the <span id="fixed">$meta_fields</span> variable we've set up in the first tutorial. It is referred to using <span id="fixed">$this->meta_fields</span> since it is being used inside the class method.</p>
<h2>Adding Custom Meta Boxes</h2>
<p>Using the <span id="fixed">add_meta_box()</span> function you are able to hook into the posting page and add form fields. I plan to do a separate post for meta boxes as part of this post series so I am not going to go into much detail here. </p>
<p>Basically what is going on here is the <span id="fixed">admin_init()</span> function initializes the <span id="fixed">meta_options()</span> function. The <span id="fixed">meta_options()</span> function gets the Url if one exists in the input field, and runs it through a wacky little script I created for allowing submitted Urls to work whether they include the <span id="fixed">http://</span> part of the Url or not. So <strong>http://new2wp.com</strong> AND <strong>new2wp.com</strong> will both be accepted, and work with the following.</p>
<p>The Url is then used to create a new Url that is encoded and appended to <span id="fixed">http://s.wordpress.com/mshots/v1/</span> to create a live screenshot of the page which the Url points to.<br />
The input fields are then added. The first one is where you enter the Url, and the second one is just for making the new Url. The screenshot or properly known as, mshot, image it generates is then echoed out below the two input fields with the <span id="fixed">'?w=250'</span> parameter appended to the end of it. This is to tell the mshot image it should have a width of 250 pixels. This code took me quite some time to compile and get working so enjoy it.</p>
<pre class="brush: php; title: ; notranslate">
	// Add meta box
	function admin_init() {
        add_meta_box(&quot;siteS-meta&quot;, &quot;Site&quot;, array(&amp;$this, &quot;meta_options&quot;), &quot;site&quot;, &quot;side&quot;, &quot;high&quot;);
    }

	// Admin post meta contents
	public function meta_options() {
		global $post, $url;
		$custom = get_post_custom($post-&gt;ID);
		$url = $custom[&quot;siteurl&quot;][0];
		$myurl = trailingslashit( get_post_meta( $post-&gt;ID, 'siteurl', true ) );
		if ( $myurl != '' ) {
			if ( preg_match( &quot;/http(s?):\/\//&quot;, $myurl )) {
				$siteurl = get_post_meta( $post-&gt;ID, 'siteurl', true );
				$mshoturl = 'http://s.wordpress.com/mshots/v1/' . urlencode( $myurl );
			} else {
				$siteurl = 'http://' . get_post_meta( $post-&gt;ID, 'siteurl', true );
				$mshoturl = 'http://s.wordpress.com/mshots/v1/' . urlencode( 'http://' . $myurl );
			}
			$imgsrc  = '&lt;img src=&quot;' . $mshoturl . '?w=250&quot; alt=&quot;' . $title . '&quot; title=&quot;' . $title . '&quot; /&gt;';
		} ?&gt;
		&lt;p&gt;&lt;label&gt;Clean Url: &lt;input id=&quot;siteurl&quot; size=&quot;26&quot; name=&quot;siteurl&quot; value=&quot;&lt;?php echo $url; ?&gt;&quot; /&gt;&lt;/label&gt;&lt;/p&gt;
		&lt;p&gt;&lt;label&gt;Mshot Url: &lt;input id=&quot;mshoturl&quot; size=&quot;26&quot; name=&quot;mshoturl&quot; value=&quot;&lt;?php echo $mshoturl; ?&gt;&quot; /&gt;&lt;/label&gt;&lt;/p&gt;
		&lt;p&gt;&lt;?php echo '&lt;a href=&quot;'.$siteurl.'&quot;&gt;'.$imgsrc.'&lt;/a&gt;'; ?&gt;&lt;/p&gt;
	&lt;?php
	} // end meta options
</pre>
<h2>UPDATE: This Is A Newly Added Method</h2>
<p>I apologize for not including this originally, my bad. Here is one more method to include after the meta_options function. This will output either the Url of a site post, or the image source including the size of the image by passing the object a number for the size. An example of for how to use this, refer to the custom columns code above. You will notice that the Url and image are output to create the separate columns for each site post. <span id="fixed">$m = $this->mshot(150); echo $m[1];</span></p>
<pre class="brush: php; title: ; notranslate">
    public function mshot($mshotsize) {
        global $post, $url;
        $imgWidth = $mshotsize;
        $myurl = get_post_meta($post-&gt;ID, 'siteurl', true);
		if ( $myurl != '' ) {
			if ( preg_match( &quot;/http(s?):\/\//&quot;, $myurl )) {
				$siteurl = get_post_meta( $post-&gt;ID, 'siteurl', true );
				$mshoturl = 'http://s.wordpress.com/mshots/v1/' . urlencode( $myurl );
			} else {
				$siteurl = 'http://' . get_post_meta( $post-&gt;ID, 'siteurl', true );
				$mshoturl = 'http://s.wordpress.com/mshots/v1/' . urlencode('http://'.$myurl );
			}
		}
        $mshotimg = '&lt;img src=&quot;'.$mshoturl.'?w='.$imgWidth.'&quot; alt=&quot;'.get_the_title().'&quot; title=&quot;'.get_the_title().'&quot; /&gt;';

        return array( $siteurl, $mshotimg );
	}
</pre>
<p><a href="http://page.ly/?a=79976200" title="Page.ly WordPress hosting for people like you and me"><img border="0" src="http://page.ly/public/gfx/ab/pagely468x60_6.gif" alt="Page.ly WordPress hosting for people like you and me" class="aligncenter" /></a></p>
<h2>Initializing it for Takeoff</h2>
<p>We need to initialize the class functions, and add them to the dashboard admin, and then instantiate the class with a new object of it for hooking into the <span id="fixed">'init'</span> action. To do that you can add the following to your <span id="fixed">'register_post_type()</span> function just before the closing bracket.</p>
<p><strong>UPDATED!</strong> The correct hook for the <span id="fixed">'site_edit_columns'</span> should be <span id="fixed">manage_edit-site_columns()</span>.</p>
<pre class="brush: php; title: ; notranslate">
        add_action( 'admin_init', array(&amp;$this, 'admin_init') ); // this must be first
        add_action( 'template_redirect', array(&amp;$this, 'template_redirect') );
        add_action( 'wp_insert_post', array(&amp;$this, 'wp_insert_post'), 10, 2 );

		// add custom columns
		add_filter( 'manage_posts_custom_column', array( &amp;$this, 'site_custom_columns' ));
		add_action( 'manage_edit-site_columns', array ( &amp;$this, 'site_edit_columns' )); // manage_edit-{post_type}_columns used for custom post types
</pre>
<p>To make custom columns for custom post types, WordPress <span id="fixed">manage_post_custom_columns()</span> also uses <span id="fixed"><a href="http://codex.wordpress.org/Plugin_API/Action_Reference/manage_posts_custom_column">manage_edit-{post_type}_columns</a></span> to edit the custom post type manage post page columns. Just using manage_post_custom_columns for custom post types will cause your 'post' manage page to be overwritten with your custom columns.</p>
<p>After that you need to create a new object of the class to instantiate the class. This function will be used to make a new instance of the class. The function is then added to the init hook for WordPress.</p>
<pre class="brush: php; title: ; notranslate">
/* Initialize Post Types */
add_action('init', 'pTypesInit');
function pTypesInit() {
    global $sites;
    $sites = new TypeSites();
}
</pre>
<p>The <span id="fixed">pTypesInit()</span> function will be used to instantiate more post type classes later on in this series. By the time the series is over, the posttypes.php will be a work of art if ever one existed for custom post types.</p>
<h2>The Full Sites Custom Post Type Class</h2>
<p>This class is now complete. Of course you can always add or alter it however you like. Here is the full complete code.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
// Initialize the Class and add the action
add_action('init', 'pTypesInit');
function pTypesInit() {
    global $sites;
    $sites = new TypeSites();
}

// Create a post type class for 'Site' posts
// To use as a bookmarking post type for sites you want to save/share.
class TypeSites {

	// Store the data
	public $meta_fields = array( 'title', 'description', 'siteurl', 'category', 'post_tags' );

	// The post type constructor
	public function TypeSites() {

        $siteArgs = array(
			'labels' =&gt; array(
                'name' =&gt; __( 'Sites', 'post type general name' ),
                'singular_name' =&gt; __( 'Site', 'post type singular name' ),
                'add_new' =&gt; __( 'Add New', 'site' ),
                'add_new_item' =&gt; __( 'Add New Site' ),
                'edit_item' =&gt; __( 'Edit Site' ),

                'new_item' =&gt; __( 'New Site' ),
                'view_item' =&gt; __( 'View Site' ),
                'search_items' =&gt; __( 'Search Sites' ),
                'not_found' =&gt;  __( 'No sites found in search' ),
                'not_found_in_trash' =&gt; __( 'No sites found in Trash' ),
			),
			'public' =&gt; true, 'show_ui' =&gt; true,
			'_builtin' =&gt; false,
			'capability_type' =&gt; 'post',
			'hierarchical' =&gt; false,
			'rewrite' =&gt; array('slug' =&gt; 'site'), // Permalinks. Fixes a 404 bug
			'query_var' =&gt; 'site',
			'taxonomies' =&gt;  array('category', 'post_tag'), // Add tags and categories taxonomies
			'supports' =&gt; array('title','editor','author','comments')
        );
        register_post_type( 'site', $siteArgs );	

	// Initialize the methods
        add_action( 'admin_init', array(&amp;$this, 'admin_init') );
        add_action( 'template_redirect', array(&amp;$this, 'template_redirect') );
        add_action( 'wp_insert_post', array(&amp;$this, 'wp_insert_post'), 10, 2 );

		// add custom columns
		add_filter( 'manage_posts_custom_column', array( &amp;$this, 'site_custom_columns' ));
		add_action( 'manage_edit-site_columns', array ( &amp;$this, 'site_edit_columns' )); // manage_edit-{post_type}_columns used for custom post types

	}

	// Create the columns and heading title text
	public function site_edit_columns($columns) {
        $columns = array(
			'cb' 		=&gt; '&lt;input type=&quot;checkbox&quot; /&gt;',
			'title' 		=&gt; 'Site Title',
			'url'	 	=&gt; 'URL',
			'category'	=&gt; 'Category',
			'post_tags' =&gt; 'Tags',
			'siteurl' 	=&gt; 'Screenshot',
        );
        return $columns;
    }
	// switching cases based on which $column we show the content of it
    public function site_custom_columns($column) {
		global $post;
        switch ($column) {
            case &quot;title&quot; : the_title();
                break;
            case &quot;url&quot; : $m = $this-&gt;mshot(100); echo '&lt;a href=&quot;'.$m[0].'&quot; target=&quot;_blank&quot;&gt;'.$m[0].'&lt;/a&gt;';
				break;
            case &quot;category&quot; : the_category();
				break;
            case &quot;post_tags&quot; : the_tags('',', ');
                break;
            case &quot;siteurl&quot; : $m = $this-&gt;mshot(150); echo $m[1];
				break;
        }
    }

	// Template redirect for custom templates
    public function template_redirect() {
        global $wp_query;
        if ( $wp_query-&gt;query_vars[&quot;post_type&quot;] == &quot;site&quot; ) {
            include( TEMPLATEPATH . &quot;/single-site.php&quot; ); // a custom single-slug.php template
            die();
        } else {
			$wp_query-&gt;is_404 = true;
		}
    }

	// For inserting new 'site' post type posts
    public function wp_insert_post($post_id, $post = null) {
        if ($post-&gt;post_type == &quot;site&quot;) {
            foreach ($this-&gt;meta_fields as $key) {
                $value = @$_POST[$key];
                if (empty($value)) {
                    delete_post_meta($post_id, $key);
                    continue;
                }
                if (!is_array($value)) {
                    if (!update_post_meta($post_id, $key, $value)) {
                        add_post_meta($post_id, $key, $value);
                    }
                } else {
                    delete_post_meta($post_id, $key);
                    foreach ($value as $entry) add_post_meta($post_id, $key, $entry);
                }
            }
        }
    }

	// Add meta box
	function admin_init() {
        add_meta_box( &quot;sites-meta&quot;, &quot;Site&quot;, array( &amp;$this, &quot;meta_options&quot; ), &quot;site&quot;, &quot;side&quot;, &quot;low&quot; );
    }

	// Admin post meta contents
	public function meta_options() {
		global $post, $url;
		$custom = get_post_custom($post-&gt;ID);
		$url = $custom[&quot;siteurl&quot;][0];
		$myurl = trailingslashit( get_post_meta( $post-&gt;ID, 'siteurl', true ) );
		if ( $myurl != '' ) {
			// Check if url has http:// or not so works either way
			if ( preg_match( &quot;/http(s?):\/\//&quot;, $myurl )) {
				$siteurl = get_post_meta( $post-&gt;ID, 'siteurl', true );
				$mshoturl = 'http://s.wordpress.com/mshots/v1/' . urlencode( $myurl );
			} else {
				$siteurl = 'http://' . get_post_meta( $post-&gt;ID, 'siteurl', true );
				$mshoturl = 'http://s.wordpress.com/mshots/v1/' . urlencode( 'http://' . $myurl );
			}
			$imgsrc  = '&lt;img src=&quot;' . $mshoturl . '?w=250&quot; alt=&quot;' . $title . '&quot; title=&quot;' . $title . '&quot; /&gt;';
		} ?&gt;

		&lt;p&gt;&lt;label&gt;Clean Url: &lt;input id=&quot;siteurl&quot; size=&quot;26&quot; name=&quot;siteurl&quot; value=&quot;&lt;?php echo $url; ?&gt;&quot; /&gt;&lt;/label&gt;&lt;/p&gt;
		&lt;p&gt;&lt;?php echo '&lt;a href=&quot;' . $siteurl . '&quot;&gt;' . $imgsrc . '&lt;/a&gt;'; ?&gt;&lt;/p&gt;

	&lt;?php
	} // end meta options

	// Generate output for the url or image source for each site post
    public function mshot($mshotsize) {
        global $post, $url;
        $imgWidth = $mshotsize;
        $myurl = get_post_meta($post-&gt;ID, 'siteurl', true);
		if ( $myurl != '' ) {
			if ( preg_match( &quot;/http(s?):\/\//&quot;, $myurl )) {
				$siteurl = get_post_meta( $post-&gt;ID, 'siteurl', true );
				$mshoturl = 'http://s.wordpress.com/mshots/v1/' . urlencode( $myurl );
			} else {
				$siteurl = 'http://' . get_post_meta( $post-&gt;ID, 'siteurl', true );
				$mshoturl = 'http://s.wordpress.com/mshots/v1/' . urlencode('http://'.$myurl );
			}
		}
        $mshotimg = '&lt;img src=&quot;'.$mshoturl.'?w='.$imgWidth.'&quot; alt=&quot;'.get_the_title().'&quot; title=&quot;'.get_the_title().'&quot; /&gt;';

        return array( $siteurl, $mshotimg );
	}

} // end of TypeSites{} class
?&gt;
</pre>
<p>This concludes the building of your first fully functional and intuitive Php Class for constructing a <a href="http://codex.wordpress.org/Custom_Post_Types">WordPress 3.0 custom post type</a>. Save the posttypes.php file, and make sure to include it into your functions.php file. Then go to your dashboard to check out the new post type that should be added and working as a new section of the site. Please let me know of any mistakes I may have made or bugs that might be found. Cutting this code up and disecting it makes it easy for this to happen.</p>
<p><a href="#add"><img src="http://new2wp.com/wp-content/uploads/2010/06/questions.png" class="aligncenter" alt="Ask a question below" /></a><br />
We will be using much of this same code with some minor changes, and replacing certain functions with others according to the different post type classes. But first let's try out this new class by adding some objects to a couple custom WordPress templates.</p>
<p>The next tutorial shows how to instantiate the class, and build a custom post type WordPress loop to query the custom post types posts that have been submitted.</p>
<div class="postprev"><a href="/pro/wordpress-custom-post-types-object-oriented-series1">&laquo; Part 1</a></div>
<div class="postnext"><a href="/pro/wordpress-custom-post-types-object-oriented-series3">Part 3 &raquo;</a></div>
<div id="crp_related"><h3>Related Posts</h3><ul class="relatedposts"><li><a href="http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series3/" rel="bookmark" class="crp_title">OOPost Types: Objects Part 3 &#8211; Object Oriented WordPress 3.0 App</a></li><li><a href="http://new2wp.com/noob/create-metabox-custom-post-types/" rel="bookmark" class="crp_title">Create A Simple Metabox For Custom Post Types</a></li><li><a href="http://new2wp.com/noob/new2tip-allow-visitors-to-search-by-category/" rel="bookmark" class="crp_title">New2Tip: Allow Visitors To Search By Category</a></li><li><a href="http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series1/" rel="bookmark" class="crp_title">OOPost Types: Classes Part 1 – Object Oriented WordPress 3.0 App</a></li><li><a href="http://new2wp.com/rookie/sexy-rss-feeds-custom-content/" rel="bookmark" class="crp_title">Making Your RSS Feeds Sexy With Custom Content In WordPress</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series2/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>OOPost Types: Classes Part 1 – Object Oriented WordPress 3.0 App</title>
		<link>http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series1/</link>
		<comments>http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series1/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 11:00:09 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Pro]]></category>
		<category><![CDATA[Classes]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[Post types]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[wp3.0]]></category>

		<guid isPermaLink="false">http://new2wp.com/?p=1911</guid>
		<description><![CDATA[You like custom post types, and maybe you love/hate OOPhp. Now learn how to put them together to build a complex custom section of your WP site. 

This isn't the first article on WordPress custom post types and won't be the last. But I assure you that unlike all others, this one has classes. Too cheesey lol? Oh well, let's do this!!]]></description>
			<content:encoded><![CDATA[<h2>An OOP Post Series On WordPress 3.0 Custom Post Types</h2>
<p>I noticed how extremely in demand posts about custom post types are when I realized my <a href="http://new2wp.com/pro/wordpress-custom-post-types-and-taxonomies-done-right/">previous post</a> is apparently the most popular page of this site almost doubling the homepage in page views.</p>
<p><a href="http://codecanyon.net?ref=jaredwilli" target="_blank"><img src="http://envato.s3.amazonaws.com/referrer_adverts/cc_300x250_v2.gif" alt="Code Canyon - 1000s of Code Snippets and Scripts" border="0" class="alignright" /></a>So if it's post types you people want to know about or just what <a href="http://new2wp.com/tag/wp3-0/">WordPress 3.0</a> is now <em>really</em> capable of, then I will share with how to create classes for your post types, custom taxonomies, other various yet useful methods you can create for your classes, and then show you how to create objects which you can use in your WordPress theme to create a completely custom section of your site. I'll be incorporating some jQuery and Ajax even if all of that wasn't already enough.</p>
<p>I'll share with you some of the code that I've been writing and re-writing you don't even want to know how many times over again, in an effort to create what I want to call a super class for post types, but more on that later.</p>
<h3>What you will learn</h3>
<ul>
<li><strong>How to create classes for custom post types</strong></li>
<li><strong>Creating methods within your post type classes</strong></li>
<li><strong>Using new objects of your classes in theme templates</strong></li>
<li><strong>Plus much more to come...</strong></li>
</ul>
<p>I have been developing a complete application as a theme using multiple post types and taxonomies, classes and objects, and jQuery custom post forms which submit using the built in Ajax functions used to submit new posts in the dashboard, plus tons of other cool custom made capabilities. </p>
<p>It's a rather BIG project of mine that I started when 3.0 was still on the first beta version. Not sure how long ago that was, but I've been coding/designing this theme/app for MONTHS now, and it grows more complex and abstract every time I work on it. But enough about that, I could go on for days.</p>
<p><a href="https://www.e-junkie.com/ecom/gb.php?cl=12635&amp;c=ib&amp;aff=81542" target="ejejcsingle"><img src="http://new2wp.com/wp-content/uploads/2010/06/WProckstar_468x60.jpg" alt="Be A WordPress Rockstar" title="Be A WordPress Rockstar" class="aligncenter size-full wp-image-1691"></a></p>
<h2>The OOPost Types Class Is Now In Session!!!</h2>
<p>Since I don't really have a set number of posts planned for this series I'm not sure how to break it up. So I'll just start by showing how to build a class for a new custom post type.</p>
<p>You'll need to create a new file that will contain the code for the post type class and just name posttypes.php. In your theme directory create a new folder called /functions and save the posttypes.php file in there. This becomes useful in organizing your Php files and any custom code. </p>
<h2>1. Prepare your functions file</h2>
<p>Open your <strong>functions.php</strong> template for your theme and add the following code to the top before everything else.</p>
<pre class="brush: php; title: ; notranslate">
// Create a variable to the path to functions directory
$functionsdir = TEMPLATEPATH . '/functions';

// Include your posttypes.php file
require_once ( $functionsdir . '/posttypes.php' );
</pre>
<p>The functions directory variable will be useful, and while were here you might as well include your posttypes.php file so WordPress knows to do something with it. </p>
<h2>2. Declaring A Post Type Class</h2>
<p>Now you can start creating the class in posttypes.php. In Php you declare a class with the word <span id="fixed">class</span> followed by the name of the class followed by curly brackets { }. It's similar to the way you create functions in php only you can't use parenthesis like functions do for passing variables. It's common for class names to start with a Capital letter unlike functions too.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
// Create a post type class for site posts
// To use as a bookmarking post type for sites you want to save/share.
class TypeSites {

	// Do stuff...

} // end of TypeSites{} class
?&gt;
</pre>
<p>Within the brackets you can create methods which are really just functions, but are called methods. I may use both to refer to them just so you know what I mean. They are the same thing.</p>
<p>So now let's drop the code in here that you may have seen many times before for creating custom post types. Here's how I have set up the labels and other vars for a post type called Sites using the <span id="fixed">$labels</span> like <a href="http://new2wp.com/pro/wordpress-custom-post-types-and-taxonomies-done-right/">you are supposed to now</a>.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
// Create a post type class for site posts
// To use as a bookmarking post type for sites you want to save/share.
class TypeSites {

	public function TypeSites() {

        $siteArgs = array(
			'labels' =&gt; array(
                'name' =&gt; __( 'Sites', 'post type general name' ),
                'singular_name' =&gt; __( 'Site', 'post type singular name' ),
                'add_new' =&gt; __( 'Add New', 'site' ),
                'add_new_item' =&gt; __( 'Add New Site' ),
                'edit_item' =&gt; __( 'Edit Site' ),
                'new_item' =&gt; __( 'New Site' ),
                'view_item' =&gt; __( 'View Site' ),
                'search_items' =&gt; __( 'Search Sites' ),
                'not_found' =&gt;  __( 'No sites found in search' ),
                'not_found_in_trash' =&gt; __( 'No sites found in Trash' ),
			),
			'public' =&gt; true, 'show_ui' =&gt; true,
			'_builtin' =&gt; false,
			'capability_type' =&gt; 'post',
			'hierarchical' =&gt; false,
			'rewrite' =&gt; array('slug' =&gt; 'site'),
			'query_var' =&gt; 'site',
			'supports' =&gt; array('title','editor','author','comments')
        );

        register_post_type( 'site', $siteArgs );	

	}

} // end of TypeSites{} class
?&gt;
</pre>
<p>I won't explain what all of these are for since there's 2000 articles on the web about it, but you can see that I set the rewrite to use <span id="fixed">'site'</span> for the slug, and the query variable is set to <span id="fixed">'site'</span>, and finally what the post type supports is <span id="fixed">'title', 'editor', 'author', and 'comments'</span>.  </p>
<p>We can use the title and TinyMCE editor that posts use instead of having to create meta boxes for, and we want to allow for showing the author of a site post as well as let people post comments to the posts. In another custom post type later in the series I'll show you how to utilize the TinyMCE editor as a custom meta box, not the way the default one is used.</p>
<p>The only thing that we need now is an input field for the site url. For that we create a  <a href="http://codex.wordpress.org/Function_Reference/add_meta_box">custom meta box</a> which we'll create in part 2 of Classes.</p>
<p>Instead of adding a <a href="http://new2wp.com/pro/wordpress-custom-post-types-and-taxonomies-done-right/">custom taxonomy</a> for this post type so that we can organize the sites submitted properly, let's just use the built-in Tags and Categories in WordPress. This seems to be the best way to organize different sites I've found, unless you know a better way then please share.</p>
<p>The way you incorporate the tags and categories taxonomies is by adding the following to the <span id="fixed">$siteargs</span> array we've created.</p>
<pre class="brush: php; title: ; notranslate">
'taxonomies' =&gt;  array('category', 'post_tag'),
</pre>
<p>So now our class should look like this.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
// Create a post type class for site posts
// To use as a bookmarking post type for sites you want to save/share.
class TypeSites {

	public function TypeSites() {

        $siteArgs = array(
			'labels' =&gt; array(
                'name' =&gt; __( 'Sites', 'post type general name' ),
                'singular_name' =&gt; __( 'Site', 'post type singular name' ),
                'add_new' =&gt; __( 'Add New', 'site' ),
                'add_new_item' =&gt; __( 'Add New Site' ),
                'edit_item' =&gt; __( 'Edit Site' ),
                'new_item' =&gt; __( 'New Site' ),
                'view_item' =&gt; __( 'View Site' ),
                'search_items' =&gt; __( 'Search Sites' ),
                'not_found' =&gt;  __( 'No sites found in search' ),
                'not_found_in_trash' =&gt; __( 'No sites found in Trash' ),
			),
			'public' =&gt; true, 'show_ui' =&gt; true,
			'_builtin' =&gt; false,
			'capability_type' =&gt; 'post',
			'hierarchical' =&gt; false,
			'rewrite' =&gt; array('slug' =&gt; 'site'), // Permalinks. Fixes a 404 bug
			'query_var' =&gt; 'site',
			'taxonomies' =&gt;  array('category', 'post_tag'), // Add tags and categories taxonomies
			'supports' =&gt; array('title','editor','author','comments')
        );

        register_post_type( 'site', $siteArgs );	

	}

} // end of TypeSites{} class
?&gt;
</pre>
<h3>What's this public stuff?</h3>
<p>We will be creating some <span id="fixed">public</span> variables and functions in this class. What that means basically is they are accessible from anywhere in your script. It is the easiest to use <a href="http://www.tuxradar.com/practicalphp/6/7/0">access control modifier</a> because of this. </p>
<h3>Quick Overview of Access Control Modifiers</h3>
<ul><strong>Used for Variables or Functions...</strong></p>
<li><span id="fixed">Public</span> - Can be used from anywhere in the script.</li>
<li><span id="fixed">Private</span> - Can only be used by the object it is part of, it cannot be accessed elsewhere.</li>
<li><span id="fixed">Protected</span> - Can only be used by the object it is part of, or descendants of that class.</li>
<li><span id="fixed">Final</span> - Cannot be overridden in inherited classes.</li>
</ul>
<ul><strong>Used for Functions or Classes...</strong></p>
<li><span id="fixed">Abstract</span> - Cannot be used directly. Must inherited from the functions or class first.</li>
</ul>
<p>We need to create a <a href="http://www.tuxradar.com/practicalphp/6/7/1">public variable</a> that is used to store an array of the post data <span id="fixed">'title', 'content', 'siteurl', 'category', and 'post_tags'</span>. Add the variable to the top of the class just after the first curly bracket like this.</p>
<pre class="brush: php; title: ; notranslate">
class TypeSites {
    public $meta_fields = array( 'title', 'description', 'siteurl', 'category', 'post_tags' );
</pre>
<p><strong>The class should now look like this.</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
// Create a post type class for site posts
// To use as a bookmarking post type for sites you want to save/share.
class TypeSites {
    public $meta_fields = array( 'title', 'description', 'siteurl', 'category', 'post_tags' );

	public function TypeSites() {

        $siteArgs = array(
			'labels' =&gt; array(
                'name' =&gt; __( 'Sites', 'post type general name' ),
                'singular_name' =&gt; __( 'Site', 'post type singular name' ),
                'add_new' =&gt; __( 'Add New', 'site' ),
                'add_new_item' =&gt; __( 'Add New Site' ),
                'edit_item' =&gt; __( 'Edit Site' ),
                'new_item' =&gt; __( 'New Site' ),
                'view_item' =&gt; __( 'View Site' ),
                'search_items' =&gt; __( 'Search Sites' ),
                'not_found' =&gt;  __( 'No sites found in search' ),
                'not_found_in_trash' =&gt; __( 'No sites found in Trash' ),
			),
			'public' =&gt; true, 'show_ui' =&gt; true,
			'_builtin' =&gt; false,
			'capability_type' =&gt; 'post',
			'hierarchical' =&gt; false, // like 'post' not 'page'
			'rewrite' =&gt; array('slug' =&gt; 'site'), // Permalinks. Fixes a 404 bug
			'query_var' =&gt; 'site',
			'taxonomies' =&gt;  array('category', 'post_tag'), // Add tags and categories taxonomies
			'supports' =&gt; array( 'title', 'editor', 'author', 'comments' )
        );

        register_post_type( 'site', $siteArgs );	

	}

} // end of TypeSites{} class
?&gt;
</pre>
<p>Notice how the first function that has the post type registration code and stuff has the same name as the class itself. This is one way of creating the class <span id="fixed">__construct()</span> method for the class, making it run automatically when the class is instantiated. I'll go over <span id="fixed">__construct()</span> and <span id="fixed">__destruct()</span> methods later on in more detail. </p>
<h2>Building The Class Methods</h2>
<p>In the next part of this series we will add some methods to this class, and really start to boogie down with some Object Oriented Php custom post types. </p>
<div class="post-next"><a href="/pro/wordpress-custom-post-types-object-oriented-series2">Continue To OOPost Types Classes Part 2 &raquo;</a></div>
<div id="crp_related"><h3>Related Posts</h3><ul class="relatedposts"><li><a href="http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series2/" rel="bookmark" class="crp_title">OOPost Types: Methods Part 2 &#8211; Object Oriented WordPress 3.0 App</a></li><li><a href="http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series3/" rel="bookmark" class="crp_title">OOPost Types: Objects Part 3 &#8211; Object Oriented WordPress 3.0 App</a></li><li><a href="http://new2wp.com/noob/show-multiple-custom-post-type-posts-query-sidebar/" rel="bookmark" class="crp_title">Showing Posts From Multiple Custom Post Types In The Loop</a></li><li><a href="http://new2wp.com/noob/wordpress-search-custom-post-types/" rel="bookmark" class="crp_title">New2Tip: How To Include Custom Post Types In WordPress Search</a></li><li><a href="http://new2wp.com/pro/wp3-register-labels-update/" rel="bookmark" class="crp_title">Important Update: Register Taxonomies And Post Types With Labels</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series1/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>WordPress Custom Post Types And Taxonomies The Right Way</title>
		<link>http://new2wp.com/pro/wordpress-custom-post-types-and-taxonomies-done-right/</link>
		<comments>http://new2wp.com/pro/wordpress-custom-post-types-and-taxonomies-done-right/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 13:00:35 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Pro]]></category>
		<category><![CDATA[Post types]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Taxonomies]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[wp3.0]]></category>

		<guid isPermaLink="false">http://new2wp.com/?p=1671</guid>
		<description><![CDATA[You've seen a million how-to's, <a href="http://new2wp.com/tag/wp3-0/">tutorials and articles</a> talking about WordPress custom post types and taxonomies. Now learn how to create both of them the right way. This definitive guide will show what others have left out, and everything else you did or didn't know about post types and taxonomies.]]></description>
			<content:encoded><![CDATA[<h2>An Important Update: WordPress 3.0 Post Types And Taxonomies</h2>
<p><a href="http://themeforest.net/?ref=jaredwilli" target="_blank"><img src="http://envato.s3.amazonaws.com/referrer_adverts/tf_300x250_v5.gif" alt="ThemeForest - Themes and Templates" border="0" class="alignright" /></a><br />
I remember posting about <a href="http://new2wp.com/pro/wp3-register-labels-update/">this important update</a> that was made to the way custom post types and custom taxonomies could and should be created in order to properly set them up for full customization. I wrote about it the day after the update was pushed to the WordPress SVN in one of the beta versions. </p>
<p>I don't think this change got enough exposure. At the very least I didn't expect to be the only one to explain it as I <a href="http://new2wp.com/pro/wp3-register-labels-update/">did here</a> as the only other article explaining it besides what the Codex says on it. Because of this and <a href="http://new2wp.com/author/afj176/">Antonio</a> mentioning to me yesterday after he noticed that out of all his bookmarks for post types, no one has explained this,  I decided to post a complete how-to, in setting up custom post types and taxonomies the RIGHT way. If I had known this would've been so highly overlooked down the line, I would've written a post like this instead of the less in-depth explanation I did when the change was first made.</p>
<h2>Quick Jump Menu:</h2>
<ul>
<li><a href="#posttypes">Custom Post Types Done Right</a></li>
<li><a href="#posttype-functions">Working With Post Types: Functions You Should Know</a></li>
</ul>
<ul>
<li><a href="#taxonomies">Custom Taxonomies The Right Way</a></li>
<li><a href="#taxonomy-functions">Working With Taxonomies: More Useful Functions For You!</a></li>
</ul>
<p>Use the links listed above to jump down to the part of this post you're interested in.</p>
<h2><a name="posttypes" id="posttypes">Using Labels For Post Types</a></h2>
<p>The use of labels for custom post types and taxonomies is important for the fact that it helps differentiate your custom stuff from the other things in WordPress that already exist. When you go to add a new post, page, category or tag, at the top of the page it says <em>Add New _Thing_</em>, depending on what it is your adding. If you don't use labels to change this to read whatever the custom thing you create is, then it will default to Post for post types, and Category or Tags for taxonomies that are either hierarchical or not, respectively. </p>
<p><strong>Here's what you see without using labels:</strong></p>
<p><img src="http://new2wp.com/wp-content/uploads/2010/06/post-tax-defaults.png" class="aligncenter" alt="Default Labels" /><br />
<img src="http://new2wp.com/wp-content/uploads/2010/06/post-tax-defaults2.png" class="aligncenter" alt="Default Labels" /></p>
<p>This is collage of different places post type labels are used in the dashboard, like when you add new, search or edit posts, tags categories, etc. It's also what you will see if you create custom post types or taxonomies the way everyone else has said to create them besides me, without the use of labels.</p>
<h3>Setting up labels to show the custom post type</h3>
<p>As I mentioned in my first post on labels, the <a href="http://codex.wordpress.org/Function_Reference/register_post_type#Arguments">WordPress Codex has documented this</a> as well, if you hadn't noticed. Here's a quick review using the example they provide.</p>
<pre class="brush: php; title: ; notranslate">
// The register_post_type() function is not to be used before the 'init'.
add_action( 'init', 'my_custom_init' );

/* Here's how to create your customized labels */
function my_custom_init() {
	$labels = array(
		'name' =&gt; _x( 'Books', 'post type general name' ), // Tip: _x('') is used for localization
		'singular_name' =&gt; _x( 'Book', 'post type singular name' ),
		'add_new' =&gt; _x( 'Add New', 'book' ),
		'add_new_item' =&gt; __( 'Add New Book' ),
		'edit_item' =&gt; __( 'Edit Book' ),
		'new_item' =&gt; __( 'New Book' ),
		'view_item' =&gt; __( 'View Book' ),
		'search_items' =&gt; __( 'Search Books' ),
		'not_found' =&gt;  __( 'No books found' ),
		'not_found_in_trash' =&gt; __( 'No books found in Trash' ),
		'parent_item_colon' =&gt; ''
	);

	// Create an array for the $args
	$args = array( 'labels' =&gt; $labels, /* NOTICE: the $labels variable is used here... */
		'public' =&gt; true,
		'publicly_queryable' =&gt; true,
		'show_ui' =&gt; true,
		'query_var' =&gt; true,
		'rewrite' =&gt; true,
		'capability_type' =&gt; 'post',
		'hierarchical' =&gt; false,
		'menu_position' =&gt; null,
		'supports' =&gt; array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )
	); 

	register_post_type( 'book', $args ); /* Register it and move on */
}
</pre>
<p>It is obviously more coding this way compared to every other article you've probably read on this, but it is how you can make your post types more custom, since they are custom post types after all. It only takes 2 seconds more to do this anyways.</p>
<p><strong>Now you will see the correct post type as shown here.</strong></p>
<p><img src="http://new2wp.com/wp-content/uploads/2010/06/post-tax-defaults3.png" class="aligncenter" alt="Default Labels" /></p>
<p>You get the idea I hope now, right? See how much better that looks, to you, your clients, or any other users of the site who will see the complete customization of your post types. They will think you are some kind of god, or something....</p>
<h2><a name="posttype-functions" id="posttype-functions">Additional Post Type Functions You Should Know About</a></h2>
<p>The following are functions you can use for various things related to post types. The function name is linked to the line in <a href="http://xref.yoast.com/trunk/nav.html?wp-includes/post.php.source.html">/wp-includes/post.php</a> where it is created for those that would like to check out the source code which makes them work. I've also added a short description for each that is used in the source to describe them.</p>
<p><strong>Post Type Functions:</strong></p>
<ul>
<li><a href="http://core.trac.wordpress.org/browser/trunk/wp-includes/post.php#L684"><span id="fixed">post_type_exists()</span></a> - Checks if a post type is registered.</li>
</ul>
<ul>
<li><a href="http://xref.yoast.com/trunk/wp-includes/post.php.source.html#l662"><span id="fixed">is_post_type_hierarchical( $post_type )</span></a> - Whether the post type is hierarchical. A false return value might also mean that the post type does not exist.</li>
</ul>
<ul>
<li><a href="http://xref.yoast.com/trunk/wp-includes/post.php.source.html#l727"><span id="fixed">get_post_type( $post )</span></a> - Retrieve the post type of the current post or of a given post.</li>
</ul>
<ul>
<li><a href="http://xref.yoast.com/trunk/wp-includes/post.php.source.html#l718"><span id="fixed">get_post_type_object( $post_type )</span></a> - Retrieve a post type object by name.</li>
</ul>
<ul>
<li><a href="http://xref.yoast.com/trunk/wp-includes/post.php.source.html#l740"><span id="fixed">get_post_types( $post )</span></a> - Get a list of all registered post type objects.
<ul>
<li><span id="fixed">$args</span> - <em>An array of key => value arguments to match against the post type objects.</em></li>
<li><span id="fixed">$output</span> - The type of output to return, either post type 'names' or 'objects'. <em>'names' is the default.</em></li>
<li><span id="fixed">$operator</span> - The logical operation to perform. 'or' means only one element from the array needs to match; 'and' means all elements must match. <em>The default is 'and'.</em></li>
<li>Returns an array listing post type names or objects.</li>
</ul>
</li>
</ul>
<ul>
<li><a href="http://xref.yoast.com/trunk/wp-includes/post.php.source.html#l763"><span id="fixed">register_post_type()</span></a> - Register a post type. Do not use before init.
<ul>
<li>A simple function for creating or modifying a post type based on the parameters given.</li>
<li>The function will accept an array (second optional parameter), along with a string for the post type name.</li>
</ul>
</li>
</ul>
<ul>
<li><a href="http://xref.yoast.com/trunk/wp-includes/post.php.source.html#l891"><span id="fixed">get_post_type_capabilities()</span></a> - Builds an object with all post type capabilities out of a post type object.</li>
<li>Accepted keys of the capabilities array in the post type object:
<ul>
<li><span id="fixed">edit_post</span> - The meta capability that controls editing a particular object of this post type. <em>Defaults to "edit_ . $capability_type" (edit_post).</em></li>
<li><span id="fixed">edit_posts</span> - The capability that controls editing objects of this post type as a class. <em>Defaults to "edit_ . $capability_type . s" (edit_posts).</em></li>
<li><span id="fixed">edit_others_posts</span> - The capability that controls editing objects of this post type that are owned by other users. <em>Defaults to "edit_others_ . $capability_type . s" (edit_others_posts).</em></li>
<li><span id="fixed">publish_posts</span> - The capability that controls publishing objects of this post type. <em>Defaults to "publish_ . $capability_type . s" (publish_posts).</em></li>
<li><span id="fixed">read_post</span> - The meta capability that controls reading a particular object of this post type. <em>Defaults to "read_ . $capability_type" (read_post).</em></li>
<li><span id="fixed">read_private_posts</span> - The capability that controls reading private posts. <em>Defaults to "read_private . $capability_type . s" (read_private_posts).</em></li>
<li><span id="fixed">delete_post</span> - The meta capability that controls deleting a particular object of this post type. <em>Defaults to "delete_ . $capability_type" (delete_post).</em></li>
</ul>
</li>
</ul>
<p style="margin:0; padding:0;"><a href="http://wpvote.com" target="_blank"><img src="http://new2wp.com/wp-content/uploads/2010/06/wpvoteheader.jpg" alt="WP Vote All WordPress Always" title="Vote this post up on WP Vote" class="aligncenter" /></a></p>
<ul>
<li><a href="http://xref.yoast.com/trunk/wp-includes/post.php.source.html#l921"><span id="fixed">get_post_type_labels( $post_type_object )</span></a> - Builds an object with all post type labels out of a post type object.</li>
<li>Accepted keys of the label array in the post type object:
<ul>
<li><span id="fixed">name</span> - general name for the post type, usually plural. The same and overriden by $post_type_object->label. <em>Default is Posts/Pages</em></li>
<li><span id="fixed">singular_name</span> - name for one object of this post type. <em>Default is Post/Page</em></li>
<li><span id="fixed">add_new</span> - <em>Default is Add New for both hierarchical and non-hierarchical types.</em></li>
<li><span id="fixed">add_new_item</span> - <em>Default is Add New Post/Add New Page</em></li>
<li><span id="fixed">edit_item</span> - <em>Default is Edit Post/Edit Page</em></li>
<li><span id="fixed">new_item</span> - <em>Default is New Post/New Page</em></li>
<li><span id="fixed">view_item</span> - <em>Default is View Post/View Page</em></li>
<li><span id="fixed">search_items</span> - <em>Default is Search Posts/Search Pages</em></li>
<li><span id="fixed">not_found</span> - <em>Default is No posts found/No pages found</em></li>
<li><span id="fixed">not_found_in_trash</span> - <em>Default is No posts found in Trash/No pages found in Trash</em></li>
<li><span id="fixed">parent_item_colon</span> - This string isn't used on non-hierarchical types. (<em>In hierarchical ones the default is Parent Page</em>)</li>
</ul>
</li>
</ul>
<ul>
<li><a href="http://xref.yoast.com/trunk/wp-includes/post.php.source.html#l959"><span id="fixed">_get_custom_object_labels()</span></a> - Builds an object with custom-something object (post type, taxonomy) labels out of a custom-something object</li>
</ul>
<ul>
<li><a href="http://xref.yoast.com/trunk/wp-includes/post.php.source.html#l980"><span id="fixed">add_post_type_support( $post_type, $feature )</span></a> - Register support of certain features for a post type.</li>
<li>All features are directly associated with a functional area of the edit screen, such as the editor or a meta box:
<ul>
<li><span id="fixed">'title', </span></li>
<li><span id="fixed">'editor', </span></li>
<li><span id="fixed">'comments', </span></li>
<li><span id="fixed">'revisions', </span></li>
<li><span id="fixed">'trackbacks'</span></li>
<li><span id="fixed">'author', </span></li>
<li><span id="fixed">'excerpt', </span></li>
<li><span id="fixed">'page-attributes', </span></li>
<li><span id="fixed">'thumbnail', </span></li>
<li><span id="fixed">'custom-fields'</span></li>
</ul>
<p>  Additionally, the 'revisions' feature dictates whether the post type will store revisions, and the 'comments' feature dicates whether the comments count will show on the edit screen.</li>
</ul>
<ul>
<li><a href="http://xref.yoast.com/trunk/wp-includes/post.php.source.html#l1006"><span id="fixed">remove_post_type_support( $post_type )</span></a> - Remove support for a feature from a post type.</li>
</ul>
<ul>
<li><a href="http://xref.yoast.com/trunk/wp-includes/post.php.source.html#l1023"><span id="fixed">post_type_supports( $post_type, $feature )</span></a> - Checks a post type's support for a given feature.</li>
</ul>
<ul>
<li><a href="http://xref.yoast.com/trunk/wp-includes/post.php.source.html#l1048"><span id="fixed">set_post_type( $post_id = 0, $post_type = 'post' )</span></a> - Updates the post type for the post ID.
<ul>
<li><span id="fixed">$post_id</span> Post ID to change post type. <em>Not actually optional.</em></li>
<li><span id="fixed">$post_type</span> Optional, default is post. <em>Supported values are 'post' or 'page' to name a few.</em></li>
<li>Return int Amount of rows changed. <em>Should be 1 for success and 0 for failure.</em></li>
</ul>
</li>
</ul>
<ul>
<li><a href="http://xref.yoast.com/trunk/wp-includes/post.php.source.html#l1076"><span id="fixed">get_posts()</span></a> - Retrieve list of latest posts or posts matching criteria.
<li>The defaults are:</li>
<ul>
<li><span id="fixed">'numberposts'</span> - <em>Default is 5. Total number of posts to retrieve.</em></li>
<li><span id="fixed">'offset'</span> - <em>Default is 0. See { WP_Query::query() } for more.</em></li>
<li><span id="fixed">'category'</span> - <em>What category to pull the posts from.</em></li>
<li><span id="fixed">'orderby'</span> - <em>Default is 'post_date'. How to order the posts.</em></li>
<li><span id="fixed">'order'</span> - <em>Default is 'DESC'. The order to retrieve the posts.</em></li>
<li><span id="fixed">'include'</span> - <em>See { WP_Query::query() } for more.</em></li>
<li><span id="fixed">'exclude'</span> - <em>See { WP_Query::query() } for more.</em></li>
<li><span id="fixed">'meta_key'</span> - <em>See { WP_Query::query() } for more.</em></li>
<li><span id="fixed">'meta_value'</span> - <em>See { WP_Query::query() } for more.</em></li>
<li><span id="fixed">'post_type'</span> - <em>Default is 'post'. Can be 'page', or 'attachment' to name a few.</em></li>
<li><span id="fixed">'post_parent'</span> - <em>The parent of the post or post type.</em></li>
<li><span id="fixed">'post_status'</span> - <em>Default is 'published'. Post status to retrieve.</em></li>
</ul>
</li>
</ul>
<p>Alternatively to using <span id="fixed">get_posts()</span>, you should also learn about the <a href="http://new2wp.com/noob/query_posts-wp_query-differences/">difference between <span id="fixed">WP_Query()</span> and <span id="fixed">query_posts()</span></a> for retrieving post information.</p>
<p>I plan to cover <span id="fixed">get_posts()</span> more in a future post.</p>
<p><a href="#add"><img src="http://new2wp.com/wp-content/uploads/2010/06/questions.png" alt="questions" title="questions" width="548" height="116" class="aligncenter size-full wp-image-1691" /></a></p>
<h2><a name="taxonomies" id="taxonomies">Using Labels For Taxonomies</a></h2>
<p>Also mentioned in <a href="http://new2wp.com/pro/wp3-register-labels-update/">my previous post</a> was using labels when creating custom taxonomies. This is also <a href="http://codex.wordpress.org/Function_Reference/register_taxonomy#Arguments">documented in the WordPress Codex</a> just so you know. I will cover it a little more in-depth though.</p>
<h3>Here's the example used in the Codex:</h3>
<p>First snippet is hierarchical. The same thing as WordPress 'category' taxonomy.</p>
<pre class="brush: php; title: ; notranslate">
// hook into the init action and call create_book_taxonomies() when it fires
add_action( 'init', 'create_book_taxonomies', 0 );

// create two taxonomies, genres and writers for the post type &quot;book&quot;
function create_book_taxonomies() {

	// Add new taxonomy, make it hierarchical (like categories)
	$labels = array(
		'name' =&gt; _x( 'Genres', 'taxonomy general name' ),
		'singular_name' =&gt; _x( 'Genre', 'taxonomy singular name' ),
		'search_items' =&gt;  __( 'Search Genres' ),
		'all_items' =&gt; __( 'All Genres' ),
		'parent_item' =&gt; __( 'Parent Genre' ),
		'parent_item_colon' =&gt; __( 'Parent Genre:' ),
		'edit_item' =&gt; __( 'Edit Genre' ),
		'update_item' =&gt; __( 'Update Genre' ),
		'add_new_item' =&gt; __( 'Add New Genre' ),
		'new_item_name' =&gt; __( 'New Genre Name' ),
	); 	

	register_taxonomy( 'genre', array( 'book' ), array(
		'hierarchical' =&gt; true,
		'labels' =&gt; $labels, /* NOTICE: Here is where the $labels variable is used */
		'show_ui' =&gt; true,
		'query_var' =&gt; true,
		'rewrite' =&gt; array( 'slug' =&gt; 'genre' ),
	));
</pre>
<p>The next snippet is for creating non-hierarchical taxonomies such as Tags in WordPress</p>
<pre class="brush: php; title: ; notranslate">
	// Add new taxonomy, NOT hierarchical (like tags)
	$labels = array(
		'name' =&gt; _x( 'Writers', 'taxonomy general name' ),
		'singular_name' =&gt; _x( 'Writer', 'taxonomy singular name' ),
		'search_items' =&gt;  __( 'Search Writers' ),
		'popular_items' =&gt; __( 'Popular Writers' ),
		'all_items' =&gt; __( 'All Writers' ),
		'parent_item' =&gt; null,
		'parent_item_colon' =&gt; null,
		'edit_item' =&gt; __( 'Edit Writer' ),
		'update_item' =&gt; __( 'Update Writer' ),
		'add_new_item' =&gt; __( 'Add New Writer' ),
		'new_item_name' =&gt; __( 'New Writer Name' ),
		'separate_items_with_commas' =&gt; __( 'Separate writers with commas' ),
		'add_or_remove_items' =&gt; __( 'Add or remove writers' ),
		'choose_from_most_used' =&gt; __( 'Choose from the most used writers' )
	);
	register_taxonomy( 'writer', 'book', array(
		'hierarchical' =&gt; false,
		'labels' =&gt; $labels, /* NOTICE: the $labels variable here */
		'show_ui' =&gt; true,
		'query_var' =&gt; true,
		'rewrite' =&gt; array( 'slug' =&gt; 'writer' ),
	));
} // End of create_book_taxonomies() function.
</pre>
<p>You may have noticed that this is very similar to how labels are used for creating post types. That's because they are almost identical! You can choose to do either method, using the <span id="fixed">$args</span> variable to set up the arguments as shown in the post types snippet, or you can just do it as shown above in the taxonomies snippets. It's up to you, however you want to organize your code.</p>
<p><strong>Here's how taxonomies with labels now looks.</strong></p>
<p><img src="http://new2wp.com/wp-content/uploads/2010/06/post-tax-defaults3.png" class="aligncenter" alt="Default Labels" /></p>
<p>I'm going to assume you get the point and I don't need to take screenshots of how the non-hierarchical taxonomy will look. It's the same deal different word.</p>
<h2><a name="taxonomy-functions" id="taxonomy-functions">Functions For Taxonomies You Should Know About</a></h2>
<p>The following are functions which you can use when working with taxonomies. I'm not going to link to the line of each function or include descriptions of each since the file which contains them is way smaller than posts.php where the post type functions are, so if you're interested in viewing the source of these you should've have a hard time finding the line they are on. </p>
<p><strong>The functions which make up taxonomies are located in <a href="http://core.trac.wordpress.org/browser/trunk/wp-includes/taxonomy.php">/wp-includes/taxonomy.php</a> of the WordPress source. </strong></p>
<ul>
<li><span id="fixed">get_taxonomies()</span> - Get a list of registered taxonomy objects.</li>
<li><span id="fixed">get_object_taxonomies()</span> - Return all of the taxonomy names that are of $object_type.</li>
<li><span id="fixed">get_taxonomy()</span> - Retrieves the taxonomy object of $taxonomy.</li>
<li><span id="fixed">taxonomy_exists()</span> - Checks that the taxonomy name exists.</li>
<li><span id="fixed">is_taxonomy_hierarchical()</span> - Whether the taxonomy object is hierarchical.</li>
<li><span id="fixed">register_taxonomy - Create or modify a taxonomy object. Do not use before init.</li>
<li><span id="fixed">get_taxonomy_labels()</span> - Builds an object with all taxonomy labels out of a taxonomy object</li>
<li><span id="fixed">register_taxonomy_for_object_type()</span> - Add an already registered taxonomy to an object type.</li>
<li><span id="fixed">get_objects_in_term()</span> - Retrieve object_ids of valid taxonomy and term.</li>
<li><span id="fixed">&amp;get_term()</span> - Get all Term data from database by Term ID.</li>
<li><span id="fixed">get_term_by()</span> - Get all Term data from database by Term field and data.</li>
<li><span id="fixed">get_terms()</span> - Retrieve the terms in a given taxonomy or list of taxonomies.</li>
<li><span id="fixed">is_term()</span> - Returns the index of a defined term, or 0 (false) if the term doesn't exist.</li>
<li><span id="fixed">sanitize_term()</span> - Sanitize Term all fields.</li>
<li><span id="fixed">wp_count_terms()</span> - Count how many terms are in Taxonomy.</li>
<li>Default <span id="fixed">$args</span> is <span id="fixed">'hide_empty'</span> which can be <span id="fixed">'hide_empty=true'</span> or <span id="fixed">array( 'hide_empty' => true )</span>.</li>
<li><span id="fixed">wp_insert_term()</span> - Adds a new term to the database. Optionally marks it as an alias of an existing term.</li>
<li><span id="fixed">wp_set_object_terms()</span> - Create Term and Taxonomy Relationships.</li>
<li><span id="fixed">&amp;_get_term_children()</span> - Get the subset of $terms that are descendants of $term_id.</li>
<li><span id="fixed">get_term_link()</span> - Generates a permalink for a taxonomy term archive.</li>
<li><span id="fixed">the_taxonomies()</span> - Display the taxonomies of a post with available options.</li>
<li><span id="fixed">get_the_taxonomies()</span> - Retrieve all taxonomies associated with a post.</li>
<li><span id="fixed">get_post_taxonomies()</span> - Retrieve all taxonomies of a post with just the names.</li>
</ul>
<p><a href="https://www.e-junkie.com/ecom/gb.php?cl=12635&#038;c=ib&#038;aff=81542" target="ejejcsingle"><img src="http://new2wp.com/wp-content/uploads/2010/06/WProckstar_468x60.jpg" alt="questions" title="questions" class="aligncenter size-full wp-image-1691" /></a></p>
<p>I don't think I can squeeze anymore about custom post types or taxonomies into this post without copying and pasting the complete source code from the taxonomy.php and post.php files in WordPress. That's just not going to happen, you got enough of the source already I'm sure.</p>
<p>Let me know what you think, and if you have comments...</p>
<div id="crp_related"><h3>Related Posts</h3><ul class="relatedposts"><li><a href="http://new2wp.com/pro/wp3-register-labels-update/" rel="bookmark" class="crp_title">Important Update: Register Taxonomies And Post Types With Labels</a></li><li><a href="http://new2wp.com/noob/wordpress-search-custom-post-types/" rel="bookmark" class="crp_title">New2Tip: How To Include Custom Post Types In WordPress Search</a></li><li><a href="http://new2wp.com/noob/query_posts-wp_query-differences/" rel="bookmark" class="crp_title">Understanding The Difference Between query_posts and WP_Query</a></li><li><a href="http://new2wp.com/noob/show-multiple-custom-post-type-posts-query-sidebar/" rel="bookmark" class="crp_title">Showing Posts From Multiple Custom Post Types In The Loop</a></li><li><a href="http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series1/" rel="bookmark" class="crp_title">OOPost Types: Classes Part 1 – Object Oriented WordPress 3.0 App</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://new2wp.com/pro/wordpress-custom-post-types-and-taxonomies-done-right/feed/</wfw:commentRss>
		<slash:comments>55</slash:comments>
		</item>
		<item>
		<title>How To Create WordPress Dashboard Themes And Styles</title>
		<link>http://new2wp.com/pro/wordpress-dashboard-themes/</link>
		<comments>http://new2wp.com/pro/wordpress-dashboard-themes/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 13:00:20 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Pro]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Custom Dashboard]]></category>
		<category><![CDATA[Dashboard]]></category>
		<category><![CDATA[Functions]]></category>

		<guid isPermaLink="false">http://new2wp.com/?p=922</guid>
		<description><![CDATA[If you ever wanted to make your site's dashboard area look more customized to fit your site, well here are some ways you can do that.

I'm here to completely unlock the secrets of the WordPress Dashboard design and open up a whole new world of customization for WordPress users everywhere.]]></description>
			<content:encoded><![CDATA[<h2>Giving The Dashboard Some Style</h2>
<p>In the past I've posted similar tutorials which show how to <a href="http://new2wp.com/rookie/customize-the-wordpress-dashboard-header-even-more/">customize the WordPress dashboard header</a> and <a href="http://new2wp.com/rookie/change-the-color-wordpress-dashboard-and-replace-logo-with-yours/">changing just the logo and color</a>, but that's boring stuff. </p>
<p>You've probably seen these types of posts a million times all over the web. There's no other tutorial that I've been able to find which shows you what this one does. You may be able to understand why if you knew that the Stylesheet used for the WordPress dashboard has <strong>3,242 lines of CSS code</strong> most of which contains hundreds of CSS selectors that have one single style attribute applied to them. So when you do the math, that equals a long list of selector attributes which you'd need style in order to completely alter the WordPress dashboard.</p>
<p>Despite the fact there were only <a href="http://new2wp.com/noob/want-towordpress-dashboard-themes/#comments">2 comments</a> on the post from a couple weeks ago trying to find out <a href="http://new2wp.com/noob/want-towordpress-dashboard-themes/">how many people were interested</a> to learn how to style the WordPress dashboard completely to match their sites theme, I've decided to make this tutorial. I checked out the page visits to that post and there were a number of people that were visited the page, but were just too lazy to post a comment since it wasn't an actual tutorial. So this is somewhat of interest to people I think just from that.</p>
<p>If you'd like to get an idea of how gigantically huge the Stylesheet really is, when you're logged into your WordPress dashboard and view the page source. In the source code near the top you should see a line that has something like this <em>http://YOUR_SITE.com/wp-admin/load-styles.php?c=1&amp;dir=ltr&amp;load=theme-editor,global,wp-admin&amp;ver=07053e9e82227a5c19c6d2ad36944788</em>. This is what is loading the Stylesheet for WordPress dashboard</p>
<h2>Just How Much You Can Change?</h2>
<p>This is a screenshot of how I styled the<a href="http://new2wp.com/wp-login.php"> New2WP.com</a> dashboard. You can see it looks a lot like the frontend of the site.</p>
<p><a href="http://new2wp.com/noob/want-towordpress-dashboard-themes/attachment/customdash/" rel="attachment wp-att-856"><img src="http://new2wp.com/wp-content/uploads/2010/05/customdash.png" alt="custom dashboard style" title="customdash" width="500" height="421" class="aligncenter size-full wp-image-856" /></a></p>
<h2>Some Things Your Should Know</h2>
<p>Before getting started I want to point out that this is only just a guide which you should use as a reference. If you do not know CSS very well, this may not be the best thing for you to try out at this point. If you do something that makes your dashboard screwed up, it is easy to fix, however. You would just need to remove the style attributes which you applied that screwed it up (like if something became hidden, or whatever).</p>
<p>One thing that I did learn from doing this is that there are many thing that will be unreadable if you choose to use a dark background color for the body of the dashboard. Doing that will mean you'll probably have to find out how to style each individual plugin options page, or several other things. </p>
<p>The Stylesheet for the dashboard is quite extensive, and there are many different parts which you may have not been aware of which are styled with CSS. If you think about just how many plugins there are for WordPress, then consider how many people create them, who all write code in a different way, it's easy to understand how quickly it can become a complicated situation. Many people create dashboard pages, or option pages based on the default style of the dashboard. That means you'd have to override all of their style attributes as well. So just take that into mind when doing this.</p>
<h2>A List Of CSS Attributes For The WordPress Dashboard</h2>
<p>This is not a complete list of ALL the attributes in the Stylesheet, just what I've come to learn about using Firebug's selection feature. It is how I was able to find specific elements of pages which I wanted or needed to style. Some were needed because of another change I wanted to make. The dark background color of the <span id="fixed">#wprap</span> caused me to need to change several other things, and more than I had the time to do. So I changed the background back to the color <span id="fixed">#CDCDCD</span> which is just a light gray. I suggest you don't use a dark background, you'd be better off trust me.</p>
<ul>
<li><span id="fixed">a, a:hover</span> - This is for all links in the dashboard</li>
<li><span id="fixed">#wpbody</span> - The body of the dashboard</li>
<li><span id="fixed">#wpwrap</span> - The wrapper which holds both the navigation and main page content</li>
<li><span id="fixed">#wpwrap div</span> - Any <span id="fixed">div</span> element within the wrapper</li>
<li><span id="fixed">#header-logo</span> - For changing or styling the logo in the header</li>
<li><span id="fixed">#wphead</span> - The section along the top of the dashboard</li>
<li><span id="fixed">h1#site-heading a</span> - The title heading text that's displayed in the header next to the logo</li>
<li><span id="fixed">.wrap h2</span> - All H2 headings in the main content of the wrapper. They have a text-shadow</li>
<li><span id="fixed">#wphead-info #user_info</span> - Right side of header, top right of the dashboard</li>
<li><span id="fixed">#adminmenu, .folded #adminmenu </span> - The left nav menu, and folded</li>
<li><span id="fixed">#adminmenu a.menutop</span> - Top menu item links</li>
<li><span id="fixed">#adminmenu li.wp-has-current-submenu ul li a</span> - Menu items that have submenu</li>
<li><span id="fixed">#adminmenu .wp-submenu li.current</span> - Current page menu item</li>
<li><span id="fixed">#adminmenu .wp-submenu li.current a</span> - Current page menu link</li>
<li><span id="fixed">.inner-sidebar, .has-right-sidebar .inner-sidebar</span> - Sidebar on right side of pages</li>
<li><span id="fixed">#message</span> - The message box which displays when you make an update or change</li>
<li><span id="fixed">.highlight,.highlight a</span> - </li>
<li><span id="fixed">#footer</span> - Entire footer section</li>
<li><span id="fixed">#footer-left a</span> - Left side of footer text</li>
<li><span id="fixed">table</span> - Any <span id="fixed">table</span> element within the wrapper</li>
<li><span id="fixed">table a, table a.span</span> - Links within tables and links in table spans</li>
</ul>
<h3>For those that just skipped down to here</h3>
<p>You really should do you're research before you go and add this to you're site. I've talked about some important things above, and you would be better know some of what I mentioned if you plan to completely change your WordPress dashboard.</p>
<h2>Applying Your Stylesheet To The WordPress Dashboard</h2>
<p>The easiest way I found was to use Firebug to select the elements, and then edit or add styles to see how it will look. Then I'd add what I've changed, and what selector I made the change to, to the Stylesheet I created in a function that adds the styles to the head of the dashboard. So you will need to create a Stylesheet for your function. Here's the one I created so you can see what it looks like.</p>
<p>Note: Some of these things may not work if you're using WordPress 3.0. For earlier versions however, you should be able to use these for you're WordPress dashboard.</p>
<pre class="brush: php; title: ; notranslate">
add_action('admin_head', 'custom_colors');
function custom_colors() {
   echo '&lt;style type=&quot;text/css&quot;&gt;
		a{color:#fff;text-shadow:none;}
		#wpbody{color:#dee5ed;}
		#wpwrap{color:#5a6173;}
		#wpwrap div{color:#000;}
		#header-logo{background-image:url('.get_bloginfo('template_directory').'/images/YOUR_LOGO.png)!important; height:76px; width:272px; margin-top:0px;}
		#wphead{background:#5a6173 url('.get_bloginfo('template_directory').'/images/REPEATING_BACKGROUND_IMAGE.png)repeat-x!important; height:83px;}
		h1#site-heading a{font-family:Palintino Linotype;color:#7BCC02; display:none;}
		#templateside span{color:#fff;}
		#templateside a{color:#b7d918;}
		#adminmenu a.menutop{color:#999;text-shadow:0 1px 0 #FFF;}
		#adminmenu .wp-submenu a{color:#b7d918;background:#182431!important;}
		#adminmenu li.wp-has-current-submenu ul li a{background:#000!important;}
		#adminmenu .wp-submenu li.current, #adminmenu .wp-submenu li.current a{color:#cdcdcd; background:#61730D top left no-repeat;text-shadow:0px 1px 2px #182431!important; font-family:&quot;Palintino Linotype&quot;; font-size:14px;}
		#message{background:#182431;color:#b7d918!important;}
		#excerpt,.attachmentlinks{height:10em;}
		#footer,#footer-upgrade{background:#182431;color:#cdcdcd;}
		#footer #footer-left a{color:#b7d918;}
		.wrap h2{color:#fff;text-shadow:0px 1px 0px #000;}
		.highlight,.highlight a{padding:2px 4px;border-left:3px solid #E6DB55;background:#182431;color:#b7d918!important;}
		.inside a{color:#21759B;}
		.postbox{color:#000!important;}
		table{color:#333;}
		table a, table a.span{color:#21759B;text-shadow:0px 1px 0px #fff;}
&lt;/style&gt;';
}
</pre>
<p>There are a couple images which have <span id="fixed">.get_bloginfo('template_directory').'</span> preceeding them. This is getting the image from your theme images directory. The images I used here are to replace the logo and to make a repeating background for the header.</p>
<p>You just need to make a function like that, and add it to your <strong>functions.php</strong> file, or another file for custom scripts file that is included in functions.php.</p>
<h2>Another Way</h2>
<p>You could make your life easier and just make a Stylesheet file, that you enqueue in your function. This is how you would do the same thing as above.</p>
<pre class="brush: php; title: ; notranslate">
function custom_colors() {
	wp_enqueue_style( TEMPLATEPATH . '/css_path/to/stylesheet.css' );
}
</pre>
<pre class="brush: php; title: ; notranslate">
a{color:#fff;text-shadow:none;}
#wpbody{color:#dee5ed;}
#wpwrap{color:#5a6173;}
#wpwrap div{color:#000;}
#header-logo{background-image:url('.get_bloginfo('template_directory').'/images/YOUR_LOGO.png)!important; height:76px; width:272px; margin-top:0px;}
#wphead{background:#5a6173 url('.get_bloginfo('template_directory').'/images/REPEATING_BACKGROUND_IMAGE.png)repeat-x!important; height:83px;}
h1#site-heading a{font-family:Palintino Linotype;color:#7BCC02; display:none;}
#templateside span{color:#fff;}
#templateside a{color:#b7d918;}
#adminmenu a.menutop{color:#999;text-shadow:0 1px 0 #FFF;}
#adminmenu .wp-submenu a{color:#b7d918;background:#182431!important;}
#adminmenu li.wp-has-current-submenu ul li a{background:#000!important;}
#adminmenu .wp-submenu li.current, #adminmenu .wp-submenu li.current a{color:#cdcdcd; background:#61730D top left no-repeat;text-shadow:0px 1px 2px #182431!important; font-family:&quot;Palintino Linotype&quot;; font-size:14px;}
#message{background:#182431;color:#b7d918!important;}
#excerpt,.attachmentlinks{height:10em;}
#footer,#footer-upgrade{background:#182431;color:#cdcdcd;}
#footer #footer-left a{color:#b7d918;}
.wrap h2{color:#fff;text-shadow:0px 1px 0px #000;}
.highlight,.highlight a{padding:2px 4px;border-left:3px solid #E6DB55;background:#182431;color:#b7d918!important;}
.inside a{color:#21759B;}
.postbox{color:#000!important;}
table{color:#333;}
table a, table a.span{color:#21759B;text-shadow:0px 1px 0px #fff;}
</pre>
<p>This should be enough to get you started. Remember that Firebug is a great way to learn what changes what so any other things you try to change would be best tested using that.</p>
<h2>Any Questions?</h2>
<p>Just let me know below in the comments.</p>
<blockquote><p>
<small><strong>NOTICE:</strong><br /> <br />
If you chose to use this guide as an aid in customizing your WordPress dashboard, it is essential to keep in mind that this is in no way a fool-proof or exhaustive tutorial for dashboard customizations.  This is NOT an official WordPress tutorial or styling guide.  Before using this guide to customize your WordPress dashboard, therefore, know that any unwanted or unexpected errors/issues on a site that may result from following all or part of this guide are the sole responsibility of the individual who made the changes to that site.</small>
</p></blockquote>
<div id="crp_related"><h3>Related Posts</h3><ul class="relatedposts"><li><a href="http://new2wp.com/rookie/change-the-color-wordpress-dashboard-and-replace-logo-with-yours/" rel="bookmark" class="crp_title">How To Change The Color Of The WordPress Dashboard And Replace Logo With Yours</a></li><li><a href="http://new2wp.com/rookie/customize-the-wordpress-dashboard-header-even-more/" rel="bookmark" class="crp_title">Customize the WordPress Dashboard Header Even More</a></li><li><a href="http://new2wp.com/noob/how-to-make-css3-buttons/" rel="bookmark" class="crp_title">How To Make Two Tone CSS 3 Inset Buttons</a></li><li><a href="http://new2wp.com/rookie/just-html5-making-a-basic-page-the-right-way/" rel="bookmark" class="crp_title">Just HTML5 &#8211; Making A Basic Page The Right Way</a></li><li><a href="http://new2wp.com/rookie/how-to-create-a-jquery-style-switcher-quick-and-easy/" rel="bookmark" class="crp_title">How To Create A jQuery Style Switcher Quick And Easy</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://new2wp.com/pro/wordpress-dashboard-themes/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Important Update: Register Taxonomies And Post Types With Labels</title>
		<link>http://new2wp.com/pro/wp3-register-labels-update/</link>
		<comments>http://new2wp.com/pro/wp3-register-labels-update/#comments</comments>
		<pubDate>Tue, 25 May 2010 17:57:46 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Pro]]></category>
		<category><![CDATA[Functions]]></category>
		<category><![CDATA[Post types]]></category>
		<category><![CDATA[Taxonomies]]></category>
		<category><![CDATA[wp3.0]]></category>

		<guid isPermaLink="false">http://new2wp.com/?p=1007</guid>
		<description><![CDATA[There's been a somewhat "big" update, or change, made to the <span id="fixed">register_taxonomy()</span> and <span id="fixed">register_post_type()</span> functions in Wordpress. 

You will now be able to customize the capabilities of custom types you create, even MORE!! Note: This is a new update, which may be subject to change in the near future since it is more than a minor typical alteration.]]></description>
			<content:encoded><![CDATA[<h2>What's the news</h2>
<p>There was an <a href="http://wpdevel.wordpress.com/2010/05/13/earlier-this-week-nikolay-committed-a-c/">important change</a> <a href="http://core.trac.wordpress.org/ticket/12968">(see #12968)</a> made recently that has been committed to SVN. This new update has to do with the way you create new custom taxonomies and post types. Also see ticket <a href="http://core.trac.wordpress.org/ticket/13357">#13357</a> as well for more info.</p>
<p>This update allows a post type or taxonomy to register a series of custom labels, using the <span id="fixed">labels</span> array. This was made to be backwards compatible, so you the singular_label still exists, it is just ignored if not used, and used if it is used. The <span id="fixed">label</span> and <span id="fixed">singular_label</span> properties were left alone so they technically still exist as they always have.</p>
<p>Using the new <span id="id">labels</span>, or <span id="id">$labels</span> array argument there are several labels you can create for a particular post type or taxonomy. You would set a <span id="fixed">$labels</span> variable to equal the array of label options you wish to use, if any, and then use that variable as the value for the key <span id="fixed">"labels"</span> in the array which you set up when registering a new taxonomy or post type.</p>
<h3>For Example: How You Would Use Labels</h3>
<p>Here's what I mean, it's really quite simple to do, and it's organized nicely so you don't get all confused by the 3D array insanity that was possible.</p>
<p>So first you need to create the variable and array of desired labels.</p>
<pre class="brush: php; title: ; notranslate">

  // Add new taxonomy, make it hierarchical (like categories)
  $labels = array(
    'name' =&gt; _x( 'Genres', 'taxonomy general name' ),
    'singular_name' =&gt; _x( 'Genre', 'taxonomy singular name' ),
    'search_items' =&gt;  __( 'Search Genres' ),
    'popular_items' =&gt; __( 'Popular Genres' ),
    'all_items' =&gt; __( 'All Genres' ),
    'parent_item' =&gt; __( 'Parent Genre' ),
    'parent_item_colon' =&gt; __( 'Parent Genre:' ),
    'edit_item' =&gt; __( 'Edit Genre' ),
    'update_item' =&gt; __( 'Update Genre' ),
    'add_new_item' =&gt; __( 'Add New Genre' ),
    'new_item_name' =&gt; __( 'New Genre Name' ),
  ); 	
</pre>
<p>Then thisis how you'd register taxonomies, or post types to use the above <span id="fixed">$labels</span> variable.</p>
<pre class="brush: php; title: ; notranslate">

  register_taxonomy('genre',array('book'), array(
    'hierarchical' =&gt; true,
    'labels' =&gt; $labels, // SEE this is the $labels array from above
    'show_ui' =&gt; true,
    'query_var' =&gt; true,
    'rewrite' =&gt; array( 'slug' =&gt; 'genre' ),
  ));
</pre>
<p>This is really nothing too complicated I hope if you already have a familiarity with register taxonomies or post types. (I just lost my train of thought cause I just slammed my knee into the desk, OW!) Okay, so if you are unclear about the above example, refer to the <a href="http://codex.wordpress.org/Function_Reference">WordPress Codex - Function Reference</a> for the functions <span id="fixed">register_post_type()</span> and <span id="fixed">register_taxonomy()</span> to learn more.</p>
<h2>Possible Labels Explained In English</h2>
<p>This update basically removes the need to use <span id="fixed">edit_cap</span>, <span id="fixed">edit_type_cap</span>, <span id="fixed">delete_cap</span>, etc. They are are all gone (though still there for backwards compatibility). The function <span id="fixed">capability_type</span> (i.e. "post", "page", "mycustomtyp" etc.), property is now what does the managing of Capabilities, and after which then builds the corresponding capabilities. </p>
<p>Below is a quick view of the optional labels which can be used in the array as it has been documented for both <a href="http://codex.wordpress.org/Function_Reference/register_taxonomy#Parameters">taxonomies</a> and <a href="http://codex.wordpress.org/Function_Reference/register_post_type#Parameters">post types</a> alike.</p>
<pre class="brush: php; title: ; notranslate">

/*
 * labels
 *		(array) (optional) labels - An array of labels for this taxonomy. By default tag labels are used for non-hierarchical types and category labels for hierarchical ones.

 		* Default: if empty, name is set to label value, and singular_name is set to name value 

		* 'name' - general name for the taxonomy, usually plural. The same as and overridden by $tax-&gt;label. Default is _x( 'Post Tags', 'taxonomy general name' ) or _x( 'Categories', 'taxonomy general name' ). When internationalizing this string, please use a gettext context matching your post type. Example: _x('Writers', 'taxonomy general name');

		* 'singular_name' - name for one object of this taxonomy. Default is _x( 'Post Tag', 'taxonomy singular name' ) or _x( 'Category', 'taxonomy singular name' ). When internationalizing this string, please use a gettext context matching your post type. Example: _x('Writer', 'taxonomy singular name');

		* 'search_items' - the search items text. Default is __( 'Search Tags' ) or __( 'Search Categories' )

		* 'popular_items' - the popular items text. Default is __( 'Popular Tags' ) or __( 'Popular Category' )

		* 'all_items' - the all items text. Default is __( 'All Tags' ) or __( 'All Categories' )

		* 'parent_item' - the parent item text. This string is not used on non-hierarchical taxonomies such as post tags. Default is null or __( 'Parent Category' )

		* 'parent_item_colon' - The same as parent_item, but with colon : in the end null, __( 'Parent Category:' )

		* 'edit_item' - the edit item text. Default is __( 'Edit Tag' ) or __( 'Edit Category' )

		* 'update_item' - the update item text. Default is __( 'Update Tag' ) or __( 'Update Category' )

		* 'add_new_item' - the add new item text. Default is __( 'Add New Tag' ) or __( 'Add New Category' )

		* 'new_item_name' - the new item name text. Default is __( 'New Tag Name' ) or __( 'New Category Name' )
 *
 */
</pre>
<h2>Get more information</h2>
<p>If you want to get some more info on this new update, you could check out <a href="http://wpdevel.wordpress.com/2010/05/13/earlier-this-week-nikolay-committed-a-c/">the thread ON WPdevel</a> where Andrew Nacin provides bit more in-depth explanation about it. It definitely seems like a great update which expands the customizability, and overall capabilities you can have with the awesomely implemented new post type feature.</p>
<p>Have you worked with custom post types or custom taxonomies yet with WordPress 3.0 alpha or beta?? I would like to know what you like or dislike about the new feature so leave a comment below and let me know. </p>
<blockquote><h4>Just an FYI:</h4>
<p>The new date for the WordPress 3.0 release is now set for "<a href="http://wpdevel.wordpress.com/version-3-0-project-schedule/">June 2010, early to mid-month, hopefully</a>". So keep an eye out for it, (or the next beta release lol). I know I am excited for the released, and have really enjoyed just playing with the beta versions. So the official release will be great I'm sure.</p></blockquote>
<div id="crp_related"><h3>Related Posts</h3><ul class="relatedposts"><li><a href="http://new2wp.com/pro/wordpress-custom-post-types-and-taxonomies-done-right/" rel="bookmark" class="crp_title">WordPress Custom Post Types And Taxonomies The Right Way</a></li><li><a href="http://new2wp.com/pro/wordpress-custom-post-types-object-oriented-series1/" rel="bookmark" class="crp_title">OOPost Types: Classes Part 1 – Object Oriented WordPress 3.0 App</a></li><li><a href="http://new2wp.com/noob/wordpress-search-custom-post-types/" rel="bookmark" class="crp_title">New2Tip: How To Include Custom Post Types In WordPress Search</a></li><li><a href="http://new2wp.com/noob/show-multiple-custom-post-type-posts-query-sidebar/" rel="bookmark" class="crp_title">Showing Posts From Multiple Custom Post Types In The Loop</a></li><li><a href="http://new2wp.com/rookie/codes-snippets-for-wordpress-3-0-new-features/" rel="bookmark" class="crp_title">15 Snippets To Prepare Your Theme For WordPress 3.0</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://new2wp.com/pro/wp3-register-labels-update/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Create jQuery Tabs For WordPress Login-Register-Password Reset Forms</title>
		<link>http://new2wp.com/pro/jquery-tabbed-login-register-forms/</link>
		<comments>http://new2wp.com/pro/jquery-tabbed-login-register-forms/#comments</comments>
		<pubDate>Sat, 22 May 2010 13:10:54 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Demos]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Pro]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Login]]></category>
		<category><![CDATA[Members]]></category>
		<category><![CDATA[Tabs]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://new2wp.com/?p=929</guid>
		<description><![CDATA[You want to learn how to make a custom login and register form for your Wordpress site right? Maybe you want to utilize the password reset form while your at it. Perhaps, you may want to set up all 3 of these forms in a way that isn't confusing to people, or in a way that takes up much space on the page. Well, this tutorial will show you how to do all of this quickly and easily. It's simple.]]></description>
			<content:encoded><![CDATA[<h2>This is the Ultimate Custom Login/Register Form Tutorial</h2>
<p>Let's do away with the plain old, not very cool, default WordPress login/register form page for once, what do you say? I'm going to show you how to change the way you login to your site, and the way others join and login to your site too.</p>
<p>Okay, so you may be thinking what's so great about this tutorial compared to all the other one's posted on the internet. I've seen this a million times, and the all end the same, blah blah blah. </p>
<p>I can pretty much guarantee that there is nothing quite like this posted online, at least not available for free. You may be able to find a similar tut on the Tuts+ network, if you have a premium membership, which is great and all, but how many people actually do. Trust me, this is not like any other tutorial you may have "seen" before. There isn't anything as complete, or useful, or just plain awesome. I know because I have scoured the internet in search of how to create this when I was trying to first make it myself. It's just not out there, until now!</p>
<h2>What you will learn from this tutorial</h2>
<p><strong>How to:</strong></p>
<p><img src="http://new2wp.com/wp-content/uploads/2010/02/wordpress_login.png" alt="Wordpress login logo" title="Wordpress login logo" width="200" height="200" class="alignright size-full wp-image-432" /></p>
<ul>
<li>create a sidebar jQuery UI Tabs widget</li>
<li>create a custom form to show under each tab
<ul>
<li>a WordPress 3.0 Login form</li>
<li>a custom register form</li>
<li>a custom password reset form</li>
</ul>
</li>
<li>check if the visitor is logged in</li>
<li>change the content of the tabs if user is logged in</li>
<li>finally love yourself for knowing how to do this.</li>
</ul>
<h2>What you will need:</h2>
<p>You will need to have some understanding of <a href="http://www.w3schools.com/html5/html5_reference.asp">HTML5</a>, <a href="http://www.w3schools.com/css/default.asp">CSS</a> and <a href="http://jquery.com">jQuery</a> or <a href="http://jqueryui.com">jQueryUI</a>, though it's not required, but <a href="#add" target="_blank"><img src="http://new2wp.com/wp-content/uploads/2010/05/crazy-google-interview-questions1.jpg" alt="Google" title="Google" width="154" height="250" class="alignleft size-full wp-image-952" /></a> it does help. You will also need to either have a self-hosted copy of <a href="http://jquery.com">jQuery</a> and/or <a href="http://jqueryui.com">jQuery UI</a> on your website, if you choose to not use the <a href="http://code.google.com/apis/ajaxlibs/" target="_blank">Google CDN</a> version of these, which I will be using here. If you don't know why I am using the Google hosted copies, then you need to read up on the great advantages of linking to a CDN hosted script. </p>
<p>Basically, CDN hosted files are faster and stuff etc. etc. It's cached on most anyone's computer who has access the internet sometime since the dawn of the modern world and the invention of the internet. Since 90% of sites out there link to a CDN copy of jQuery already, it's a pretty good chance most visitors to your site have the scripts saved already in the cache. Anyways, let's get going shall we.</p>
<h2>1: The HTML5 Tabs Markup</h2>
<p>I'm going to start off slow and show you how I would write the HTML for the jQuery tabs, using the new HTML5 format. You will notice that instead of the <span id="fixed">&lt;div&gt;</span> tag which you may be used to, I am using the new <span id="fixed">&lt;nav&gt;</span> which is a more <a href="http://kateray.net/film/">semantic</a> way of referring to a part of your site that is considered a form of navigation.</p>
<p>What I have below is how you would write it if you wanted to have some unordered lists within your tabs for example. We will be removing these lists later when we create the forms that will go in place of them. But you should keep a copy of this just as a sample of code, in the case that even later in this tutorial, you may want to show list items, for when the user is logged in and there is no need to show the login/register forms.</p>
<p><strong>The HTML5 Tab Markup</strong></p>
<pre class="brush: php; title: ; notranslate">

&lt;div id=&quot;tabs&quot;&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;a href=&quot;#tabs-1&quot;&gt;First Tab&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;#tabs-2&quot;&gt;Second Tab&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;#tabs-3&quot;&gt;Third Tab&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;

	&lt;nav id=&quot;tabs-1&quot;&gt;
		&lt;ul&gt;
			&lt;li&gt;This is the first tab&lt;/li&gt;
			&lt;li&gt;This is the first tab&lt;/li&gt;
			&lt;li&gt;This is the first tab&lt;/li&gt;
			&lt;li&gt;This is the first tab&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/nav&gt;
	&lt;nav id=&quot;tabs-2&quot;&gt;
		&lt;ul&gt;
			&lt;li&gt;Second tab this is&lt;/li&gt;
			&lt;li&gt;Second tab this is&lt;/li&gt;
			&lt;li&gt;Second tab this is&lt;/li&gt;
			&lt;li&gt;Second tab this is&lt;/li&gt;
			&lt;li&gt;Second tab this is&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/nav&gt;
	&lt;nav id=&quot;tabs-3&quot;&gt;
		&lt;ul&gt;
			&lt;li&gt;Tab three here buddy!&lt;/li&gt;
			&lt;li&gt;Tab three here buddy!&lt;/li&gt;
			&lt;li&gt;Tab three here buddy!&lt;/li&gt;
			&lt;li&gt;Tab three here buddy!&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/nav&gt;
&lt;/div&gt;&lt;!-- // Tabs --&gt;
</pre>
<p>You may have noticed that the first unordered list was not preceded by a <span id="fixed">&lt;nav&gt;</span> element, and this is because this just happens to be how I wrote it here. You could choose to do that if you want, I just kept the tabs and the actual list items separate, so I know that the tabs aren't a navigable list of items, which link to other pages, just other lists. </p>
<p>They are a sort of navigation, just not what I would consider a navigation menu, personally. Also, you might have noticed that the first unordered list elements link to the <span id="fixed">#tabs-<em>tabnumber</em></span>. This is so that, 1. the tabs will match and show the correct tab to which you click on to see the content of, and 2. so that if the user has JavaScript disabled they will still be able to access the content of the tabs because of these anchors. They won't have the cool switcheroo like you would with JavaScript, but you can still see what's there and use it at least. Good practice for keeping your site <a href="http://new2wp.com/pro/part-3-making-a-dynamic-wordpress-jquery-featured-post-slider-tutorial-finale/">progressively enhanced</a>.</p>
<h2>2: Styling The Tabs With CSS</h2>
<p>The great thing about using jQuery UI to create the tabs is that it does all the styling for you, Woohoo! If you went the route of <a href="http://jqueryui.com/download">downloading jQuery UI</a> which by the way can be customized to your needs, to host the files on your website yourself, then you also got the CSS Stylesheet that came with it in the zip file. That CSS file contains all the styles you need for the tabs to work as you want them to, ... tabs. </p>
<p>You can easily customize the styling as far as color and general appearance goes simply by defining a class which you can apply to the <span id="fixed">&lt;div id="tabs"&gt;</span> or just use the <span id="fixed">#tabs</span> ID attribute as your CSS selector, and apply your styling to it with that. </p>
<p>Although, with jQuery UI, there is the Theme Roller, which you can use any of the already created/<em>rolled</em> themes, or <a href="http://jqueryui.com/themeroller" target="_blank">roll your own theme</a> right on the site. It's really neat, and you should at least try it out. I didn't give it as much credit before as I should have long ago. Then I tried it, and wow... I said, now that's fresh. <a href="http://jqueryui.com/themeroller/?ffDefault=Helvetica,%20Arial,%20sans-serif&#038;fwDefault=normal&#038;fsDefault=1.2em&#038;cornerRadius=2px&#038;bgColorHeader=222222&#038;bgTextureHeader=01_flat.png&#038;bgImgOpacityHeader=50&#038;borderColorHeader=555555&#038;fcHeader=ffffff&#038;iconColorHeader=ffffff&#038;bgColorContent=111111&#038;bgTextureContent=01_flat.png&#038;bgImgOpacityContent=16&#038;borderColorContent=404040&#038;fcContent=eeeeee&#038;iconColorContent=bbbbbb&#038;bgColorDefault=1888f8&#038;bgTextureDefault=03_highlight_soft.png&#038;bgImgOpacityDefault=60&#038;borderColorDefault=111111&#038;fcDefault=d2e8fe&#038;iconColorDefault=000000&#038;bgColorHover=53a5f9&#038;bgTextureHover=06_inset_hard.png&#038;bgImgOpacityHover=60&#038;borderColorHover=111111&#038;fcHover=191919&#038;iconColorHover=000000&#038;bgColorActive=7bcc02&#038;bgTextureActive=05_inset_soft.png&#038;bgImgOpacityActive=50&#038;borderColorActive=111111&#038;fcActive=000000&#038;iconColorActive=000000&#038;bgColorHighlight=f5410f&#038;bgTextureHighlight=01_flat.png&#038;bgImgOpacityHighlight=55&#038;borderColorHighlight=ffcead&#038;fcHighlight=ffffff&#038;iconColorHighlight=f5410f&#038;bgColorError=ffd6d6&#038;bgTextureError=07_diagonals_medium.png&#038;bgImgOpacityError=30&#038;borderColorError=cd0a0a&#038;fcError=cd0a0a&#038;iconColorError=930b0b&#038;bgColorOverlay=191919&#038;bgTextureOverlay=01_flat.png&#038;bgImgOpacityOverlay=50&#038;opacityOverlay=20&#038;bgColorShadow=333333&#038;bgTextureShadow=01_flat.png&#038;bgImgOpacityShadow=0&#038;opacityShadow=100&#038;thicknessShadow=15px&#038;offsetTopShadow=-15px&#038;offsetLeftShadow=-15px&#038;cornerRadiusShadow=100px" target="_blank">Check out the theme I created</a>, which you can use it if you want.</p>
<p>Now, if you chose to use a CDN hosted copy of jQuery UI not to worry, you can easily en-queue the script that WordPress comes pre-packaged with out of the box. Whichever way you decided to use, here's how you can link to the CSS Stylesheet file you need for styling up your tabs.</p>
<h3>En-queue the Stylesheet in functions.php file:</h3>
<p>You need to link or en-queue the jQuery UI Styleseet, depending on whether you're using the jQuery UI download pack or the Google CDN copy.<br />
(<small><strong>Note</strong>: If you just upload the jQueryUI.js file from the download, you will need to do the second option here to ensure that the Stylesheet is linked.</small>)</p>
<p><strong>Linking to the Stylesheet directly:</strong></p>
<pre class="brush: php; title: ; notranslate">

/*
 * Link to the CSS source file in your &lt;head&gt; of your site.
 */
function loadStyles() {
	echo '&lt;link href=&quot;'. bloginfo('template_directory') .'/css/jquery-ui-1.8.1.custom.css&quot; /&gt;';
}
add_action('wp_head', 'loadStyles');

/*
 * You can add the javascript file to the footer
 * With this too if you want.
 */
function loadScripts() {
	echo '&lt;script src=&quot;'. bloginfo('template_directory') .'/js/jquery-1.4.2.min.js&quot;&gt;&lt;/script&gt;'; // needed if jQuery isnt loaded
	echo '&lt;script src=&quot;'. bloginfo('template_directory') .'/js/jquery-ui-1.8.1.custom.min.js&quot;&gt;&lt;/script&gt;';
}
add_action('wp_foot', 'loadScripts');
</pre>
<p><strong>Link to the scripts on the Google Content Distribution Network by doing the following instead:</strong></p>
<pre class="brush: php; title: ; notranslate">

/*
 * OR DO THIS if you want to use the Google
 * CDN Hosted scripts
 */
function loadScripts() {
	echo '&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot;&gt;&lt;/script&gt;';
	echo '&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js&quot;&gt;&lt;/script&gt;';
}
add_action('wp_foot', 'loadScripts');
</pre>
<p><strong>En-queue the jQuery UI CSS Stylesheet included in WordPress:</strong></p>
<p>Another way you can choose to load the Stylesheet, jQuery, or jQuery UI is by using the WordPress <a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_style"><span id="fixed">wp_enqueue_style()</span></a> and <a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script"><span id="fixed">wp_enqueue_script()</span></a> functions. </p>
<p>Here you will find a list of <a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script#Default_scripts_included_with_WordPress">all the scripts WordPress comes bundled with</a> by default should you be interested to use them in your site for anything else. You would use the same word for en-queuing the style of a particular script too for most all of them if there is a Stylesheet included for any other one you may want to use.</p>
<pre class="brush: php; title: ; notranslate">

function loadStyles() {
	wp_enqueue_styles( 'jqueryui' );
}
add_action('wp_head', 'loadStyles');

/*
 * Embed the jQuery UI javascript file in your
 * Footer using this if you choose to
 */
function loadScripts() {
	wp_enqueue_script( 'jquery' ); // You only need to add this if you do not already have jQuery embedded
	wp_enqueue_script( 'jqueryui' );
}
add_action('wp_foot', 'loadScripts')
</pre>
<p>Do keep in mind that many WordPress plugins, and even many themes do already load jQuery, most commonly anyways, though I have seen plugins embed other scripts and Stylesheets for them. Before you add the jQuery script (as well as jQueryUI script), I would highly recommend you view the source code of your site to see if you already have these loaded. Just right click on the page when viewing the site, and go to "view page source" in Firefox, or in IE it's just "view source". Check to see whether <strong>jQuery.js</strong> is in the source code either in the <span id="fixed">&lt;head&gt;</span> or near the bottom of the page source code within the <span id="fixed">&lt;footer&gt;</span> of the site. More than likely it already is at least once, if not more. Removing them all and leaving just one is a tutorial for another day though.</p>
<h2>3: Initializing the Tabs For Takeoff</h2>
<p>So now that we have the scripts and the styles and the HTML for the tabs all set up, lets test that they at least work before we start putting content in. To do this though, we need to still add one little bit of code which will initialize the tabs. Think of it like this, we set up all the pieces which make up a go kart (or tabs in this case), now we just need to put the key in and turn it on (random analogy I know, but it works right?).</p>
<p>To turn on our tabs you will need to add this line of code, AFTER the jQuery and jQuery UI scripts are loaded. If you have your own <em>custom.js</em> file for things like this, you could put it in there. If not, the way I would do it for now is to open your footer.php, find <span id="fixed"><?php wp_foot(); ?></span>, and put it below that. This ensures it will run after the scripts we embedded using the above functions are loaded.</p>
<pre class="brush: php; title: ; notranslate">

&lt;script type=&quot;text/javascript&quot;&gt;
$(function() {
	$('#tabs').tabs(); // initialize the tabs
});
&lt;/script&gt;
</pre>
<h2>4: Testing The Tabs To Tickle Them Pink</h2>
<p>Now that you have this set up, try testing it out by dropping the first chunk of HTML5 code I gave you into your sidebar.php file, and see if these babies work! Make sure everything is doing dandy before you move onto the rest, and if there happens to be any issues, now would be the best time to resolve them before things start to get more complex. TRUST ME!!! I learned this the hard way, repeatedly, far more than I would've liked to that's for sure.</p>
<h2>5: Getting Down And Dirty With The Forms</h2>
<p>To start this part off, I'd like to point out that this tutorial assumes that you are currently using <a href="http://new2wp.com/rookie/codes-snippets-for-wordpress-3-0-new-features/">WordPress 3.0</a>. If you are not, then you will need to create your own custom login form. I am going to be using the all-new WordPress 3.0 <span id="fixed">wp_login_form()</span> function, which is a great addition to the new version of WordPress, only thing is they didn't make a function for the other forms. For anyone still using WP 2.9.x or earlier, I will show you a quick way to make a login form at the end of this tutorial. (I'm a softy, what can I say)</p>
<p><strong>First thing we need to do is</strong></p>
<p>Check if the user is already logged in! To do that, we start by writing the following:</p>
<pre class="brush: php; title: ; notranslate">

&lt;?php
/*
 * If user not logged in display forms
*/
if (!is_user_logged_in()) :
?&gt;
</pre>
<p>If the user is already logged in, we can then show them a totally different set of tabs and tabbed content. This is a great way to customize your site even more for your members, and to show them different content since they are a member of your awesomely coolio site of hottness!</p>
<h2>6: Next on the list is the tabs HTML</h2>
<p>Nothing new here from what I showed you in the beginning, except that the list items now say <strong>Login</strong>, <strong>Register</strong>, and <strong>Lost Password</strong>. This is a self-explanatory I think, I would hope so at least.</p>
<pre class="brush: php; title: ; notranslate">

&lt;div id=&quot;tabs&quot;&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;a href=&quot;#tabs-1&quot;&gt;Login&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;#tabs-2&quot;&gt;Register&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;#tabs-3&quot;&gt;Lost Password&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
</pre>
<h2>7: Now for the first tab, the Login Form</h2>
<p>This is the easiest tab of the three. All you have to do is put <span id="fixed">&lt;?php wp_login_form(); ?&gt;</span> in the div for the first tab. Must simpler than the other two as you will see next.</p>
<p><a href="http://new2wp.com/pro/jquery-tabbed-login-register-forms/attachment/login/" rel="attachment wp-att-935"><img src="http://new2wp.com/wp-content/uploads/2010/05/login.png" alt="login" title="login" width="400" height="200" class="aligncenter size-full wp-image-935" /></a></p>
<pre class="brush: php; title: ; notranslate">

	&lt;div id=&quot;tabs-1&quot;&gt;&lt;!-- Login Form --&gt;
		&lt;?php wp_login_form(); ?&gt;
	&lt;/div&gt;
</pre>
<h2>8: Custom Coding The Register Form</h2>
<p>That last part will seem like a breeze compared to this one. Here we create the register form and throw in a couple of PHP functions you may not have seen before, and add the content of the second tab on our list.</p>
<p><a href="http://new2wp.com/pro/jquery-tabbed-login-register-forms/attachment/reg1/" rel="attachment wp-att-934"><img src="http://new2wp.com/wp-content/uploads/2010/05/reg1.png" alt="register" title="register" width="400" height="250" class="aligncenter size-full wp-image-934" /></a></p>
<pre class="brush: php; title: ; notranslate">

	&lt;div id=&quot;tabs-2&quot;&gt;&lt;!-- Register Form --&gt;
		&lt;form method=&quot;post&quot; action=&quot;&lt;?php echo site_url('wp-login.php?action=register', 'login_post') ?&gt;&quot; id=&quot;registerform&quot; name=&quot;registerform&quot;&gt;
			&lt;p&gt;
				&lt;label&gt;Username&lt;br /&gt;
				&lt;input type=&quot;text&quot; tabindex=&quot;10&quot; size=&quot;20&quot; value=&quot;&quot; class=&quot;input&quot; id=&quot;user_login&quot; name=&quot;user_login&quot; /&gt;
				&lt;/label&gt;
			&lt;/p&gt;
			&lt;p&gt;
				&lt;label&gt;E-mail&lt;br /&gt;
				&lt;input type=&quot;text&quot; tabindex=&quot;20&quot; size=&quot;25&quot; value=&quot;&quot; class=&quot;input&quot; id=&quot;user_email&quot; name=&quot;user_email&quot; /&gt;
				&lt;/label&gt;
			&lt;/p&gt;
			&lt;p id=&quot;reg_passmail&quot;&gt;A password will be e-mailed to you.&lt;/p&gt;
			&lt;br class=&quot;clear&quot;&gt;
			&lt;p class=&quot;submit&quot;&gt;
				&lt;?php do_action('login_form', 'register'); ?&gt;
				&lt;input type=&quot;submit&quot; tabindex=&quot;100&quot; value=&quot;Register&quot; class=&quot;button-primary&quot; id=&quot;wp-submit&quot; name=&quot;wp-submit&quot;											 /&gt;
				&lt;input type=&quot;hidden&quot; name=&quot;redirect_to&quot; value=&quot;/&quot; /&gt;
				&lt;input type=&quot;hidden&quot; name=&quot;cookie&quot; value=&quot;1&quot; /&gt;
			&lt;/p&gt;
		&lt;/form&gt;
	&lt;/div&gt;
</pre>
<p>Lets review the above code. Nothing special as far as HTML forms go right? Just a basic HTML form, nothing you can't handle, or haven't seen in your web site making career I hope (if this part is news to you then you may want to check out the W3 for some <a href="http://www.w3schools.com/html/default.asp">beginners HTML tutorials</a>). As for the new stuff the part <span id="fixed">&lt;?php site_url('wp-login.php?action=register', 'login_post'); ?&gt;</span> is making use of the new WordPress 3.0 <a href="http://codex.wordpress.org/Template_Tags/site_url"><span id="fixed">site_url()</span></a> function which is a replacement of the <span id="fixed">get_option('site_url')</span> function in previous versions of WordPress. Here we just add in the URL path of the register form along with scheme of login_post to give the site URL some context. Neither of these arguments are required by default, but in this case, they are. You could just write it like this <span id="fixed">&lt;?php site_url(); ?&gt;/wp-login.php?action=register</span> but that's not as fun is it? </p>
<p>One thing I am not quite sure of though think you may want to leave as is, is whether the form element ID's and name attributes as I have here are required to use these or if you can assign your own names. I just assume keeping the default register form attributes the same, so to keep it from potentially not working (because these work as is I know), and for consistency sake.</p>
<p><a href="http://tweeaks.com/design/attack-of-deliciously-colorful-code-caused-me-to-explode/" rel="bookmark"><img src="http://new2wp.com/wp-content/uploads/2010/05/chicken-little-sky-falling.jpg" alt="chicken" title="chicken-little-sky-falling" width="200" height="246" class="alignright size-medium wp-image-958" /></a>The other strange and unusual part of the register form code is the <span id="fixed">&lt;?php do_action('login_form', 'register'); ?&gt;</span>. This is the meatballs of the entire form. With out this Chicken Little would be quivering in his little chicken.... coup? Because the sky would be falling. </p>
<p>If you want the form to actually do something useful upon being submitted, then it needs to run this function. It tells WordPress that you want to register a new user account, as well as, the sending out of the confirmation email with the crazy randomly auto-generated password you receive when joined a WordPress site. If you have a firm grasp on that we can move on...</p>
<h2>9: Anyone Here Lose A Password?</h2>
<p>This is a form that is many times neglected I think, but just as important to keeping the members of your site which have already registered. I mean, I personally register an account on at LEAST one new site A DAY!! And out of all the sites which I am a registered member of and visit randomly choose to login to on any given day, I have to reset my password on average, TWICE A DAY on 2 different sites, almost without fail. For every site I sign up on each day, I have to reset my password on two other sites which I have forgotten the password for since last visiting it. It's quite annoying, but what the hell can I really do about it at this point?</p>
<p>It's not that unsurprising is it? It seems that every site on the internet now requires you to have an account, and not nearly enough use the <a href="http://www.facebook.com/advertising/?connect">Facebook Connect</a>, <a href="http://www.google.com/friendconnect">Google Friend Connect</a> or some other equivalent API available from various sites. So if you want to keep your members as part of your site, you better damn well make it easy for them to reset their passwords should they forget it amidst the library of passwords we all now must keep cataloged. The less steps they have to take to log back into your site, the more likely they even will at all. </p>
<h2>10: Let's make a password reset form</h2>
<p><a href="http://new2wp.com/pro/jquery-tabbed-login-register-forms/attachment/lostpass/" rel="attachment wp-att-936"><img src="http://new2wp.com/wp-content/uploads/2010/05/lostpass.png" alt="lost password" title="lost password" width="400" height="154" class="aligncenter size-full wp-image-936" /></a></p>
<pre class="brush: php; title: ; notranslate">

	&lt;div id=&quot;tabs-3&quot;&gt;&lt;!-- Lost Password Form --&gt;
		&lt;form method=&quot;post&quot; action=&quot;&lt;?php echo site_url('wp-login.php?action=lostpassword', 'login_post') ?&gt;&quot; id=&quot;lostpasswordform&quot; name=&quot;lostpasswordform&quot;&gt;
			&lt;p&gt;
				&lt;label&gt;Username or E-mail:&lt;br /&gt;
				&lt;input type=&quot;text&quot; tabindex=&quot;10&quot; size=&quot;20&quot; value=&quot;&quot; class=&quot;input&quot; id=&quot;user_login&quot; name=&quot;user_login&quot; /&gt;
				&lt;/label&gt;
			&lt;/p&gt;
			&lt;p class=&quot;submit&quot;&gt;
				&lt;?php do_action('login_form', 'resetpass'); ?&gt;
				&lt;input type=&quot;submit&quot; tabindex=&quot;100&quot; value=&quot;Get New Password&quot; class=&quot;button-primary&quot; id=&quot;wp-submit&quot; name=&quot;wp-submit&quot; /&gt;
				&lt;input type=&quot;hidden&quot; name=&quot;redirect_to&quot; value=&quot;/&quot; /&gt;
				&lt;input type=&quot;hidden&quot; name=&quot;cookie&quot; value=&quot;1&quot; /&gt;
			&lt;/p&gt;
		&lt;/form&gt;
	&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>That wasn't so bad now was it? This isn't all that dis-similar from the register form either. You already know about the <span id="fixed">site_url()</span> function. The only difference here is it's pointing to the URL <em>wp-login.php?action=lostpassword</em> instead of <em>action=register</em>. Also, the <strong>meatballs</strong> as I called it earlier, (the <span id="fixed">do_action()</span> function) is just doing <span id="fixed">&lt;?php do_action('login_form', 'resetpass'); ?&gt;</span>. EUREKA!!!! </p>
<p>That's what I said when I figured this out for this and the register form. It just all of a sudden came to me one day, and I was finally able to make my forms work, and then in-turn, write this amazing tutorial for you. This will send the user a password reset link, which they can click to have a new auto-generated password emailed to them so they can login to their account, and set their password to something a little more memorable.</p>
<h2>11: Finishing Up - Or Are We...?</h2>
<p>We could just end this here and close out the <span id="fixed">if(user is logged in){ or not }</span> statement that started before making the tabs, and that's fine if you've had enough and can't take it any longer. I am not easy on the ears, or eyes. I won't take it personal if you decide to not go any further, just go play with your new tabs and forms. Bye!</p>
<p>For those that want to keep going, lets add a new set of tabs for the users that <em>are</em> logged in so they can have some custom coolioness as a registered, AND logged in member of your site.</p>
<p>Remember that first chunk of HTML5 code I gave you at the beginning, which I told you to save for later? Well it's later. Grab that code, and paste it after this <span id="fixed">else</span> statement:</p>
<p><strong>Do it... or Else...!!</strong></p>
<pre class="brush: php; title: ; notranslate">

&lt;?php
else : // if they are logged in show submit form
?&gt;
</pre>
<p>This says, well tickle me purple, this person is logged in!! In that case, lets show them a cooler set of tabs with some exclusive members only content only the registered and logged in visitors can see!</p>
<h2>12: Only Showing Logged In Members Exclusive Tabs And Content</h2>
<p>Here's what I have done to that chunk of code I told you to grab and paste here after the <span id="fixed">else</span> statement. Did you do that? Or did you fail to follow my directions, again... It's okay, just copy this and use it instead of you want ;)</p>
<pre class="brush: php; title: ; notranslate">

&lt;div id=&quot;tabs&quot;&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;a href=&quot;#m-pages&quot;&gt;Members Only&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;#m-tuts&quot;&gt;Members Tuts&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href=&quot;#m-chat&quot;&gt;Chat&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
	&lt;div id=&quot;m-pages&quot;&gt;
		&lt;ul&gt;
			&lt;li&gt;For The Members&lt;/li&gt;
			&lt;li&gt;My Members Rule&lt;/li&gt;
			&lt;li&gt;Members Must Read&lt;/li&gt;
			&lt;li&gt;I Do re-Members&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/div&gt;
	&lt;div id=&quot;m-tuts&quot;&gt;
		&lt;ul&gt;
			&lt;li&gt;Special Tut (like this one but private)&lt;/li&gt;
			&lt;li&gt;A premium tutorial&lt;/li&gt;
			&lt;li&gt;Something special&lt;/li&gt;
			&lt;li&gt;Make a mustache man? wtf&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/div&gt;
	&lt;div id=&quot;m-chat&quot;&gt;&lt;!-- Post Form --&gt;
		&lt;div id=&quot;doyoulikechats&quot;&gt;
			You could chuck a &lt;a href=&quot;http://chatango.com&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Chatango.com&lt;/a&gt; chat or something
			like that up in here, up in here, up in here.
		&lt;/div&gt;
	&lt;/div&gt;

&lt;/div&gt;
</pre>
<p><a href="http://new2wp.com/pro/jquery-tabbed-login-register-forms/attachment/allow-upload-contributor/" rel="attachment wp-att-953"><img src="http://new2wp.com/wp-content/uploads/2010/05/allow-upload-contributor.jpg" alt="Wordpress members" title="Wordpress members" width="200" height="200" class="alignleft size-full wp-image-953" /></a>Now maybe you want to have a list of privately published pages which you set up so only visitors that are logged in can access them. If not, here is another way to <a href="http://new2wp.com/noob/wordpress-members-only-pages/">create WordPress members only pages</a>, which you could set up, and list in the space for the first tab. Create some privately posted, members only tutorials on how to do some crazy super cool and insane shit. Yeah kinda like this tutorial, actually, exactly like this tutorial, only privately viewable to registered users. </p>
<p>Unlike this tutorial, but just as good. :P Last, maybe you want to have a chat for chitting away with your chatter-tat-tatters and sons. Or someone else that is registered on your site and likes talking to you. The possibilities to what these new members only tabs can hold is endless. All that we have left to do though, is END THIS!!!</p>
<h2>13: Let's End This Schnitzel</h2>
<p>So we need to put an <span id="fixed">endif;</span> we plan to ever end this. Ha! Did ya get it?!?! Clever bastard, I am, eh? Okay...</p>
<pre class="brush: php; title: ; notranslate">

&lt;?php
endif;
?&gt;
</pre>
<h2>That's All Folks</h2>
<p>Hope you liked this super custy amazed ation, makes me crave some more sensational stuff... </p>
<h2>How About A Bonus</h2>
<p>As promised, </p>
<h3>For Those, Less Up-to-Date WordPress Nuts</h3>
<p>Making a custom coded login form, is simple. You may already know how to do it just in making the register and password reset forms, but if not here we go.</p>
<p><a href="http://new2wp.com/pro/jquery-tabbed-login-register-forms/attachment/lostpass/" rel="attachment wp-att-936"><img src="http://new2wp.com/wp-content/uploads/2010/05/login.png" alt="login" title="login" width="400" height="154" class="aligncenter size-full wp-image-936" /></a></p>
<pre class="brush: php; title: ; notranslate">

&lt;form name=&quot;loginform&quot; id=&quot;loginform&quot; action=&quot;&lt;?php echo site_url('wp-login.php', 'login_post') ?&gt;&quot; method=&quot;post&quot;&gt;
	&lt;p&gt;
		&lt;label&gt;Username&lt;br&gt;
		&lt;input name=&quot;log&quot; id=&quot;user_login&quot; class=&quot;input&quot; value=&quot;&quot; size=&quot;20&quot; tabindex=&quot;10&quot; type=&quot;text&quot;&gt;&lt;/label&gt;
	&lt;/p&gt;
	&lt;p&gt;
		&lt;label&gt;Password&lt;br&gt;

		&lt;input name=&quot;pwd&quot; id=&quot;user_pass&quot; class=&quot;input&quot; value=&quot;&quot; size=&quot;20&quot; tabindex=&quot;20&quot; type=&quot;password&quot;&gt;&lt;/label&gt;
	&lt;/p&gt;
	&lt;p class=&quot;forgetmenot&quot;&gt;&lt;label&gt;&lt;input name=&quot;rememberme&quot; id=&quot;rememberme&quot; value=&quot;forever&quot; tabindex=&quot;90&quot; type=&quot;checkbox&quot;&gt; Remember Me&lt;/label&gt;&lt;/p&gt;
	&lt;p class=&quot;submit&quot;&gt;
		&lt;?php do_action('login_form', 'login'); ?&gt;
		&lt;input name=&quot;wp-submit&quot; id=&quot;wp-submit&quot; class=&quot;button-primary&quot; value=&quot;Log In&quot; tabindex=&quot;100&quot; type=&quot;submit&quot;&gt;
		&lt;input name=&quot;redirect_to&quot; value=&quot;&lt;?php bloginfo('template_directory').'/page-your_members_home_page.php'); ?&gt;&quot; type=&quot;hidden&quot;&gt;
		&lt;input name=&quot;testcookie&quot; value=&quot;1&quot; type=&quot;hidden&quot;&gt;
	&lt;/p&gt;

&lt;/form&gt;
</pre>
<h2>Finally That's it!!</h2>
<p>We made it through this long and drawn-out tutorial. You know, this is all readily open and available for you to view anytime you want had you just taken a second to think about it, you might have already thought about it and known. Then you wouldn't have needed to come follow my shenanigans here and you could've created this on your own. Just go check out the <a href="http://core.trac.wordpress.org/browser/trunk/wp-login.php">wp-login.php file</a>, and see for yourself. It has all the greatness I have gone through here, aside from the mustache reference Oh, and the tabs of course. </p>
<p>For those who are going to ask me if I have a demo set up, please check out my test site <a href="http://tweakurpages.com" rel="nofollow">here for a working example demonstration</a>. I have created a tabbed dialog box that displays the login/register and password reset forms which I am using on the theme I am currently developing. Click the Login button in the top right corner, and test the login out by using the following information:</p>
<p><strong>Username:</strong> themedemo<br />
<strong>Password:</strong> themedemo</p>
<p><a href="#add"><img src="http://new2wp.com/wp-content/uploads/2010/05/comment.png" alt="" title="comment" class="alignright size-full wp-image-953" /></a><br />
Any questions??? Post a comment, let me know what you're thinking, or what you've thought already. Enjoy!</p>
<div id="crp_related"><h3>Related Posts</h3><ul class="relatedposts"><li><a href="http://new2wp.com/noob/new2tip-allow-visitors-to-search-by-category/" rel="bookmark" class="crp_title">New2Tip: Allow Visitors To Search By Category</a></li><li><a href="http://new2wp.com/noob/how-to-make-a-simple-image-sliding-animation-with-jquery/" rel="bookmark" class="crp_title">How To Make A Simple Image Sliding Animation With jQuery</a></li><li><a href="http://new2wp.com/rookie/create-social-bookmark-buttons/" rel="bookmark" class="crp_title">Create Your Own Social Bookmark Button Links</a></li><li><a href="http://new2wp.com/rookie/sexy-rss-feeds-custom-content/" rel="bookmark" class="crp_title">Making Your RSS Feeds Sexy With Custom Content In WordPress</a></li><li><a href="http://new2wp.com/noob/adding-backwards-compatible-wordpress-menus-to-your-theme/" rel="bookmark" class="crp_title">Adding Backwards Compatible WordPress Menus To Your Theme</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://new2wp.com/pro/jquery-tabbed-login-register-forms/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>

