<?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>Ballyhoo Blog</title>
	<atom:link href="http://www.ballyhooblog.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ballyhooblog.com</link>
	<description>bloggin' like a banshee</description>
	<lastBuildDate>Tue, 17 Apr 2012 20:33:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Mobile Ads CTR &#8211; Publishers are crazy</title>
		<link>http://www.ballyhooblog.com/mobile-ads-ctr-publishers-are-crazy/</link>
		<comments>http://www.ballyhooblog.com/mobile-ads-ctr-publishers-are-crazy/#comments</comments>
		<pubDate>Tue, 17 Apr 2012 20:31:40 +0000</pubDate>
		<dc:creator>Ballyhoo Blog</dc:creator>
				<category><![CDATA[opinion]]></category>
		<category><![CDATA[admob]]></category>
		<category><![CDATA[ctr]]></category>
		<category><![CDATA[iads]]></category>
		<category><![CDATA[mobile ads]]></category>

		<guid isPermaLink="false">http://www.ballyhooblog.com/?p=172</guid>
		<description><![CDATA[I&#8217;ve been wanting to weight in on the topic of CTR (Click Through Rates) on Mobile devices for quite some time. I&#8217;ve actually never implemented a mobile ad set-up via Apples iAds or Googles AdMob. It seems pretty straight forward and much like the traditional AdWords approach. The topic I wanted to broach was CTR [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been wanting to weight in on the topic of CTR (Click Through Rates) on Mobile devices for quite some time.  I&#8217;ve actually never implemented a mobile ad set-up via Apples <a href="http://advertising.apple.com/" title="iAds" target="_blank">iAds</a> or Googles <a href="http://www.google.com/ads/admob/" title="AdMob" target="_blank">AdMob</a>.  It seems pretty straight forward and much like the traditional AdWords approach.</p>
<p>The topic I wanted to broach was CTR rate on Mobile Ads.  Here is what I&#8217;ve found from several informal surveys I&#8217;ve conduced with colleagues, students, and other associates.</p>
<p>95% of &#8216;clicks&#8217; or shall I say &#8216;taps&#8217; on mobile ads served from mobile websites, or native apps are <strong>ACCIDENTAL</strong>.</p>
<blockquote><p>Case in point:  I&#8217;ve clicked on hundreds and hundreds of these ads in the 5 years I&#8217;ve been rocking an iPhone.  I have NEVER purposely, with full intention, clicked on one of these mobile ads.  Not once.  Nada. Never. Zip. Zilch.</p></blockquote>
<p>Am I a lone case here?  Surely the advertisers are aware of this.  Are they actually getting any ROI whatsoever from these ads?  Can some advertiser weigh in here?  Do you realize that 95% of all the &#8216;clicks&#8217; on your ad were accidental, or done by my 3 year old son?</p>
<p>The mobile Ad space is really broken. Re-inforced by Apples alteration of their iAd and payout program for mobile ads <a href="http://www.imore.com/2012/02/15/apple-lowers-iad-buyin-rate-increases-revenue-sharing/" title="ctr mobile ads" target="_blank">over</a> and <a href="http://9to5mac.com/2012/04/01/apple-boosts-iad-revenue-share-for-developers-from-60-to-70/" title="iAd" target="_blank">over</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ballyhooblog.com/mobile-ads-ctr-publishers-are-crazy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress wp-blog-header.php custom page 404</title>
		<link>http://www.ballyhooblog.com/wordpress-wp-blog-header-php-custom-page-404/</link>
		<comments>http://www.ballyhooblog.com/wordpress-wp-blog-header-php-custom-page-404/#comments</comments>
		<pubDate>Thu, 15 Mar 2012 22:49:16 +0000</pubDate>
		<dc:creator>Ballyhoo Blog</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[404]]></category>
		<category><![CDATA[custom page]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp-blog-header.php]]></category>

		<guid isPermaLink="false">http://www.ballyhooblog.com/?p=166</guid>
		<description><![CDATA[A fix for 404 page not found errors on WordPress custom pages using the wp-blog-header.php include.]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s nasty bugs, then there is <em>this.</em></p>
<h2>A Quick Background</h2>
<p>I noticed my website, that I converted to run mostly on WordPress, was dropping rankings in Google. I thought not too much of this, as I figured since a large portion of the site was being served differently, once Google had indexed and caught back up with my new method of madness, I&#8217;d climb back up.</p>
<p>I finally decided to go check out Google&#8217;s Webmaster tools (which I have set up on the site) to see if it was finding errors I hadn&#8217;t seen. Mind you, this is after several months. I quickly noticed something was real-bad-wrong when Google claimed that 70,000 of my links were returning 404&#8242;s!!!</p>
<p>So I starting clicking on the links Google claimed were dead. Not a single one of the pages returned a 404, nor showed my custom 404 page I had set up in WordPress. Not a one. Obviously something was still amiss. I snagged the handy Firefox plugin FireBug, and looked at the actual headers that were being returned by those pages. Sure enough. A good portion of my URL&#8217;s were giving 404&#8242;s. The strange thing, is that the page was returning and being loaded just fine&#8230;</p>
<p>After further searching I noticed a pattern. All of the 404 pages were custom pages that weren&#8217;t really part of the wordpress framework, but I was including WP functions in the following manner (like the docs suggest you&#8217;re supposed to do):</p>
<p><code><br />
&lt;?php<br />
define('WP_USE_THEMES', false);<br />
include($_SERVER['DOCUMENT_ROOT'] . '/wp-blog-header.php');<br />
?&gt;<br />
</code></p>
<p>Look familiar? If you&#8217;re reading this article, it probably does. It turns out that this will cause WordPress to throw a 404 header, even though the page displays! Because the actual .php or .html file <em><strong>is</strong></em> in the directory.</p>
<p>I started searching the net, and found several &#8220;solutions&#8221; to this problem. Some people were even suggesting just changing the title of the pages via filters to override the 404 not found titles!! BAD IDEA. Some were suggesting forcing a new header manually like so: <code>header("HTTP/1.1 200 OK");</code></p>
<p>I don&#8217;t know why it works, but changing the code to include wp-load instead of wp-blog-header seems to fix the 404 error on custom pages! I haven&#8217;t found any adverse effects at all&#8230;</p>
<h2>Here is the fix.</h2>
<p><code><br />
&lt;?php<br />
define('WP_USE_THEMES', false);<br />
include($_SERVER['DOCUMENT_ROOT'] . '/wp-load.php');<br />
?&gt;<br />
</code></p>
<p>Thanks to the following post (with its own special fix), and more importantly <a title="this comment" href="http://www.adrogen.com/blog/wordpress-wp-blog-headerphp-causes-404-in-ie/comment-page-1/#comment-13325" target="_blank">http://www.adrogen.com/blog/wordpress-wp-blog-headerphp-causes-404-in-ie/comment-page-1/#comment-13325</a> for the final fix.</p>
<p>I wonder how many zillions of people have used this method when using custom pages with WordPress functions included and have no idea that their <strong>custom pages are sending 404 headers courtesy of WordPress</strong>?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ballyhooblog.com/wordpress-wp-blog-header-php-custom-page-404/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HTML is the new English</title>
		<link>http://www.ballyhooblog.com/html-is-the-new-english/</link>
		<comments>http://www.ballyhooblog.com/html-is-the-new-english/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 23:54:55 +0000</pubDate>
		<dc:creator>Ballyhoo Blog</dc:creator>
				<category><![CDATA[opinion]]></category>

		<guid isPermaLink="false">http://www.ballyhooblog.com/?p=148</guid>
		<description><![CDATA[HTML is the new English - Bold predictions about our "always connected" Internet future.]]></description>
			<content:encoded><![CDATA[<p>I usually blog tutorials around the design/web arena, and have been wanting to create a little section of this site to where I can rant and or rave about a few topics.  This post is the first of such.</p>
<p>First of all, let it be known that I teach for a living.  I enjoy it.  I teach at a 2 year college.  I teach web design.  Most of my students are &#8220;designers&#8221;.  I&#8217;ve noticed a few things.</p>
<ol>
<li>People think web design is easy. (thanks a lot wordpress, weebly, myspace, blogspot, frontpage, insert favorite WYSYWYG here etc..)
</li>
<li>Most of the students sort of know what &#8220;HTML&#8221; is.  (&#8220;It&#8217;s the Internet language stuff&#8230;&#8221;)
</li>
<li>6 years ago, most <em>didn&#8217;t</em> know who nor what HTML is.
</li>
</ol>
<p><strong>This is a pretty significant shift, in a few short years.</strong></p>
<p>With as pervasive as the internet has become, residing in most everyones pocket, the Internet and <em>its language</em> are the communication standard of the 21st century.  I can see if a few short years. HTML being taught right alongside English, Math, &#038; Science.  Our middle schools will soon be teaching their students how to deliver, consume, and author content on the web.  When they reach college level learning, HTML will be like English.  It will be the non-verbal communication tool that all people will need to know.  Those who don&#8217;t learn it, will be the minority or disadvantaged.  </p>
<p>Whether or not they use the language daily or not, they will be better employees/managers for having attained the skill.</p>
<p><em><strong>HTML is the new English my friends.</strong><br />
</em><br />
Maybe in some future not-so-distant date, instead of the facebook and twitters and picassas, and g pluses, we will all just have our own domains.  Instead of signing in to a business site to make social connections, I just connect my domain to my friends domain.  I control my content, my look, my ads, my design, my services, my widgets etc.</p>
<p>Aside from the business/entertainment side of the web, I see the &#8220;Social Web&#8221; as a giant mashup of Blogspot blogs meets Facebook meets Myspace, meets Twitter meets WordPress.org CMS meets RSS meets XML, where users are in control of their own domain, and create sites that are more of an extension of themselves.  The connections are made between the domains.  Standards arise to define new types of &#8220;social&#8221; content syndication.  People write widgets and plugins that users can easily integrate/subsribe to/purchase.  </p>
<p>The evolving notification world of mobile comes to the web.  I&#8217;m notified of the ongoings of my social domain.  I lose my address books and &#8220;contacts&#8221;.  These social connections are my contacts.  I decide how to categorize or label them.  The programmers and developers create the products, I am the master of my domain.  HTML gives me that ability and power.</p>
<p>HTML is the new English.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ballyhooblog.com/html-is-the-new-english/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress Custom Fields in Comments</title>
		<link>http://www.ballyhooblog.com/custom-fields-wordpres-comments/</link>
		<comments>http://www.ballyhooblog.com/custom-fields-wordpres-comments/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 01:25:01 +0000</pubDate>
		<dc:creator>Ballyhoo Blog</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[comments]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[custom comment fields]]></category>
		<category><![CDATA[fields]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.ballyhooblog.com/?p=104</guid>
		<description><![CDATA[I&#8217;ve been tinkering with how to add custom fields to my wordpress comments. It turns out the documentation is sort of sparse in regards to doing so, but a few helpful posts, and some digging inside of the comment-template.php core file finally got me there. The Background I&#8217;ve got regular posts and such with regular [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been tinkering with how to add <strong>custom fields to my wordpress comments</strong>.  It turns out the documentation is sort of sparse in regards to doing so, but a <a href="http://www.philaeum.nl/blog/index.php/wordpress-get_comment_meta-and-update_comment_meta/">few</a> <a href="http://mondaybynoon.com/2011/01/24/wordpress-custom-comment-fields/">helpful</a> posts, and some digging inside of the <a href="http://core.trac.wordpress.org/browser/tags/3.2/wp-includes/comment-template.php#L1510" title="The Comments-Template.php core file" target="_blank">comment-template.php</a> core file finally got me there.</p>
<h2>The Background</h2>
<p>I&#8217;ve got regular posts and such with regular comments.  I&#8217;ve got a custom post type set up for a section of a site thats called &#8220;units&#8221;.  I wanted this custom post type to have it&#8217;s own special comments with the additional custom fields (It could be star ratings, drop down menus, extra input fields, whatever.)  I wanted regular comments everywhere on the site, except comments that were of that &#8216;unit&#8217; post type.  Since WordPress 3.0, there is a new generic form for handling comments.  In specific, this function call &#8216;comment_form()&#8217; loads it up.  This tutorial assumes your working with something later than 3.0 and using this new method of calling and formatting comments&#8230;</p>
<h2>The Solution</h2>
<h3>Step: 1</h3>
<p>The first thing is we have to set up a new comment.php template file, which we will include in our single.php post type pages.  The easiest way to do this, is just <strong><em>make a copy the comments.php and rename it comments-units.php</em></strong>.  That way we can have the two separate comment template files, and load them wherever we choose.</p>
<p>Find your &#8216;single-units.php&#8217; file, (or whatever template file you want to add your new comments to, and change this:</p>
<pre class="brush:php">
comments_template( '/comments.php', true );
</pre>
<p>To this:</p>
<pre class="brush:php">
comments_template( '/comments-units.php', true );
</pre>
<p>The &#8216;true&#8217; second parameter makes WordPress sort &#8216;trackback&#8217; comments separately from &#8216;regular&#8217; comments</p>
<h3>Step: 2</h3>
<p>Open up your comments-units.php file and find this line of code (near the bottom)</p>
<pre class="brush:php">
&lt;?php comment_form(); ?&gt;
</pre>
<p>Replace that comment_form line, with the following bit of code.  Of course, customize for your own needs.</p>
<pre class="brush:php">
&lt;?php
$args = array(
		'id_form' =&gt; 'commentform',
	    'id_submit' =&gt; 'submit',
	    'title_reply' =&gt; __( 'Leave a Unit Report' ),
	    'title_reply_to' =&gt; __( 'Leave a Reply to %s' ),
	    'cancel_reply_link' =&gt; __( 'Cancel reply' ),
	    'label_submit' =&gt; __( 'Post Report' ),
		'comment_field' =&gt; '&lt;p class="comment-form-comment"&gt;' . '&lt;label for="comment"&gt;' . __( 'Unit Report' ) . '&lt;/label&gt;' . '&lt;textarea id="comment" name="comment" cols="45" rows="12" tabindex="4" aria-required="true"&gt;&lt;/textarea&gt;' . '&lt;/p&gt;'
		);

      comment_form($args);
?&gt;
</pre>
<p>Note: This comment_form() function initiates the comment form.  We pass an variable with a set of arguments to ovverride some of the default items of the comment form.  For a full list, see the wp codex directory.</p>
<h3>Step 3</h3>
<p>Now we need to add whatever custom fields we want, to the default &#8220;name, url, website&#8221; fields.<br />
I&#8217;ve got two simple text input fields I&#8217;m adding to the comments here.  You can add as many or any type of form field.</p>
<pre class="brush:php">
global $mm_extra_fields;
	$mm_extra_fields = array(
		'hidden_field1' =&gt; '&lt;input id="type" name="type" type="hidden" value="unit-report" size="30" /&gt;',
		'field1' =&gt; '&lt;p class="comment-form"&gt;&lt;label for="species"&gt;Species&lt;/label&gt;&lt;span class="required"&gt;*&lt;/span&gt;&lt;input id="species" name="species" type="text" value="ex: Mule Deer" size="30"&gt;&lt;/p&gt;',
		'field2' =&gt; '&lt;p class="comment-form"&gt;&lt;label for="terrain"&gt;Terrain&lt;/label&gt;&lt;input id="terrain" name="terrain" type="text" value="ex: High Altitude, Rocky Terrain" size="30" aria-required="true"&gt;&lt;/p&gt;'
	);
</pre>
<p>I&#8217;ve put my fields inside of a variable called $mm_extra_fields.  This variable is an array, with keys and values.  The value for each key is the HTML that I will output via wp filters to the default fields list. I&#8217;m giving it global scope, so I can use it inside of my hook function below</p>
<p>Here is the hook, that adds the above fields, to the comment form list.</p>
<pre class="brush:php">
add_filter('comment_form_default_fields','mm_extra_fields');
	function mm_extra_fields($fields) {
		global $mm_extra_fields;
		foreach($mm_extra_fields as $mm_extra_field_key => $mm_extra_fields_html){
			$fields[$mm_extra_field_key] = $mm_extra_fields_html;
		}
		return $fields;
	}
</pre>
<p>You can see that we&#8217;re just looping over our array via foreach, and adding new keys and values to the the $fields[] variable.  Once were done, we return the $fields variable, which has our new fields attached!  Wallah.  We&#8217;re half way there&#8230;</p>
<p>You can see the before and after in the following photo.  <strong>(Don&#8217;t stop here, as there are a couple of &#8220;gotchas&#8221; ahead.)</strong></p>
<p><a href="http://www.ballyhooblog.com/wp-content/uploads/2011/07/custom-comment-fields.jpg"><img src="http://www.ballyhooblog.com/wp-content/uploads/2011/07/custom-comment-fields.jpg" alt="custom comment fields worpdress" title="custom-comment-fields" width="700" height="416" class="alignnone size-full wp-image-123" /></a></p>
<h3>Step 4</h3>
<p>One or two notes.  If your using your own CSS or forms, style accordingly.  I&#8217;ve had to make a few additions to the TwentyEleven css file, to get my new fields to style the same as the other defaults.  Namely the paragraph tag, that surrounds the form element.  I gave mine the generic class name of <code>'class="comment-form"'</code><br />
You&#8217;ll need to go add css styles to accommodate for this class name.</p>
<p>For example, you&#8217;d need to modify all of the css blocks, that deal with comment form styling to look something like this: (note I added my comment-form selector to the top of the grouped selectors).  There are a few other spots you&#8217;ll need to do the same&#8230;</p>
<pre class="brush:php">
        #respond .comment-form,
	#respond .comment-form-author,
	#respond .comment-form-email,
	#respond .comment-form-url,
	#respond .comment-form-comment {
		position: relative;
	}
</pre>
<h3>Step 5</h3>
<p>Here&#8217;s one of those gotchas.  Everything looks fine and dandy so far, but you&#8217;d sooner or later (hopefully sooner) realize that <strong>IF</strong> the user is logged in, all of your custom comment fields go away.  Not good. Not good at all.</p>
<p>Luckily there is a relatively easy fix for that.  We call upon another hook to add our same fields, if the user is logged in.  Here&#8217;s the code.</p>
<pre class="brush:php">
	add_action( 'comment_form_logged_in_after', 'mm_extra_comment_fields_logged_in',10,2);
	function mm_extra_comment_fields_logged_in($commenter,$user_identity){
		global $mm_extra_fields;
		foreach($mm_extra_fields as $mm_extra_fields_html){
			echo $mm_extra_fields_html."\n";
		}
	}
</pre>
<p>We&#8217;re re-using our array of extra fields we created earlier, and following the same logic on the first filter.  We&#8217;re just using a different hook this time&#8230;</p>
<h3>Step 6</h3>
<p>Get some ice cream already!</p>
<h3>Step 7</h3>
<p>Okay, so we have our form, it loads properly both when and when not logged in.  Now we just need a couple of more hooks to actually <strong>SAVE</strong> the form data into the database, and retrieve it to display with our comments&#8230;  Easy, right?</p>
<p>To save the custom comment fields, we call the function &#8216;add_comment_meta()&#8217; in the comment_post hook</p>
<pre class="brush:php">
add_action ('comment_post', 'mm_add_comment_meta', 1);
function mm_add_comment_meta($comment_id) {
	if(isset($_POST['type'])){
		$type = wp_filter_nohtml_kses($_POST['type']);
		add_comment_meta($comment_id, 'comment-type', $type, false);
	}
	if(isset($_POST['species'])){
		$species = wp_filter_nohtml_kses($_POST['species']);
		add_comment_meta($comment_id, 'species', $species, false);
	}
	if(isset($_POST['terrain'])){
		$terrain = wp_filter_nohtml_kses($_POST['terrain']);
		add_comment_meta($comment_id, 'terrain', $terrain, false);
	}
}
</pre>
<p>That&#8217;s it.  Whenever a comment gets posted, it will add our extra fields to the &#8220;comments_meta&#8221; database table.  This works exactly like &#8216;custom_fields&#8217; for regular posts.  It&#8217;s all just stored as meta data, but in it&#8217;s own comments_meta table.  Spiffy.  The <strong>wp_filter_nohtml_kses</strong> function strips out any html tags from the data, so users can&#8217;t upload malicious scripts or html&#8230;  There are several other validation functions in the codex to ensure safe data&#8230;</p>
<p>You might have noticed that in the first code drop, I actually had a hidden field called &#8216;type&#8217; that gets added along with my two visible fields.  I&#8217;m adding this, so I can flag comments to be my special &#8216;type&#8217; in the database.  This is sort of a hack, and no official documentation on how this should be used, but I&#8217;ll show it for completeness sake.</p>
<p>Just like regular posts have a &#8216;post_type&#8217; field, comments have a &#8220;comment_type&#8221; field.  WordPress only uses 2.  If it&#8217;s blank, that means it&#8217;s a regular comment, if it&#8217;s not a regular comment, it might say &#8216;trackback&#8217;.  Right now, I think those are the real only use cases.</p>
<p>Since I have my own &#8216;type&#8217; of comment, I decided to add &#8216;unit-report&#8217; in that field of the comment being inserted.  This allows me to run custom queries on the DB and get all comments that are of type=&#8217;unit-report&#8217; should I need.  Here&#8217;s how.</p>
<pre class="brush:php">
add_filter('preprocess_comment','mm_unit_comment_type');

function mm_unit_comment_type($commentdata){
	global $post;
	if ($post->post_type == 'units' {
		$commentdata['comment_type'] = 'unit-report';
		return $commentdata;
	}
	else{
		return $commentdata;
	}
}
</pre>
<p>First we check to make sure the comment is coming from comments of our custom post type &#8216;units&#8217;, if it is, we add the comment_type of &#8216;unit-report&#8217;.  That&#8217;s really it.</p>
<h3>Step LAST</h3>
<p>The lastliest thing we need to do, is display our custom meta values on our comments.  This is pretty easy.  I imagine most people are using the callback method for displaying posts, which is the way the default themes do it.  In order to make this work, you&#8217;ll need to go find that callback function call.  It looks like this, and should be in the middle of the the template file comments loop. (The function name is twentyeleven_comment)</p>
<pre class="brush:php">
wp_list_comments( array( 'callback' => 'twentyeleven_comment' ) );
</pre>
<p>Find that callback function (in your functions.php file) and edit the line that looks like this:</p>
<pre class="brush:php">
<div class="comment-content">
	&lt;?php comment_text(); ?&gt;
</div>
</pre>
<p>I made mine look like this. (We simply use a function called &#8216;get_comment_meta&#8217;, which takes the comment id, and key-name.) <strong>Setting the third parameter to true makes it output a string, if set to false, it will return an array</strong></p>
<pre class="brush:php">
&lt;div class="comment-content"&gt;
	&lt;?php
		if(is_singular('units')){
			?&gt;
			&lt;p&gt;&lt;?php echo "Species: ".get_comment_meta( $comment-&gt;comment_ID, 'species', true ); ?&gt;&lt;/p&gt;
			&lt;p&gt;&lt;?php echo "Terrain: ".get_comment_meta( $comment-&gt;comment_ID, 'terrain', true ); ?&gt;&lt;/p&gt;
			&lt;span&gt;Unit Report:&lt;/span&gt;
			&lt;?php
		}
	?&gt;
	&lt;?php comment_text(); ?&gt;
&lt;/div&gt;
</pre>
<p>Now we&#8217;re really done.  I do a quick check to see if we&#8217;re on a comment page of my post type of &#8216;units&#8217; (because both regular comments and my special &#8216;unit comments use this same callback for display) if so, we display the extra fields from the database we added earlier!  Phew.  That was lot.  </p>
<p>Comment and ask questions, or suggest better/alternate ways of noodling.  If you&#8217;ve made it this far, congrats.  There is admittingly <strong>ONE</strong> thing missing.  Now way to &#8220;edit&#8221; the custom wordpress comment fields on the back-end, like you can with regular comments.  Maybe I&#8217;ll look into this later&#8230;</p>
<p>Style to taste!</p>
<p><a href="http://www.ballyhooblog.com/wp-content/uploads/2011/07/final_comments.jpg"><img src="http://www.ballyhooblog.com/wp-content/uploads/2011/07/final_comments.jpg" alt="final custom meta" title="final_comments" width="575" height="203" class="alignnone size-full wp-image-124" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ballyhooblog.com/custom-fields-wordpres-comments/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Kids iPhone App</title>
		<link>http://www.ballyhooblog.com/kids-iphone-app/</link>
		<comments>http://www.ballyhooblog.com/kids-iphone-app/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 17:58:41 +0000</pubDate>
		<dc:creator>Ballyhoo Blog</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.ballyhooblog.com/?p=97</guid>
		<description><![CDATA[My first kids iPhone app is out. It&#8217;s called Toddler Trainer. It&#8217;s a simple learning game where your kids learn shapes, objects, numbers, letters, and words. Several different mini-prizes exists for successful level completion. If you&#8217;ve got kids between 1 year and 3.5 years, check it out, I&#8217;m sure they&#8217;ll love it. Iphone app for [...]]]></description>
			<content:encoded><![CDATA[<p>My first kids iPhone app is out.  It&#8217;s called Toddler Trainer.  It&#8217;s a simple learning game where your kids learn shapes, objects, numbers, letters, and words.  Several different mini-prizes exists for successful level completion.  If you&#8217;ve got kids between 1 year and 3.5 years, check it out, I&#8217;m sure they&#8217;ll love it.</p>
<p><a href="http://itunes.apple.com/us/app/toddler-trainer/id419472791?mt=8">Iphone app for kids</a><br />
<a href="http://itunes.apple.com/us/app/toddler-trainer/id419472791?mt=8"><img src="/wp-content/uploads/2011/02/todder-iphone-app.png" /></a></p>
<p>The app features over 200 individual objects, all accompanied with voice over.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ballyhooblog.com/kids-iphone-app/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Realistic CSS3 Box Shadows</title>
		<link>http://www.ballyhooblog.com/realistic-css3-box-shadows/</link>
		<comments>http://www.ballyhooblog.com/realistic-css3-box-shadows/#comments</comments>
		<pubDate>Thu, 04 Nov 2010 02:05:28 +0000</pubDate>
		<dc:creator>Ballyhoo Blog</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.ballyhooblog.com/?p=59</guid>
		<description><![CDATA[Update: Here is a working demo Want to learn how to create the sexiest most real looking box shadows using pure CSS? Then I&#8217;ve got a trick for you. The standard Box Shadow that you can apply via CSS3 to a box is rather bland. It may look something like this. Note: If you like [...]]]></description>
			<content:encoded><![CDATA[<p>Update: <a href='http://www.ballyhooblog.com/wp-content/uploads/2010/11/sexy-css-box-shadows.html'>Here is a working demo</a></p>
<p>Want to learn how to create the sexiest most real looking box shadows using pure CSS?  Then I&#8217;ve got a trick for you.  The standard Box Shadow that you can apply via CSS3 to a box is rather bland.  It may look something like this.</p>
<p><span style="color:red;">Note: If you like this effect, please link to my post, don&#8217;t steal! Thanks.</span></p>
<div id="attachment_67" class="wp-caption alignnone" style="width: 365px"><a href="http://www.ballyhooblog.com/wp-content/uploads/2010/11/Screen-shot-2010-11-03-at-7.06.10-PM.png"><img src="http://www.ballyhooblog.com/wp-content/uploads/2010/11/Screen-shot-2010-11-03-at-7.06.10-PM.png" alt="boring shadows" title="Boring Shadows" width="355" height="353" class="size-full wp-image-67" /></a><p class="wp-caption-text">Boring Shadows</p></div>
<p>It is nice and all, and a nice leap from having to do shadows with png background images and such, but it doesn&#8217;t quite cut it for me.  So with a few tricks, and some magic.  We&#8217;ll be creating this.</p>
<div id="attachment_66" class="wp-caption alignnone" style="width: 358px"><a href="http://www.ballyhooblog.com/wp-content/uploads/2010/11/Screen-shot-2010-11-03-at-7.02.23-PM.png"><img src="http://www.ballyhooblog.com/wp-content/uploads/2010/11/Screen-shot-2010-11-03-at-7.02.23-PM.png" alt="Sexy CSS Box Shadow" title="Sexy CSS Box Shadow" width="348" height="349" class="size-full wp-image-66" /></a><p class="wp-caption-text">Sexy CSS Box Shadow</p></div>
<p>It gives the effect that the page is &#8220;curling&#8221; or lifting off of the page.  This effect is achieved with <strong>PURE CSS</strong> and <strong>ONE single &lt;div&gt; </strong> tag!</p>
<h2>Let&#8217;s get started.</h2>
<p>The first thing we will need to do is set up our HTML.  It is as basic as it gets folks.</p>
<h3>Step 1</h3>
<p>Simply create the following in your HTML document.</p>
<pre class="brush:php">
<div id="box">
       Text Here
</div>
</pre>
<p>Now that we have our Box in place, we can do the fancy stuff in CSS.  We&#8217;ll be using CSS gradients, CSS Box Shadows, and CSS Text Shadows, but the actual trick, or effect comes into play with several &#8220;experminetal&#8221; css features.  Namely: <strong>-transform [rotate,skew] </strong> and the Pseudo selectors <strong>:before and :after</strong>.  We also throw in some z-index, and other goodies, but my particular effect (which I think I am the first to create) uses SKEW to make it all work.</p>
<h2>The CSS Stuff</h2>
<p>We need to set up our div via CSS with some basic styles.  The following code, sets up our box, gives us a gradient background,  gives our box an initial shadow, makes our entire page background gray, and centers our box on screen.</p>
<p><span style="color:red;">NOTE:  I&#8217;ve only included the -webkit prefixes which will work on Safari, and Chrome.  If you&#8217;re working in Firefox, please prefix accordingly.  If you have no idea what I&#8217;m talking about, then you ought to learn about <a href="http://www.alistapart.com/articles/prefix-or-posthack/" target="_blank">css prefixes </a> first.</span>  Also check out <a href="http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-getting-clever-with-css3-shadows/" target="_blank">Jeffery&#8217;s screencast</a> at NETTUTS for a different sort of shadow but uses some of the same principles.</p>
<h3>Step 2</h3>
<pre class="brush:php">
body{
	background-color:#ddd;
}

#box{
	width:300px;
	height:300px;
	margin:50px auto;
	position:relative;
	background: -webkit-gradient(linear, 0 0, 0 100%, from(#fefbb0), to(#fff955));
       -webkit-box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.4);
}
</pre>
<p>Here is what it should look like.</p>
<div id="attachment_68" class="wp-caption alignnone" style="width: 373px"><a href="http://www.ballyhooblog.com/wp-content/uploads/2010/11/Screen-shot-2010-11-03-at-7.21.30-PM.png"><img src="http://www.ballyhooblog.com/wp-content/uploads/2010/11/Screen-shot-2010-11-03-at-7.21.30-PM.png" alt="box with Gradient" title="Simple Box" width="363" height="351" class="size-full wp-image-68" /></a><p class="wp-caption-text">Simple Box, with CSS shadow and CSS Gradient Background</p></div>
<h3>Step 3</h3>
<p>Next we need to add the pseudo selector of :before and :after, which are sort of like &#8220;layers&#8221; of our box.  This allows us to create new shadows and rotate and skew those &#8220;layers&#8221; separate from our original box.  Thus allowing for nifty shadows.  Here is the CSS.</p>
<pre class="brush:php">
#box:after{
	-webkit-box-shadow: 8px 12px 10px rgba(0, 0, 0, 0.7);
    position:absolute;
	content:'';
	background:transparent;
	bottom:10px;
	right:9px;
	width:70%;
	height:70%;
    -webkit-transform: rotate(5deg)
					   skew(10deg);
}
</pre>
<p>This takes advantage of the :after selector.  We create another box shadow on our new &#8220;layer&#8221; make its background transparent, rotate it, and skew it, then use css positioning to move it to the bottom right of our original box.</p>
<p>This is what things should look like.</p>
<div id="attachment_69" class="wp-caption alignnone" style="width: 359px"><a href="http://www.ballyhooblog.com/wp-content/uploads/2010/11/Screen-shot-2010-11-03-at-7.28.54-PM.png"><img src="http://www.ballyhooblog.com/wp-content/uploads/2010/11/Screen-shot-2010-11-03-at-7.28.54-PM.png" alt="Box Shadow, skewed rotated" title="Box Shadow on Top" width="349" height="354" class="size-full wp-image-69" /></a><p class="wp-caption-text">:after box shadow: rotated, skewed, and positioned.</p></div>
<p>I am going to leave the shadow in &#8220;front&#8221; of our box, so you can see how my magic skew comes into play, to create the more realistic shadow.</p>
<h3>Step 4</h3>
<p>Next we do almost the same thing, except we use the &#8220;:before&#8221; pseudo selector, and skew our box at a different angle, and make its shadow &#8220;WHITE&#8221;.  <em>This is the important part, to sell the effect.</em></p>
<p>Here is the CSS</p>
<pre class="brush:php">
#box:before{
	-webkit-box-shadow: 11px 11px 32px rgba(255, 255, 255, 0.7);
    position:absolute;
	content:'';
	background:transparent;
	bottom:46px;
	right:41px;
	width:50%;
	height:50%;
    -webkit-transform: rotate(20deg)
					   skew(45deg);

}
</pre>
<p>This is what it should look like.  You should now be able to see the &#8220;ah-hah&#8221; of what i&#8217;m getting at.</p>
<div id="attachment_70" class="wp-caption alignnone" style="width: 357px"><a href="http://www.ballyhooblog.com/wp-content/uploads/2010/11/Screen-shot-2010-11-03-at-7.32.21-PM.png"><img src="http://www.ballyhooblog.com/wp-content/uploads/2010/11/Screen-shot-2010-11-03-at-7.32.21-PM.png" alt="both css box shadows" title="Both Shadows" width="347" height="353" class="size-full wp-image-70" /></a><p class="wp-caption-text">Boths CSS Shadows, one white, one black</p></div>
<h3>Step 5</h3>
<p>The last thing we do is add the z-index to our before and after selectors to move the shadows behind the box, not in front.</p>
<p>Give your :before selector a z-index of -1, and your :after a z-index of -2;</p>
<p>Before</p>
<pre class="brush:php">
	z-index:-1;
</pre>
<p>After</p>
<pre class="php>
	z-index:-2;
</pre>
<p>The last thing I did was add some CSS to &#8220;fancify&#8221; the words inside of the box.  Specifically I did this:</p>
<pre class="brush:php">
        font-family:Arial;
	font-size:3em;
	color:#fffb9b;
	text-align:center;
	text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.6),
				-1px -1px 1px rgba(0, 0, 0, 0.4);
</pre>
<p>And that&#8217;s it!  This only opens up some of the possibilities of the shadows!  By nesting another div or image in our original box we could open up a whole other dimension of fancy shadows and potentially create complex shadows on both sides of the box.</p>
<p>By varying the degree of &#8220;blur&#8221; in the shadows we can create different levels of depth for sharp or soft shadows.  Link to me, as I appreciate the juice.</p>
<div id="attachment_66" class="wp-caption alignnone" style="width: 358px"><a href="http://www.ballyhooblog.com/wp-content/uploads/2010/11/Screen-shot-2010-11-03-at-7.02.23-PM.png"><img src="http://www.ballyhooblog.com/wp-content/uploads/2010/11/Screen-shot-2010-11-03-at-7.02.23-PM.png" alt="Sexy CSS Box Shadow" title="Sexy CSS Box Shadow" width="348" height="349" class="size-full wp-image-66" /></a><p class="wp-caption-text">Sexy CSS Box Shadow</p></div>
<p>Andrew</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ballyhooblog.com/realistic-css3-box-shadows/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>Add custom post types to wordpress main feed</title>
		<link>http://www.ballyhooblog.com/add-custom-post-types-wordpress-main-feed/</link>
		<comments>http://www.ballyhooblog.com/add-custom-post-types-wordpress-main-feed/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 23:56:01 +0000</pubDate>
		<dc:creator>Ballyhoo Blog</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[add]]></category>
		<category><![CDATA[custom post types]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[main feed]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.ballyhooblog.com/?p=52</guid>
		<description><![CDATA[Background I wanted my custom post types that I created in my last writeup (custom post types with archive page) to appear in my wordpress main feed. By default the custom post types do not get added to the main feed that wordpress creates. In my last write up I showed how I added the [...]]]></description>
			<content:encoded><![CDATA[<h2>Background</h2>
<p>I wanted my custom post types that I created in my last writeup (<a href="/custom-post-types-wordpress-30-with-template-archives/">custom post types with archive page</a>) to appear in my wordpress main feed.  By default the custom post types do not get added to the main feed that wordpress creates.  In my last write up I showed how I added the necessary rewrite rules in order to have the structure: www.domain.com/custom-p-type/feed.  This will create a feed with all of those custom post types.  Perfect. But what about my &#8220;main&#8221; wordpress feed?</p>
<h2>What I wanted</h2>
<p>What I wanted is for my www.domain.com/feed to include ALL of my sites content.  Be it posts, or custom post types that I create.  There are a couple of methods I found for doing this.  I finally found the solution on the track in this ticket. http://core.trac.wordpress.org/ticket/12943</p>
<h2>The solution</h2>
<p>Here is what will add your custom post type content to your sites main feed, and leave your regular custom post type feeds specific for their respective content&#8230;</p>
<pre class="brush:php">
function myfeed_request($qv) {
	if (isset($qv['feed']) &#038;&#038; !isset($qv['post_type']))
		$qv['post_type'] = get_post_types($args = array(
	  		'public'   => true,
	  		'_builtin' => false
		));
		array_push($qv['post_type'],'post');
		return $qv;
}
add_filter('request', 'myfeed_request');
</pre>
<h2>The explanation</h2>
<p>Thats it! Done.  This code checks to see if the query var &#8216;feed&#8217; exists, if it does it also checks to see if the &#8216;post_type&#8217; query var IS NOT set.  If the post_type query var is set, this means we are on one of our regular custom post type pages, and we don&#8217;t want to modify the way the feeds are genereated, as wordpress handles them out of the box.</p>
<p>So, if we are on a &#8220;feed&#8221; page, and we don&#8217;t have a post_type query var set, we must be on the home page feed (in my case).  So we modify the default feed by querying for all custom post types that are not built in, and that are public using the get_post_types() function.   We then append the &#8220;post&#8221; post type to the end with array_push, because I wanted my main feed to include all my custom post type content, as well as my regular post content.</p>
<p>Now I have the structure: mydomain.com/feed/  Which houses all of my sites published content, and each custom post type has its respective feed at mydomain.com/custom-p-type/feed/</p>
<p>Thingabeauty.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ballyhooblog.com/add-custom-post-types-wordpress-main-feed/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Custom Post Types WordPress 3.0 with template archives</title>
		<link>http://www.ballyhooblog.com/custom-post-types-wordpress-30-with-template-archives/</link>
		<comments>http://www.ballyhooblog.com/custom-post-types-wordpress-30-with-template-archives/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 01:41:44 +0000</pubDate>
		<dc:creator>Ballyhoo Blog</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[3.0]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[cms]]></category>
		<category><![CDATA[custom post types]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.ballyhooblog.com/?p=37</guid>
		<description><![CDATA[UPDATE: As of WP 3.1, custom post types archive pages are built in! (No doubt in response to this an other similar posts&#8230;) You just need to set the new &#8216;has_archive&#8217; parameter to &#8216;true&#8217; when registering the post type. I&#8217;ve been playing around with the latest nightly betas of wordpress 3.0, especially the custom post [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE:  As of WP 3.1, custom post types archive pages are built in!  (No doubt in response to this an other similar posts&#8230;)  You just need to set the new <em>&#8216;has_archive&#8217;</em> parameter to <em>&#8216;true&#8217;</em> when registering the post type.</strong></p>
<p>I&#8217;ve been playing around with the latest nightly betas of wordpress 3.0, especially the custom post type feature.  It looks great for what I want to do, but doesn&#8217;t exactly seem &#8220;ready&#8221;.  I&#8217;ve read various blogs and posts about custom post types trying to get a grips on making this lovely little feature do what I want.  Namely <a href="http://kovshenin.com/archives/extending-custom-post-types-in-wordpress-3-0/" target="_blank">http://kovshenin.com/archives/extending-custom-post-types-in-wordpress-3-0/</a> and WordPress Codex, and this plugin <a href="http://wordpress.org/extend/plugins/cms-press/" target="_blank">http://wordpress.org/extend/plugins/cms-press/</a></p>
<p>I tried reading various tutorials on the web, and nothing really did what I wanted, so I&#8217;ve decided to make my own <strong>tutorial on how to create custom post types in wordpress 3.0 with archive pages</strong>.</p>
<p>The code within the plugin was finally what got me what I wanted.  So if your looking how to use custom post types in WordPress 3.0 and want to have your own archive template file with each of your custom post types then this post is for you.  I really JUST started to look into themeing and code in WordPress, so much of my work is borrowed from the sources listed about, and may not be the optimal way of doing things.  If you know of better/other ways to accomplish this, please pipe up in the comments, we&#8217;re all friends here.  I&#8217;ll try and explain the steps in detail so noobs like myself can follow along.</p>
<p>Here is what I wanted:</p>
<ol>
<li>A custom post type, we&#8217;ll say called &#8220;stories&#8221; that allows me to add stories in the wordpress backend.</li>
<li>The URL of that custom post type to be an &#8220;archive&#8221; page of all the stories e.g. (www.domain.com/stories/)</li>
<li>Each story to have its own structure like so (www.domain.com/stories/my-first-story/)</li>
</ol>
<p>WordPress does numbers 1 and 3 automatically for you after you register the custom post type in your themes &#8220;functions.php&#8221; file.  This is done like so:</p>
<h2>1st &#8211; Register the new Custom Post Type with wordpress</h2>
<pre class="brush:php">
register_post_type('stories', array(
	'label' =&gt; __('Stories'),
	'singular_label' =&gt; __('Story'),
	'public' =&gt; true, // Allows it to be publicly queryable
	'show_ui' =&gt; true, // Displays the post time in the Admin Interface
	'_builtin' =&gt; false,
	'_edit_link' =&gt; 'post.php?post=%d',
	'capability_type' =&gt; 'post',
	'hierarchical' =&gt; false,
	'rewrite' =&gt; array("slug" =&gt; "stories"), // the slug for permalinks
	'supports' =&gt; array('title','editor','author','custom-fields') // What can this post type do
));
</pre>
<p>The code above will create a new link in your admin area where you can add the custom post type.  If you don&#8217;t believe it, go ahead and add it to your functions.php file and check it out!</p>
<p>Number 2 turned out to be a LOT more tricky than I initially believed.  Before I get to the solution that worked for me, I&#8217;ll give a bit of background.</p>
<p>When you register a new custom post type in wordpress 3.0 it automatically creates rewrite rules for that post type.  (Which is what makes domain.com/stories/my-cool-story/) possible.  It doesn&#8217;t create any rewrite rules which would allow for (domain.com/stories/) to show an archive page.  If you tried to type that in, you would get a 404 not found.</p>
<p>The default rewrite rules that wordpress creates for your custom post types is like so:</p>
<pre class="brush:php">
[stories/[^/]+/attachment/([^/]+)/?$] =&gt; index.php?attachment=$matches[1]
[stories/[^/]+/attachment/([^/]+)/trackback/?$] =&gt; index.php?attachment=$matches[1]&amp;tb=1
[stories/[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] =&gt; index.php?attachment=$matches[1]&amp;feed=$matches[2]
[stories/[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] =&gt; index.php?attachment=$matches[1]&amp;feed=$matches[2]
[stories/[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$] =&gt; index.php?attachment=$matches[1]&amp;cpage=$matches[2]
[stories/([^/]+)/trackback/?$] =&gt; index.php?stories=$matches[1]&amp;tb=1
[stories/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] =&gt; index.php?stories=$matches[1]&amp;feed=$matches[2]
[stories/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] =&gt; index.php?stories=$matches[1]&amp;feed=$matches[2]
[stories/([^/]+)/page/?([0-9]{1,})/?$] =&gt; index.php?stories=$matches[1]&amp;paged=$matches[2]
[stories/([^/]+)(/[0-9]+)?/?$] =&gt; index.php?stories=$matches[1]&amp;page=$matches[2]
[stories/[^/]+/([^/]+)/?$] =&gt; index.php?attachment=$matches[1]
[stories/[^/]+/([^/]+)/trackback/?$] =&gt; index.php?attachment=$matches[1]&amp;tb=1
[stories/[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$] =&gt; index.php?attachment=$matches[1]&amp;feed=$matches[2]
[stories/[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$] =&gt; index.php?attachment=$matches[1]&amp;feed=$matches[2]
[stories/[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$] =&gt; index.php?attachment=$matches[1]&amp;cpage=$matches[2]
</pre>
<p>The current WordPress beta has the logic built into the templating system to look for a file called single-(custom-post-type).php for the custom post types &#8220;singular&#8221; pages.  So in my case the url (domain.com/stories/my-cool-story/) would be looking for a template file called &#8220;single-stories.php&#8221; in my themes folder.  If that file doesn&#8217;t exists it will use the regular single file, or eventually fall back on the &#8220;index.php&#8221; file.  Depends on how your theme is set up.</p>
<p>So the problem is that first, there are no rewrite rules for /stories/ to work.  Second, there is no logic to re-direct /stories/ to a template file which would show an &#8220;archive&#8221; of my stories.</p>
<p>The Solution.</p>
<h2>2nd &#8211; Add new rewrite rules</h2>
<p>After you&#8217;ve registered your custom post type, like I showed earlier in this post, we have to set up some re-write rules for our new shiny post type.  This is done like so.</p>
<pre class="brush:php">

add_new_rules();
function add_new_rules(){

	global $wp_rewrite;

	$rewrite_rules = $wp_rewrite-&gt;generate_rewrite_rules('stories/');
	$rewrite_rules['test/?$'] = 'index.php?paged=1';

	foreach($rewrite_rules as $regex =&gt; $redirect)
	{
		if(strpos($redirect, 'attachment=') === false)
			{
				$redirect .= '&amp;post_type=stories';
			}
		if(0 &lt; preg_match_all('@\$([0-9])@', $redirect, $matches))
			{
				for($i = 0; $i &lt; count($matches[0]); $i++)
				{
					$redirect = str_replace($matches[0][$i], '$matches['.$matches[1][$i].']', $redirect);
				}
			}
		$wp_rewrite-&gt;add_rule($regex, $redirect, 'top');
	}

}
</pre>
<p>This bit of code I mostly took from the CMS Press plugin mentioned above.  Check it out, it&#8217;s pretty sweet.</p>
<p>Which should produce the following NEW rewrite rules which are added to our already default rules that WordPress supplies us.  For a total of 19 rules/ custom post type.  (Someone could possibly speak to how many rules would be &#8220;acceptable&#8221; for a medium sized website in production, as I&#8217;m not really sure what constitutes &#8220;to many&#8221; rewrite rules when it comes to performance in WP&#8230;)</p>
<pre class="brush:php">
[stories/feed/(feed|rdf|rss|rss2|atom)/?$] =&gt; index.php?&amp;feed=$matches[1]&amp;post_type=stories
[stories/(feed|rdf|rss|rss2|atom)/?$] =&gt; index.php?&amp;feed=$matches[1]&amp;post_type=stories
[stories/page/?([0-9]{1,})/?$] =&gt; index.php?&amp;paged=$matches[1]&amp;post_type=stories
[stories/?$] =&gt; index.php?paged=1&amp;post_type=stories
</pre>
<p>Notice that we added  the variable &#8220;post_type=stories&#8221; to each of our url&#8217;s that we rewrote.  This will allow us to redirect to our custom template in the next step.</p>
<p>Note: I&#8217;m not sure really where to hook this function so that it doesn&#8217;t make rewrite rules on each page load.  Really we only need to write the rules each time the permastructure changes, or we add a new post type, but I&#8217;m not sure how/where to do that.. Any ideas?</p>
<p>If your having troubles getting that rewrite rule to work, go and re-update your permalinks settings page.</p>
<h2>3rd &#8211; Redirect requests on our new rules to our custom template files</h2>
<p>So now we are going to add a hook into the system to over-ride the default templating system, because as mentioned in the background info section, wordpress doesn&#8217;t have this built in.</p>
<p>We essentially are checking to see if the variable &#8220;post_type=stories&#8221; exists in our query vars.  If it does, then we set up the feeds and trackbacks stuff that wordpress does, and we redirect to one of two theme files.</p>
<p>If the &#8220;name&#8221; variable isn&#8217;t in our query vars, then obviously the query is for the archive page, as the name variable only appears when we are requesting a single post.  So we redirect to a template file called &#8220;single-stories.php&#8221; if the name file does exists, (which is what wordpress would have done normally) and we re-direct to a template file called &#8220;single.php&#8221; if the name variable doesn&#8217;t exist.</p>
<p>Here&#8217;s my code:</p>
<pre class="brush:php">

	add_action("template_redirect",'template_redirect');
	function template_redirect()
	{
		global $wp;

		$muley_custom_types = array("stories");

		if (in_array($wp->query_vars["post_type"], $muley_custom_types))
		{
			if ( is_robots() ) :
				do_action('do_robots');
				return;
			elseif ( is_feed() ) :
				do_feed();
				return;
			elseif ( is_trackback() ) :
				include( ABSPATH . 'wp-trackback.php' );
				return;
			elseif($wp->query_vars["name"]):
				include(TEMPLATEPATH . "/single-".$wp->query_vars["post_type"].".php");
				die();
			else:
				include(TEMPLATEPATH . "/".$wp->query_vars["post_type"].".php");
				die();
			endif;

		}
	}
</pre>
<p>That way I can have custom 2 separate custom template files (post-type.php, and post-type-single) for each of my custom post types.</p>
<p>You would need to do that code for each of your custom post types, or write a little function to loop through an array of your custom post types and set them up automatically.</p>
<p>It would be nice if I could query wordpress for my custom post types and have it all be dynamic, but I haven&#8217;t looked into seeing if wordpress stores the custom post types in the DB.??</p>
<p>Anyway, that should get you started on hacking around with Custom Post Types.  I think that this should be the DEFAULT way that wordpress handles custom post types.  It seems to me logically that almost everyone is trying to do this by default with their wordpress installations that are running more &#8220;CMS&#8221; style instead of &#8220;blog&#8221; style.  Previously most everyone did this same sort of structure with categories and such with the Posts, but this way is much more organized if you ask me.</p>
<p>You can also add custom taxonomies (categories) for each of your custom post types should you so be inclined.  i.e. stories could be divided into fishing stories, hunting stories, hiking stories, etc.  however, we are focusing solely on post types in this tutorial.</p>
<p>Things to note:</p>
<p>-The title tags for your custom post type archives page won&#8217;t work.  I haven&#8217;t looked into how to fix this yet, as I have no idea how wordpress does titles, let alone for custom post types and custom rewrite rules.??  Any insights would be helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ballyhooblog.com/custom-post-types-wordpress-30-with-template-archives/feed/</wfw:commentRss>
		<slash:comments>40</slash:comments>
		</item>
		<item>
		<title>Top 5 Best Professional Digital Cameras</title>
		<link>http://www.ballyhooblog.com/top-5-best-professional-digital-cameras/</link>
		<comments>http://www.ballyhooblog.com/top-5-best-professional-digital-cameras/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 05:12:28 +0000</pubDate>
		<dc:creator>Ballyhoo Blog</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.ballyhooblog.com/top-5-best-professional-digital-cameras/</guid>
		<description><![CDATA[So I&#8217;ve been getting into photography lately, and have just recently purchased a entry-level-pro camera. I did extensive research on multiple sites trying to figure out what camera would give me the best bang for the buck. These 5 cameras here are obviously not the most expensive and feature packed, but excellent digital cameras for [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve been getting into photography lately, and have just recently purchased a entry-level-pro camera.  I did extensive research on multiple sites trying to figure out what camera would give me the best bang for the buck.</p>
<p>These 5 cameras here are obviously not the most <a href="http://www.amazon.com/Canon-EOS-5D-Digital-Camera/dp/B0007Y791C">expensive</a> and feature packed, but excellent <b>digital cameras for under a $1000 dollars</b>.</p>
<p>My first choice is a camera that I bought from newegg for $799.00 a week ago.  Now it&#8217;s <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16830113067R">$725!</a></p>
<p>1. Nikon D80 &#8211; info from <a href="http://www.dpreview.com/reviews/specs/Nikon/nikon_d80.asp">dpreview.com</a></p>
<p>2. Canon  400d (Digital Rebel xti) &#8211; <a href="http://www.dpreview.com/reviews/specs/Canon/canon_eos400d.asp">info</a></p>
<p>3. Pentax k10d <a href="http://www.dpreview.com/reviews/specs/Pentax/pentax_k10d.asp">info</a></p>
<p>4. Nikon d40x <a href="http://www.dpreview.com/reviews/specs/Nikon/nikon_d40x.asp">info</a></p>
<p>5. Canon eos30D <a href="http://www.dpreview.com/reviews/specs/Canon/canon_eos30d.asp?dontcount=1">info</a></p>
<p>Remember that it&#8217;s not the camera thats going to take the perfect photo, but the photographer.  If your budget is tight, go with the nikon d40x, or the canon Digital Rebel, and spend the extra money you would have spent on a more expensive body on a more expensive lens.  </p>
<p>Remember: A high quality lens and cheap body will take much better pictures than a cheap lens with a high quality body.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ballyhooblog.com/top-5-best-professional-digital-cameras/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google&#8217;s definition for &#8220;digg clone site&#8221; is netscape.com</title>
		<link>http://www.ballyhooblog.com/googles-definition-for-digg-clone-site-is-netscapecom/</link>
		<comments>http://www.ballyhooblog.com/googles-definition-for-digg-clone-site-is-netscapecom/#comments</comments>
		<pubDate>Fri, 26 Jan 2007 17:48:24 +0000</pubDate>
		<dc:creator>Ballyhoo Blog</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.ballyhooblog.com/googles-definition-for-digg-clone-site-is-netscapecom/</guid>
		<description><![CDATA[So I was rather curious on how some of the ajax programming was done on the popular digg.com. I did a simple &#8220;how to make a digg clone site&#8221; on google to find out if there was a related tutorial on how to make a voting system. The first result made me laugh. beta.netscape.com Just [...]]]></description>
			<content:encoded><![CDATA[<p>So I was rather curious on how some of the ajax programming was done on the popular <a href="http://www.digg.com">digg.com</a>.  I did a simple &#8220;how to make a digg clone site&#8221; on google to find out if there was a related tutorial on how to make a voting system.  The first result made me laugh.</p>
<p>beta.netscape.com</p>
<p>Just goes to show the power of keywords and how they relate to SERP&#8217;s. Go ahead, try it, it&#8217;s funny.</p>
<p>This anomily is knows as <a href="http://en.wikipedia.org/wiki/Google_bomb">Google Bombing</a>.  A famous example is the search for  &#8220;<a title="Miserable failure" href="http://en.wikipedia.org/wiki/Miserable_failure">miserable failure</a>,&#8221; which turned up George Bushes name.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ballyhooblog.com/googles-definition-for-digg-clone-site-is-netscapecom/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

