<?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; Noob</title>
	<atom:link href="http://new2wp.com/levels/noob/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>Create A Simple Metabox For Custom Post Types</title>
		<link>http://new2wp.com/noob/create-metabox-custom-post-types/</link>
		<comments>http://new2wp.com/noob/create-metabox-custom-post-types/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 16:05:09 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Noob]]></category>
		<category><![CDATA[Functions]]></category>
		<category><![CDATA[Meta Box]]></category>
		<category><![CDATA[Post types]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://new2wp.com/?p=2928</guid>
		<description><![CDATA[WordPress 3.0 has made creating custom meta boxes much more fun since you can completely alter the edit pages using them and make your own post pages entirely from metaboxes you've defined. Here's an example of how to create a URL and description metabox.]]></description>
			<content:encoded><![CDATA[<h2>Making a URL and Description Custom Metabox</h2>
<p>Recently this topic was <a href="http://twitter.com/#!/brycejacobson/status/31075647111561218">suggested as a new post idea</a> for me to write about, so here I am writing about it. You can let me know of other ideas or topics you'd like to see a tutorial on here whenever you want, and if I am able to do it and have time I will surely do it.</p>
<p>So say you have a custom post type on your site, and as part of that post type, you want to allow for a way to enter in a URL and maybe a description or text of some sort for something related to the URL. This is not hard to do, it simply requires a couple of functions to do. </p>
<h3>What Functions Are Needed</h3>
<ol>
<li>We will need a function for displaying the metabox form fields, which will be used to save and update the data we enter into it.</li>
<li>Then a function for processing the metabox form elements, in order to perform the actions of saving and updating the information.</li>
<li>A function for adding the custom metabox function to WordPress via the 'init' action hook.</li>
<li>Finally, we need a function to get and return the values of the fields for use within the theme on the frontend.</li>
</ol>
<h2>1. Displaying The Custom Metabox</h2>
<p>First thing we need to do is create the metabox form fields. In doing that, we want to also check if there is any data saved in the post meta for the custom fields we are making, so we can output that into the input fields of the form. </p>
<p>Since we are making a URL input field, we should check to see if the URL entered is a valid URL using a regular expression. For this example I am just using a simple regex which will check to make sure the URL at least has the 'http://' at the beginning. If it does not, I output the message saying it's invalid, and add it to the input field.</p>
<pre class="brush: php; title: ; notranslate">
/**
 * Display the metabox
 */
function url_custom_metabox() {
	global $post;
	$urllink = get_post_meta( $post-&gt;ID, 'urllink', true );
	$urldesc = get_post_meta( $post-&gt;ID, 'urldesc', true );

	if ( !preg_match( &quot;/http(s?):\/\//&quot;, $urllink )) {
		$errors = 'Url not valid';
		$urllink = 'http://';
	} 

	// output invlid url message and add the http:// to the input field
	if( $errors ) { echo $errors; } ?&gt;

	&lt;p&gt;&lt;label for=&quot;siteurl&quot;&gt;Url:&lt;br /&gt;
		&lt;input id=&quot;siteurl&quot; size=&quot;37&quot; name=&quot;siteurl&quot; value=&quot;&lt;?php if( $urllink ) { echo $urllink; } ?&gt;&quot; /&gt;&lt;/label&gt;&lt;/p&gt;
	&lt;p&gt;&lt;label for=&quot;urldesc&quot;&gt;Description:&lt;br /&gt;
		&lt;textarea id=&quot;urldesc&quot; name=&quot;urldesc&quot; cols=&quot;45&quot; rows=&quot;4&quot;&gt;&lt;?php if( $urldesc ) { echo $urldesc; } ?&gt;&lt;/textarea&gt;&lt;/label&gt;&lt;/p&gt;
&lt;?php
}
</pre>
<p>Notice how I am checking if the meta fields have a value and if they do, then echo it out within the input and textarea fields.</p>
<h2>2. Processing the Metabox Form Fields</h2>
<p>Next, we need to process this information when the form is submitted to save as a draft or publish the post. There are a number of ways to do this, but the simplest way to do it is just simply pass the <span id="fixed">$post_id</span> to the function, and make <span id="fixed">$post</span> global. </p>
<p>Then check if the <span id="fixed">$_POST</span> variable is set, meaning has the form been submitted, and if so then <a href="http://codex.wordpress.org/Function_Reference/update_post_meta">update our post meta options</a> using <span id="fixed">update_post_meta()</span>.</p>
<pre class="brush: php; title: ; notranslate">
/**
 * Process the custom metabox fields
 */
function save_custom_url( $post_id ) {
	global $post;	

	if( $_POST ) {
		update_post_meta( $post-&gt;ID, 'urllink', $_POST['siteurl'] );
		update_post_meta( $post-&gt;ID, 'urldesc', $_POST['urldesc'] );
	}
}
</pre>
<p>That is obviously the most basic of ways to do it, but it works for what we want to do.</p>
<h2>3. Adding The Metabox to your Custom Post Type</h2>
<p>In order to make this all work, we of course need to add the functions to WordPress so it knows to do something with it. The hooks are required otherwise your metabox won't show or save when you submit it.</p>
<p>To add the metabox, we create a function which uses the <span id="fixed">add_meta_box()</span> function, and pass it the information necessary for our metabox. You can <a href="http://codex.wordpress.org/Function_Reference/add_meta_box">read more about add_meta_box() here</a>.</p>
<pre class="brush: php; title: ; notranslate">
// Add action hooks. Without these we are lost
add_action( 'admin_init', 'add_custom_metabox' );
add_action( 'save_post', 'save_custom_url' );

/**
 * Add meta box
 */
function add_custom_metabox() {
	add_meta_box( 'custom-metabox', __( 'URL &amp;amp; Description' ), 'url_custom_metabox', 'post', 'normal', 'high' );
}
</pre>
<p>This is adding our metabox function with the callback 'url_custom_metabox'. You can change the post type this will be added to by changing 'post' to whatever your post type you want to use it for.</p>
<h2>4. Getting and Returning the Saved Data For Each Post</h2>
<p>Finally, we need to have a way of displaying the information entered into the metabox fields on the frontend of the site, so we can make use of it right!</p>
<p>To do that, I like to just create a function that <a href="http://codex.wordpress.org/Function_Reference/get_post_meta">gets the post meta</a> for me, and return the variables for each field I want as an array using <span id="fixed">get_post_meta()</span> like this.</p>
<pre class="brush: php; title: ; notranslate">
/**
 * Get and return the values for the URL and description
 */
function get_url_desc_box() {
	global $post;
	$urllink = get_post_meta( $post-&gt;ID, 'urllink', true );
	$urldesc = get_post_meta( $post-&gt;ID, 'urldesc', true );

	return array( $urllink, $urldesc );
}
</pre>
<p>The way you would use this in your theme is within whatever page template file, you create a variable and set it to this function. Then echo out the variable key you want to use. For example:</p>
<pre class="brush: php; title: ; notranslate">
// get the array of data
$urlbox = get_url_desc_box();

echo $urlbox[0]; // echo out the url of a post
echo $urlbox[1]; // echo out the url description of a post
</pre>
<p>The <span id="fixed">$urlbox[0]</span> will display the URL which can be used in the href of an anchor tag.</p>
<h2>Here's The Entire Custom Metabox Code</h2>
<p>You can either paste this into your functions.php file, or create a separate file within your theme directory, and use <span id="fixed">get_template_part( 'FILENAME' );</span> to include it in your functions file.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

// Hook into WordPress
add_action( 'admin_init', 'add_custom_metabox' );
add_action( 'save_post', 'save_custom_url' );

/**
 * Add meta box
 */
function add_custom_metabox() {
	add_meta_box( 'custom-metabox', __( 'URL &amp;amp; Description' ), 'url_custom_metabox', 'product', 'side', 'high' );
}

/**
 * Display the metabox
 */
function url_custom_metabox() {
	global $post;
	$urllink = get_post_meta( $post-&gt;ID, 'urllink', true );
	$urldesc = get_post_meta( $post-&gt;ID, 'urldesc', true );

	if ( !preg_match( &quot;/http(s?):\/\//&quot;, $urllink )) {
		$errors = 'Url not valid';
		$urllink = 'http://';
	} 

	// output invlid url message and add the http:// to the input field
	if( $errors ) { echo $errors; } ?&gt;

	&lt;p&gt;&lt;label for=&quot;siteurl&quot;&gt;Url:&lt;br /&gt;
		&lt;input id=&quot;siteurl&quot; size=&quot;37&quot; name=&quot;siteurl&quot; value=&quot;&lt;?php if( $urllink ) { echo $urllink; } ?&gt;&quot; /&gt;&lt;/label&gt;&lt;/p&gt;
	&lt;p&gt;&lt;label for=&quot;urldesc&quot;&gt;Description:&lt;br /&gt;
		&lt;textarea id=&quot;urldesc&quot; name=&quot;urldesc&quot; cols=&quot;45&quot; rows=&quot;4&quot;&gt;&lt;?php if( $urldesc ) { echo $urldesc; } ?&gt;&lt;/textarea&gt;&lt;/label&gt;&lt;/p&gt;
&lt;?php
}

/**
 * Process the custom metabox fields
 */
function save_custom_url( $post_id ) {
	global $post;	

	if( $_POST ) {
		update_post_meta( $post-&gt;ID, 'urllink', $_POST['siteurl'] );
		update_post_meta( $post-&gt;ID, 'urldesc', $_POST['urldesc'] );
	}
}

/**
 * Get and return the values for the URL and description
 */
function get_url_desc_box() {
	global $post;
	$urllink = get_post_meta( $post-&gt;ID, 'urllink', true );
	$urldesc = get_post_meta( $post-&gt;ID, 'urldesc', true );

	return array( $urllink, $urldesc );
}
?&gt;
</pre>
<p>I've been making some pretty crazy metabox lately, and with WordPress 3.0, I think we're going to see a lot more need for people to be able to create them. My metaboxes are becoming more and more complex and customizable each time I make one. It's really cool, and worth taking the time to learn.</p>
<p>Hope this has helped you learn somethings about doing this. Let me know if you have any questions in the comments.</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/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><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/highlighting-onclick-shortlink-wordpress3/" rel="bookmark" class="crp_title">New2Tip: Adding A Click Highlighting Shortlink Input To Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://new2wp.com/noob/create-metabox-custom-post-types/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>[Guest Post] Stop Self-Editing While You Write And Just Write</title>
		<link>http://new2wp.com/noob/guest-post-write-ouside-box/</link>
		<comments>http://new2wp.com/noob/guest-post-write-ouside-box/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 13:00:36 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Noob]]></category>
		<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Guest Post]]></category>
		<category><![CDATA[Writing]]></category>

		<guid isPermaLink="false">http://new2wp.com/?p=2776</guid>
		<description><![CDATA[Once in a while you need to write about something different and go way beyond the norm from what your used to. Here is a guest post I wrote that does just that.

You won't see very many posts like this from me in the near future so enjoy it while it lasts.]]></description>
			<content:encoded><![CDATA[<h2>Write Outside Your Cozy Little Comfortable Box</h2>
<p>I recently wrote my second guest post on <a href="http://comluv.com/author/jaredwilli/" target="_blank">Comluv</a>, my third guest post ever, and it was a post that was completely different than what I am normally known to post. Here's <a href="http://comluv.com/dev/enable-debugging-and-logging-for-live-site-usage/">my first guest post</a> over there for those who care.</p>
<p>It was about writing, and how to write more and self-edit what you write less. It wasn't about code, or design, or something to do with WordPress, or jQuery. Nope! It was just about writing.</p>
<p><a href="http://www.mojo-themes.com/?r=jaredwilli"><img src="http://new2wp.com/wp-content/uploads/2010/10/mojo-250x125.jpg" alt="Mojo-Themes" class="alignleft" /></a>I started to write this post as a sort of cross-post, aggregation of that post, to get more people to read that one, but it occurred to me that just in writing that post, it gave me the idea to talk about going outside your comfort zone in writing. That's something I definitely did, though I feel I had some strong points which I could make, it was still beyond what I'm comfortable writing about.</p>
<p><strong>Don't get used to it...</strong></p>
<p>I won't be doing that often, at all. But it made me realize that it can be good to sometimes step out of the box, and throw a curveball at yourself if no one else, and see what you're capable of. I'm not a professional writer, but I do feel I can write quite well, and might need white out twice to rewrite advice. I can however make words form letters, while shaking their dirty curves flirting with you all, with visual learning balls which are burning.</p>
<p>I used to write a lot like that, and can continue to now for a long time to come. Once I start writing like that it's very hard for me to break out of it. So forgive me.</p>
<p>So go try writing what you don't normally do. Write outside the box, and see what you can create with the right box. You might surprise yourself, and who knows, you may just find what you've been meant to do all along. Okay maybe not, but...</p>
<p><a href="http://comluv.com/tutorials/stop-self-editing-while-you-write-and-just-write/">Go read my guest post!!!</a></p>
<div id="crp_related"><h3>Related Posts</h3><ul class="relatedposts"><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><li><a href="http://new2wp.com/noob/how-to-use-jquery-to-make-your-content-slide-toggle/" rel="bookmark" class="crp_title">How To Use jQuery To Make Your Content Slide Toggle</a></li><li><a href="http://new2wp.com/news/how-long-making-websites/" rel="bookmark" class="crp_title">[Poll] How Long Have You Been Making Websites</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/rss-subscribe-boxafter-wordpress-posts/" rel="bookmark" class="crp_title">Easily Add A Subscribe To Feed Reminder To The Bottom Of Your Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://new2wp.com/noob/guest-post-write-ouside-box/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New2WP Basic Sidebar Twitter Widget Plugin</title>
		<link>http://new2wp.com/noob/new2wp-sidebar-twitter-widget-plugin/</link>
		<comments>http://new2wp.com/noob/new2wp-sidebar-twitter-widget-plugin/#comments</comments>
		<pubDate>Mon, 08 Nov 2010 14:30:19 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Noob]]></category>
		<category><![CDATA[Downloads]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Sidebar]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Widgets]]></category>

		<guid isPermaLink="false">http://new2wp.com/?p=2765</guid>
		<description><![CDATA[Sometimes you just need a basic widget that isn't all packed with crazy options and included files. This plugin comes packaged as basic as you can get with no bells and whistles or anything useless. Just the bare essentials for doing what you need to do.

Now you can display your latest Twitter updates in your sidebar, and not have a ton of overhead or extra stuff slowing your site down.]]></description>
			<content:encoded><![CDATA[<h2>You Know The Digits, So Push The Widgets</h2>
<p>I just wrote a sidebar widget for showing Twitter updates, for some reason. Don't ask me how I got so distracted with what I was doing a couple hours ago that I managed to begin writing a sidebar widget for displaying your latest tweets but I did.</p>
<p>I just finished the first version of it, and figured I'd do a blog post to release it to anyone interested in using it. It's quite basic, nothing really all that fancy going on here with this widget.</p>
<div align="center"><a href="http://bit.ly/adsnew2wp" target="_blank" title="Advertise on New2WP"><img src="http://tweeaks.com/wp-content/uploads/2010/08/new2wp-468x60px1.png" alt="Advertise on New2WP!!" /><br />Advertise on New2WP</a></div>
<h2>Plugin Features:</h2>
<p>This is a plugin that just adds a custom sidebar widget I made, for displaying your latest Tweets from Twitter. Here's what it has so far:</p>
<ul>
<li>Show Tweets from an account on Twitter you define in the settings</li>
<li>Control the number of Tweets to show in the sidebar</li>
<li>Easily enable/disable the loading of jQuery.js. Chances are you have it already loaded on your site (possibly more than once) so this allows you to decide whether to load it or not.</li>
<li>Fetches the Tweet data using Ajax and JSON (cool stuff)</li>
</ul>
<p>As of right now that's all that it really needs. I have it running over there in the sidebar down at the bottom, so you can get an idea of what it does. </p>
<p>I may eventually add an options page for it, so you can control some more stuff such as the styling, showing people's avatars, and making the links and stuff clickable. For now, this is good enough until I get some feedback on it at least. </p>
<h2>Plugin Installation:</h2>
<ol type="1">
<li>Simply <a href="http://new2wp.com/labs/downloads/n2wp-witter-twidget.zip">download the n2wp-witter-twidget.zip file</a>, and unzip the /n2wp-witter-twidget/ folder to your plugins directory.</li>
<li>Then go to your plugins page in your WP dashboard, and activate it.</li>
<li>Once it's activated, you go to the Widgets page of your dashboard, and add the Witter Twidget to a widgetized sidebar area which you should already have, otherwise you need to create a widgetized sidebar. Once you add it there, you can control the settings of it as you wish.</li>
</ul>
<div class="post-next">
<a href="http://new2wp.com/labs/downloads/n2wp-witter-twidget.zip">Download New2WP Witter Twidget Plugin</a>
</div>
<p>Let me know what you think of it in the comments</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/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/noob/advertise-on-new2wp/" rel="bookmark" class="crp_title">Advertise On New2WP</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/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></ul></div>]]></content:encoded>
			<wfw:commentRss>http://new2wp.com/noob/new2wp-sidebar-twitter-widget-plugin/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>New Textmate and Coda Starter Plugins For WordPress Developers</title>
		<link>http://new2wp.com/noob/textmate-coda-plugins-wordpress-development/</link>
		<comments>http://new2wp.com/noob/textmate-coda-plugins-wordpress-development/#comments</comments>
		<pubDate>Sat, 23 Oct 2010 16:44:57 +0000</pubDate>
		<dc:creator>Antonio</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Noob]]></category>
		<category><![CDATA[Rookie]]></category>
		<category><![CDATA[Downloads]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://new2wp.com/?p=2694</guid>
		<description><![CDATA[I am at WordCamp Las Vegas its opening session and <a href="http://twitter.com/brandondove" target="_blank">Brandon Dove</a> is discussing theme frameworks and child themes. It reminded me of a little project I started a while ago, to speed up my WordPress Development.]]></description>
			<content:encoded><![CDATA[<h2>Announcing Two New Plugins For WP Devs</h2>
<p>I created a plugin for Textmate and Coda to help speed up development for WordPress, and to make my life easier really. It makes adding commonly used WP snippets of code to a document I'm working on extremely easy. Currently this only exists for Textmate and Coda on Mac. Depending on the demand, there may be support for other applications in the future.</p>
<p>The Textmate WP Starter Plugin and The Coda WP Starter Plugin have two modes:</p>
<ul>
<li><strong>WP Quick:</strong> Which is a folder and file skeleton.</li>
<li><strong>WP Full:</strong> Which is a full theme structure markup and base styling.</li>
</ul>
<div align="center">
<h2><a title="Textmate WP_Starter" href="http://new2wp.com/labs/downloads/wp_starter.tmbundle.zip" target="_blank">DOWNLOAD TEXTMATE WP_STARTER</a></h2>
<p><a title="Textmate WP_Starter" href="http://new2wp.com/labs/downloads/wp_starter.tmbundle.zip" target="_blank"><img class="alignnone size-full wp-image-2696" title="Download Textmate Plugin" src="http://new2wp.com/wp-content/uploads/2010/10/TextmateIcon.png" alt="Download Textmate Plugin" width="128" height="128" /></a></p>
<h2><a href="http://new2wp.com/labs/downloads/wp_starter.codaplugin.zip">DOWNLOAD CODA WP_STARTER</a></h2>
<p><a title="Coda WP_Starter" href="http://new2wp.com/labs/downloads/wp_starter.codaplugin.zip" target="_blank"><img class="alignnone size-full wp-image-2695" title="coda" src="http://new2wp.com/wp-content/uploads/2010/10/coda.png" alt="Download Coda Plugin" title="Download Coda Plugin" width="128" height="127" /></a>
</div>
<p><strong>NOTE:</strong> These plugins are still in beta, i am sure there are errors. Let me know ( and BE NICE!) and i will fix them immediatly</p>
<div id="crp_related"><h3>Related Posts</h3><ul class="relatedposts"><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/featured/363-photoshop-color-swatches-download/" rel="bookmark" class="crp_title">363 Vibrant Color Swatches For Photoshop Download Pack</a></li><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/roundups/5-great-wordpress-themes-feb-2010/" rel="bookmark" class="crp_title">5 Great WordPress Themes Of February 2010</a></li><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></ul></div>]]></content:encoded>
			<wfw:commentRss>http://new2wp.com/noob/textmate-coda-plugins-wordpress-development/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Showing Posts From Multiple Custom Post Types In The Loop</title>
		<link>http://new2wp.com/noob/show-multiple-custom-post-type-posts-query-sidebar/</link>
		<comments>http://new2wp.com/noob/show-multiple-custom-post-type-posts-query-sidebar/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 12:00:15 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Noob]]></category>
		<category><![CDATA[Custom Query]]></category>
		<category><![CDATA[Functions]]></category>
		<category><![CDATA[Loops]]></category>
		<category><![CDATA[Post types]]></category>
		<category><![CDATA[wp3.0]]></category>

		<guid isPermaLink="false">http://new2wp.com/?p=2677</guid>
		<description><![CDATA[Are you trying to figure out how to show your custom post types posts as a single post listing? Either for your homepage, or some other custom page? Or are you looking to create just a list of custom post type titles for your sidebar. 

Here's how to do both.]]></description>
			<content:encoded><![CDATA[<h2>How To Mix Your Custom Post Types Together</h2>
<p>So you have a few <a href="http://new2wp.com/pro/wordpress-custom-post-types-and-taxonomies-done-right/">custom post types</a> set up in WordPress, and they work awesomely on the <a href="http://new2wp.com/noob/wordpress-custom-templates-the-easy-and-most-logical-method/">custom page templates</a> you created for them, but you can't get them to all mix together based on the dates they were posted. </p>
<p>Or, you want to create a custom sidebar widget and you have everything done for making a custom widget, except the custom post type posts in one single list.</p>
<p>Or, you <a href="http://new2wp.com/canvas">don't have a clue</a> what I'm talking about.</p>
<p>Then keep reading....</p>
<h2>Creating a Custom Loop with query_posts()</h2>
<p>For displaying all your custom post types in a single page loop, for example, in your index.php file for your homepage, you need to do more than just query the posts.</p>
<p>In order for the pagination links to work for next_posts, previous_posts, or if you're using the wp-pagenavi plugin, you need to first set the <span id="fixed">$paged</span> variable. Otherwise you will get a 404 error.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
// set the $paged variable
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
</pre>
<p>Then create a custom <span id="fixed">query_posts()</span> query to query the post types, making sure to include the <span id="fixed">'paged'</span> argument set to the <span id="fixed">$paged</span> variable. You can use any other <span id="fixed">$args</span> in the query too if you want.</p>
<p>The <span id="fixed">query_posts()</span> must be run before the loop is started. So be sure to put it before the code:</p>
<pre class="brush: php; title: ; notranslate">
// query the posts of your custom post types
query_posts( array(
		'post_type' =&gt; array(
					'post',
					'custom_post_type_1',
					'custom_post_type_two',
					'custom_post_type3'
				),
				'paged' =&gt; $paged ) // for paging links to work
			);

// have some posts?
if (have_posts()) :
	while (have_posts()) : the_post(); // begin the Loop

		// make a little love

	endwhile;
endif;
?&gt;
</pre>
<p>That's not too hard is it? The hard part is when you try to do this for your category or custom taxonomy pages. There is no custom post type archives template in WordPress, so creating working paginated taxonomy post lists is very much a pain in the ass. WP 3.1 will solve this problem. I've seen so many people asking about it, since I learned about it back in May. I know how to do it though. :P</p>
<h2>List Custom Post Types in the Sidebar with WP_Query()</h2>
<p>If you want to just show a list of all posts in each custom post type, maybe even including which post type the posts are next to each item, we can create a function with a <a href="http://new2wp.com/pro/part-1-dynamic-jquery-featured-post-slider-with-or-without-javascript/">custom Loop that uses <span id="fixed">WP_Query()</span></a>. </p>
<p>This is how you create a custom Loop that isn't the main page loop, but displayed on a page that has the main loop. I prevents any unwanted mishaps that might arise from running <span id="fixed">query_posts()</span>. You can <a href="http://new2wp.com/noob/query_posts-wp_query-differences/">learn more about the difference between query_posts() and WP_Query() here</a> if you're unclear about these functions.</p>
<h3>Custom Post Types List Loop Function</h3>
<p>When you make a custom query Loop that doesn't use any sort of pagination, or next_posts/prev_posts capabilities you don't need to include the <span id="fixed">$paged</span> variable. This code should be added to your functions.php file, btw.</p>
<pre class="brush: php; title: ; notranslate">
function list_all_posttypes() {
	global $post;
	echo '&lt;ul&gt;';
	rewind_posts();

	// Create a new WP_Query() object
	$wpcust = new WP_Query(
		array(
            'post_type' =&gt; array(
                'post',
                'custom_posttype_1',
                'custom_posttype_two',
                'custom_posttype3'
            ),
            'showposts' =&gt; '5' ) // or 10 etc. however many you want
        );

		// the $wpcust-&gt; variable is used to call the Loop methods. not sure if required
        if ( $wpcust-&gt;have_posts() ):
            while( $wpcust-&gt;have_posts() ) : $wpcust-&gt;the_post();
        ?&gt;

		&lt;li&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;
			&lt;?php
			// get the post type for each post
        	$posttype = get_post_type( $post-&gt;ID );
            if ( $posttype) {
            	echo '(' . $posttype . ')'; // display what each post is in parenthesis
			} ?&gt;
		&lt;/li&gt;

		&lt;?php
		endwhile;  // close the Loop
	endif;
        wp_reset_query(); // reset the Loop

	echo '&lt;/ul&gt;';
} // end of list_all_posttypes() function
</pre>
<p>Now you can use the function <span id="fixed">list_all_posttypes()</span> either in your <span id="fixed">register_sidebar_widget()</span> for your custom midget, baby widget, or you can just drop the function into your sidebar.php file where you want the list of posts to show simply by calling the function. In fact, this can be used anywhere in your theme to show this list. All you have to do is call the function. I created a custom dashboard widget using something similar to this on <a href="http://2010.wphonors.com">WPHonors.com</a>.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php if(function_exists('list_all_posttypes') { list_all_posttypes(); } ?&gt;
</pre>
<p>If you have any questions let me know in the comments below. Maybe for a future post I'll show you how to create a custom midget for your site to make use of this function. Wouldn't you want your very own midget?</p>
<div id="crp_related"><h3>Related Posts</h3><ul class="relatedposts"><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/pro/part-1-dynamic-jquery-featured-post-slider-with-or-without-javascript/" rel="bookmark" class="crp_title">Part 1: Dynamic jQuery Featured Post Slider &#8211; Using Custom Loops</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/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/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/noob/show-multiple-custom-post-type-posts-query-sidebar/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>New2Tip: How To Include Custom Post Types In WordPress Search</title>
		<link>http://new2wp.com/noob/wordpress-search-custom-post-types/</link>
		<comments>http://new2wp.com/noob/wordpress-search-custom-post-types/#comments</comments>
		<pubDate>Sat, 16 Oct 2010 16:13:01 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Noob]]></category>
		<category><![CDATA[Post types]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[wp3.0]]></category>

		<guid isPermaLink="false">http://new2wp.com/?p=2615</guid>
		<description><![CDATA[Trying to get your custom post types in WordPress to be included in your search results when you search your site? 

How about just any kind of customized search for content of your choosing? Here's how to do it, simple and sweet.]]></description>
			<content:encoded><![CDATA[<h2>Easy Way To Add Search For Custom Post Types</h2>
<p>With WordPress 3.0 and the new custom post types WordPress has you are unable to search the content of these using the normal WordPress search form by default.</p>
<p>Well now how useful is your search form when you add a new custom post type but you are unable to use the search form to find content posted to them?  Luckily, it is simple enough to add custom post types to your search query so that your searches will search all post types which you choose to define for the search form to search.</p>
<p>This is similar to a post I wrote before on <a href="http://new2wp.com/noob/new2tip-allow-visitors-to-search-by-category/">allowing visitors to search by category</a>, only better!</p>
<h2>Adding Custom Post Types To Your Search Query</h2>
<p>All you need to do is create a function, which can be add to your functions.php file. This function checks if the <span id="fixed">$query</span> variable is the search query <span id="fixed">$query->is_search</span> passes the <span id="fixed">$query</span> and then sets the post types which should be searched using the queried keyword you entered in the form, then returns what the <span id="fixed">$query</span> should search within.</p>
<pre class="brush: php; title: ; notranslate">
// Define what post types to search
function searchAll( $query ) {
	if ( $query-&gt;is_search ) {
		$query-&gt;set( 'post_type', array( 'post', 'page', 'feed', 'custom_post_type1', 'custom_post_type2', 'custom_post_type3', 'custom_post_type4' ));
	}
	return $query;
}

// The hook needed to search ALL content
add_filter( 'the_search_query', 'searchAll' );
</pre>
<p>You can also use this method to set up custom searches, like if you wanted to search JUST post_type_X or all post types, but excluding Y or Z post types and including 'feed' and 'attachment'. </p>
<p><strong>For example:</strong></p>
<pre class="brush: php; title: ; notranslate">
function customSearch( $query ) {
	if ( $query-&gt;is_search ) {
	$query-&gt;set(
		'post_type', array( 'page', 'feed', 'attachment', 'custom_post_type_X', 'custom_post_type_Z' ));
	}
	return $query;
}
add_filter( 'the_search_query', 'customSearch' );
</pre>
<p>You can mix and match whatever you want and however. If on a specific page you want to only allow people to search a single post type all you have to do is <span id="fixed">if (is_page('page_slug')) { // call custom search function here }</span>.</p>
<p>Just make sure that you add the filter to hook into the search query <span id="fixed">add_filter( 'the_search_query', 'FUNCTION_CALLBACK')</span> otherwise it won't apply the filter and your custom search queries won't work the way you want.</p>
<p>It's that simple.</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/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/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/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/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/noob/wordpress-search-custom-post-types/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>New2Tip: Allow Visitors To Search By Category</title>
		<link>http://new2wp.com/noob/new2tip-allow-visitors-to-search-by-category/</link>
		<comments>http://new2wp.com/noob/new2tip-allow-visitors-to-search-by-category/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 10:00:09 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Noob]]></category>
		<category><![CDATA[Categorys]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[Search]]></category>

		<guid isPermaLink="false">http://new2wp.com/?p=1729</guid>
		<description><![CDATA[Learn how to easily add a category drop down select box to your WordPress search form to provide a more customizable way to search for a specific post on your site.]]></description>
			<content:encoded><![CDATA[<h2>Changing The Form</h2>
<p>To add the drop down select menu for categories, you simply use the <span id="fixed">wp_dropdown_categories()</span> function with at least one parameter of <span id="fixed">show_option_none=Select category</span>. You can also <a href="http://codex.wordpress.org/Function_Reference/wp_dropdown_categories">add other options</a> too if you like. </p>
<p>The following code is what I use for the searchform.php here on New2WP. </p>
<pre class="brush: php; title: ; notranslate">
&lt;!-- The searchform.php template code --&gt;
&lt;form id=&quot;searchform&quot; method=&quot;get&quot; action=&quot;&lt;?php bloginfo('url'); ?&gt;&quot;&gt;
    &lt;input type=&quot;text&quot; name=&quot;s&quot; id=&quot;s&quot; size=&quot;15&quot; /&gt;
    &lt;?php wp_dropdown_categories('show_option_none=Select category'); ?&gt;
		&lt;input name=&quot;s&quot; id=&quot;s&quot; type=&quot;text&quot; class=&quot;searchinput&quot; value=&quot;&lt;?php if ( is_search() ) echo esc_attr( get_search_query() ); else echo 'Search'; ?&gt;&quot; onfocus=&quot;if(this.value==this.defaultValue)this.value='';&quot; onblur=&quot;if(this.value=='')this.value=this.defaultValue;&quot; /&gt;
    &lt;input type=&quot;submit&quot; value=&quot;Search&quot; /&gt;
&lt;/form&gt;
</pre>
<h2>Add a function</h2>
<p>In order to hook into the search query that happens when you submit the search form you need to add this to your functions.php file.</p>
<pre class="brush: php; title: ; notranslate">
// Add to functions.php file.
add_action('pre_get_posts', 'search_by_cat');

function search_by_cat() {
	global $wp_query;

	if (is_search()) {
                $cat = intval( $_GET['cat'] );
                $cat = ( $cat &gt; 0  ) ? $cat : '';
                $wp_query-&gt;query_vars['cat'] = $cat;
    }
}
</pre>
<p>If you have any questions about this please post a comment below and let me know. This is something that is so easy though, that it took me just about 10 minutes to add to New2WP on all pages besides the homepage. It shouldn't be too difficult to figure out, but let me know if you need help I'm happy to help with anything.</p>
<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/rookie/understanding-conditional-statements/" rel="bookmark" class="crp_title">Understanding Conditional Statements</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><li><a href="http://new2wp.com/noob/highlighting-onclick-shortlink-wordpress3/" rel="bookmark" class="crp_title">New2Tip: Adding A Click Highlighting Shortlink Input To Posts</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/noob/new2tip-allow-visitors-to-search-by-category/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New2Tip: Adding A Click Highlighting Shortlink Input To Posts</title>
		<link>http://new2wp.com/noob/highlighting-onclick-shortlink-wordpress3/</link>
		<comments>http://new2wp.com/noob/highlighting-onclick-shortlink-wordpress3/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 14:00:37 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Noob]]></category>
		<category><![CDATA[Shortlinks]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[wp3.0]]></category>

		<guid isPermaLink="false">http://new2wp.com/?p=1976</guid>
		<description><![CDATA[Learn how to utilize the new WordPress 3.0 shortlinks feature by adding an auto highlighting text input field to your posts that will highlight the current posts shortlink. This makes it easier to Cntrl + C to copy and paste somewhere else for sharing. 

And it's just kind of cool too.]]></description>
			<content:encoded><![CDATA[<h2>Using WordPress 3.0 Shortlinks</h2>
<p>This is a quick tip for how you can add an input form field to your posts that has the posts shortlink now built into WordPress 3.0, that automatically highlights for easy copying, just like the one you see at the bottom right of every post on New2WP.</p>
<p><strong>Here's an example of this</strong></p>
<p><span class="shortlink">Shortlink:<br />
<input type="text" value="Click here to auto copy" onclick="this.focus(); this.select();" style="width:160px;" /></span></p>
<p>First check if the function exists incase for some reason it doesn't your theme won't break then.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php if ( function_exists( 'wp_get_shortlink' ) ) { ?&gt;
</pre>
<p>Then create a span element which will include the input field and if you want, the word Shortlink so that people know what it is for.</p>
<p>For the input value echo out the <span id="fixed">wp_get_shortlink( get_the_ID() )</span> functions for getting the shortlink of the current post by it's ID.</p>
<p>Then add an onclick event with some Javascript code that says basically, when this is clicked, the input is in focus, this should be selected. </p>
<pre class="brush: php; title: ; notranslate">
	&lt;span class=&quot;shortlink&quot;&gt;Shortlink:
		&lt;input type='text' value='&lt;?php echo wp_get_shortlink(get_the_ID()); ?&gt;' onclick='this.focus(); this.select();' /&gt;
	&lt;/span&gt;
</pre>
<p>Finally, close the if statement first opened to check if the function exists.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php } ?&gt;
</pre>
<p>It's really as simple as that. You can style it with CSS if you want easily, and whatever else you can think of.</p>
<h3>Here's The Full Code</h3>
<pre class="brush: php; title: ; notranslate">
&lt;?php if ( function_exists( 'wp_get_shortlink' ) ) { ?&gt;
	&lt;span class=&quot;shortlink&quot;&gt;Shortlink:
		&lt;input type='text' value='&lt;?php echo wp_get_shortlink(get_the_ID()); ?&gt;' onclick='this.focus(); this.select();'  /&gt;
	&lt;/span&gt;
&lt;?php } ?&gt;
</pre>
<p>If you have questions, don't hesitate to post a comment below as always.</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/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/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/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/rss-subscribe-boxafter-wordpress-posts/" rel="bookmark" class="crp_title">Easily Add A Subscribe To Feed Reminder To The Bottom Of Your Posts</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://new2wp.com/noob/highlighting-onclick-shortlink-wordpress3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Easily Add A Subscribe To Feed Reminder To The Bottom Of Your Posts</title>
		<link>http://new2wp.com/noob/rss-subscribe-boxafter-wordpress-posts/</link>
		<comments>http://new2wp.com/noob/rss-subscribe-boxafter-wordpress-posts/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 13:00:22 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Noob]]></category>
		<category><![CDATA[Functions]]></category>
		<category><![CDATA[RSS Feeds]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://new2wp.com/?p=1880</guid>
		<description><![CDATA[Learn how to add custom content like a RSS subscribe reminder box to the bottom of your WordPress posts for your readers to see once they finish reading posts. This is a quick and easy way to add whatever you want below your posts.]]></description>
			<content:encoded><![CDATA[<h2>Why Would You Do It?</h2>
<p>Once your readers are finished reading an article on your site, what's next? Subscribe to the RSS feed!! Adding a little reminder for people to subscribe to the feed once they finish reading your post is a prime location for such a reminder, and can be a great way to gain regular readers of your blog posts and visitors to your site. </p>
<p>You might have noticed the little reminder to subscribe at the bottom of posts on this site.<br />
<a href="http://new2wp.com/wp-content/uploads/2010/07/rss-box.png"><img src="http://new2wp.com/wp-content/uploads/2010/07/rss-box.png" alt="rss-box" title="rss-box" width="564" height="62" class="aligncenter size-full wp-image-1881" /></a><br />
The question of how to do this was posed in a <a href="http://new2wp.com/noob/wordpress-plugin-new2wp-author-box-version-1-0/#comment-1327">comment on another post</a>, so I figured it would be good to write a post on it.</p>
<p>Keep in mind that this trick can be used to add anything you want to the bottom of your posts, not just a feed subscribe box. That I leave up to you.</p>
<h2>The Styles Make Smiles</h2>
<p><a href="http://feeds.feedburner.com/New2WP"><img src="http://new2wp.com/wp-content/themes/New2WP/images/rss-feed.png" alt="RSS Image" class="alignleft" /></a>Here's the RSS icon image. The code for styling the box shown on this site is pretty basic, and somewhat generic. You could use it as is or alter it to fit your needs. </p>
<pre class="brush: php; title: ; notranslate">
.rssbox {
	background: #e4e4e4 url(images/rss-feed.png) no-repeat left top;
	background-position: 20px 7px;
	border: 1px solid #121a24;
	padding:5px 10px 5px 80px;
	margin: 0px;
	font-size: 16px;
	line-height: 23px;
	color: #121a24;
	height:50px;
	width: 472px;
	overflow:hidden;
}
.rssbox a {
	color:#FF7600;
	text-decoration: none;
	font-weight:normal;
	text-shadow:0 1px 0 #FFD563!important;
}
.rssbox a:hover {
	color:#133DF2;
	text-shadow:0 1px 0 #398CFF !important;
}
</pre>
<h2>A Function Or Something</h2>
<p>This function can be added to your <strong>functions.php</strong> file. It is basically just outputting the HTML code which contains the content for my RSS box. You can show whatever you want by putting it within this function..</p>
<pre class="brush: php; title: ; notranslate">
/* Create RSS Box at bottom of single-posts */
function postBottomBox() { ?&gt;

	&lt;div class=&quot;rssbox&quot;&gt;
	Get automatic updates! &lt;a href=&quot;http://feeds.feedburner.com/New2WP&quot; target=&quot;_blank&quot; rel=&quot;bookmark&quot;&gt;Subscribe to Our RSS Feed&lt;/a&gt; or &lt;a href=&quot;http://feeds.feedburner.com/fb/a/mailverify?uri=New2WP&quot; target=&quot;_blank&quot;&gt;Get Email Updates&lt;/a&gt; sent straight to your inbox!
	&lt;/div&gt;

&lt;?php } /* end of RSS box */ ?&gt;
</pre>
<h2>Making It Dance And Sing</h2>
<p>You can make it show on the page using two different methods. I personally like to have full control of the order and placement of things whether it's a plugin or a custom function. That is why I use the first example here. You have the ability to place it right where you want to it to display this way.</p>
<p>In your <strong>single.php</strong> template of your theme, add this below the function <span id="fixed">the_content()</span> where ever you'd like it to display. This checks if the function exists, in the case that it doesn't for some reason which would break the theme, and then calls the function if it exists.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php if (function_exists( 'postBottomBox' )) { echo postBottomBox(); } ?&gt;
</pre>
<p>The other way you could make it display is by adding a filter to hook into the single template functions.</p>
<pre class="brush: php; title: ; notranslate">
// Use this to add it to the bottom of the post content
add_filter( 'the_content', 'postBottomBox' );

// Use this to add it just above your comments
add_filter( 'comments_template', 'postBottomBox' );
</pre>
<p>You don't have as much control using <span id="fixed">add_filter()</span> though. Many plugins use them to display whatever they display, most commonly, <span id="fixed">the_content()</span>. </p>
<p>This is used by similar post plugins for example, and I'm sure many others. The <a href="http://new2wp.com/noob/wordpress-plugin-new2wp-author-box-version-1-0/">New2WP Author Box plugin</a> uses the <span id="fixed">'comments_template'</span> hook, which I chose to do because at the time I wanted the author bio box to display below all other possible content added by plugins such as similar posts. For me personally and logically, seeing other similar posts would be more interesting as a reader than a box showing a bio about the post I just read. However, using the comments template hook sometimes causes problems with more complex themes.</p>
<h2>So What To Do Now??</h2>
<p>Well that's a no-brainer.... <strong><a href="http://feeds.feedburner.com/fb/a/mailverify?uri=New2WP">Subscribe to the Feed</a>!!</strong></p>
<p>Here's a list of our feeds which you may be interested in for those who are only really interested in getting updates for one type of thing and not all new posts and other updates.</p>
<div style="width:550px; overflow:hidden;background:#efefef; padding:5px; margin-bottom:5px; border-radius:3px; -moz-border-radius:3px;">
<ul class="rsss" style="float:left; width:250px"><strong>Useful</strong></p>
<li><a style="opacity: 1;" href="http://feeds.feedburner.com/New2WP3-0" rel="bookmark" title="WordPress 3.0">RSS Feed for WP 3.0</a></li>
<li><a style="opacity: 1;" href="/tag/tutorials/feed/" rel="bookmark" title="Tutorials">RSS Feed for Tutorials</a></li>
<li><a style="opacity: 1;" href="http://feeds.feedburner.com/new2wp-snippets" rel="bookmark" title="Snippets">RSS Feed for Snippets</a></li>
<li><a style="opacity: 1;" href="http://new2wp.com/tag/functions/feed" rel="bookmark" title="Functions">RSS Feed for Functions</a></li>
</ul>
<ul class="rsss" style="float:left;"><strong>Levels</strong></p>
<li><a style="opacity: 1;" href="http://feeds.feedburner.com/new2wp-featured" rel="bookmark" title="Featured">RSS Feed for Featured</a></li>
<li><a style="opacity: 1;" href="http://feeds.feedburner.com/new2wp-pro" rel="bookmark" title="Professional">RSS Feed for Professionals</a></li>
<li><a style="opacity: 1;" href="http://feeds.feedburner.com/new2wp-rookie" rel="bookmark" title="Intermediate">RSS Feed for Intermediates</a></li>
<li><a style="opacity: 1;" href="http://feeds.feedburner.com/new2wp-noob" rel="bookmark" title="Beginner">RSS Feed for Beginners</a></li>
</ul>
</div>
<p>Hope this has helped you customize your posts with some nifty additions to the bottom of your posts!! Feel free to comment with any questions or other thoughts below.</p>
<div id="crp_related"><h3>Related Posts</h3><ul class="relatedposts"><li><a href="http://new2wp.com/news/50-free-smooth-photoshop-gradients/" rel="bookmark" class="crp_title">50 Free Smooth Photoshop Gradients</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/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/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></ul></div>]]></content:encoded>
			<wfw:commentRss>http://new2wp.com/noob/rss-subscribe-boxafter-wordpress-posts/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>How To Make Two Tone CSS 3 Inset Buttons</title>
		<link>http://new2wp.com/noob/how-to-make-css3-buttons/</link>
		<comments>http://new2wp.com/noob/how-to-make-css3-buttons/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 13:00:12 +0000</pubDate>
		<dc:creator>Jared</dc:creator>
				<category><![CDATA[Noob]]></category>
		<category><![CDATA[Buttons]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://new2wp.com/?p=1634</guid>
		<description><![CDATA[If you've been online in the past few months, you probably know about CSS 3 and maybe some of the cool things you can do with it. Let me show you how to make some cool CSS 3 inset buttons I figured out how to do.]]></description>
			<content:encoded><![CDATA[<h2>CSS 3 Buttons Are Cool!</h2>
<p><img src="http://new2wp.com/wp-content/uploads/2010/06/css3buttons.png"  class="alignright" />When I was redesigning the site I'm developing a new WordPress 3.0 app, I just happened to stumble across a simple way to create some cool buttons that can use different colors. Since the site I'm making is all HTML 5 and CSS 3 this was an added bonus. I just happened to make a change to the CSS using Firebug, and realized what could be possible just by adding a <span id="fixed">&lt;span&gt;</span> to the anchor element which had the CSS class 'button'.</p>
<p>By doing that, you are then able to style the span separately, and thereby creating an inset or outset look to the button.<br />
<a href="http://new2wp.com/" rel="bookmark"><img src="http://new2wp.com/wp-content/uploads/2010/06/new2wp-468x60px1.png" alt="new2wp-468x60px" title="new2wp-468x60px" width="468" height="60" class="aligncenter size-full wp-image-1646" /></a></p>
<h2>Create the blue button</h2>
<p>Here is the code I used to make it. Just play with the color values if you want to make different colored buttons. I suggest using Firebug to do this so you can see your changes in real-time without refreshing the page.</p>
<pre class="brush: php; title: ; notranslate">
.button span {
box-shadow:1px 1px 2px rgba(255, 255, 255, 0.8);
-moz-box-shadow:1px 1px 2px rgba(255, 255, 255, 0.8);
-webkit-box-shadow:1px 1px 2px rgba(255, 255, 255, 0.8);
background:rgba(222, 231, 238, 0.8);
border-color:#4884D7 #4A7EFF #E0E6E5 #91B4FF;
border-style:solid;
border-width:1px;
color:#3B718E;
font-family:Palintino Linotype;
padding:6px 12px;
text-shadow:0 1px 0 #FFFFFF;
}
style.css (line 248)
.button, .button span {
-moz-border-radius:5px 5px 5px 5px;
-moz-box-shadow:1px 1px 0 rgba(255, 255, 255, 0.5);
background-image:-moz-linear-gradient(center top , #76CFFF, #3D81EE);
border:1px solid #0386FF;
display:block;
float:left;
font-family:Palintino Linotype;
font-size:14px;
font-weight:bold;
padding:5px;
text-shadow:1px 1px 0 rgba(247, 255, 255, 0.9);
}
</pre>
<h2>Here is all the HTML needed</h2>
<pre class="brush: php; title: ; notranslate">
&lt;a class=&quot;button&quot; href=&quot;#&quot;&gt;&lt;span&gt;Button&lt;/span&gt;&lt;/a&gt;
</pre>
<p>It's not really anything too special, but I thought it was pretty cool, and I haven't see any CSS 3 buttons quite like this before. Most I see are done a similar way as the buttons you see at the top right of this site. Yes those are just CSS 3 buttons. Have fun!</p>
<div id="crp_related"><h3>Related Posts</h3><ul class="relatedposts"><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/jquery-drop-down-menu-wordpress-3-menu/" rel="bookmark" class="crp_title">Create A WordPress 3.0 jQuery Drop Down Nav Menu</a></li><li><a href="http://new2wp.com/noob/rss-subscribe-boxafter-wordpress-posts/" rel="bookmark" class="crp_title">Easily Add A Subscribe To Feed Reminder To The Bottom Of Your Posts</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/rookie/part-2-the-static-version-of-the-jquery-featured-post-slider/" rel="bookmark" class="crp_title">Part 2: The Static Version Of The jQuery Featured Post Slider</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://new2wp.com/noob/how-to-make-css3-buttons/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

