<?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>Matthew Price</title>
	<atom:link href="http://matthewaprice.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://matthewaprice.com</link>
	<description>all code on deck</description>
	<lastBuildDate>Tue, 08 May 2012 18:11:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Community Funded</title>
		<link>http://matthewaprice.com/community-funded/</link>
		<comments>http://matthewaprice.com/community-funded/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 21:40:26 +0000</pubDate>
		<dc:creator>Matthew Price</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[crowd source]]></category>
		<category><![CDATA[funding]]></category>

		<guid isPermaLink="false">http://matthewaprice.com/?p=1317</guid>
		<description><![CDATA[<p>So I have been working on a project that has become my main focus.  I am really proud to be the developer for <a href="http://www.communityfunded.com">www.communityfunded.com</a>.  We currently have a splash page up that allows the public to register as a user.  </p>
<p>Here is a brief summary of the project:</p>
<p><em>Community Funded will connect people, ideas and resources in historic new ways, empowering our communities and promoting "grass-roots economic recovery." Anything’s possible when it’s Community Funded.</em></p>
<p>Please sign up to be a part of something really special.</p>
<p>Here is a link to our Facebook page with some more info and response from the public: <a href="https://www.facebook.com/CommunityFunded">https://www.facebook.com/CommunityFunded</a></p>
]]></description>
			<content:encoded><![CDATA[<p>So I have been working on a project that has become my main focus.  I am really proud to be the developer for <a href="http://www.communityfunded.com">www.communityfunded.com</a>.  We currently have a splash page up that allows the public to register as a user.  </p>
<p>Here is a brief summary of the project:</p>
<p><em>Community Funded will connect people, ideas and resources in historic new ways, empowering our communities and promoting &#8220;grass-roots economic recovery.&#8221; Anything’s possible when it’s Community Funded.</em></p>
<p>Please sign up to be a part of something really special.</p>
<p>Here is a link to our Facebook page with some more info and response from the public: <a href="https://www.facebook.com/CommunityFunded">https://www.facebook.com/CommunityFunded</a></p>
]]></content:encoded>
			<wfw:commentRss>http://matthewaprice.com/community-funded/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="" />	</item>
		<item>
		<title>Keep Users Based On Role Out of WP-ADMIN</title>
		<link>http://matthewaprice.com/keep-users-based-on-role-out-of-wp-admin/</link>
		<comments>http://matthewaprice.com/keep-users-based-on-role-out-of-wp-admin/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 14:36:11 +0000</pubDate>
		<dc:creator>Matthew Price</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[users]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://matthewaprice.com/?p=1303</guid>
		<description><![CDATA[<p>Here is a quick and dirty way to keep your users out of the WP-ADMIN area.  I have not found a good way to redirect a user from the wp-login.php page to a custom page and not profile.php. (anyone knows, please let me know : &#38;gt; ). I needed this as i had a front end system for users to manage their profiles.  That part needed to look like the regular theme and not like the admin area.</p>
]]></description>
			<content:encoded><![CDATA[<p>Here is a quick and dirty way to keep your users out of the WP-ADMIN area.  I have not found a good way to redirect a user from the wp-login.php page to a custom page and not profile.php. (anyone knows, please let me know : &gt; ). I needed this as i had a front end system for users to manage their profiles.  That part needed to look like the regular theme and not like the admin area.</p>
<p>This code can be placed in your theme&#8217;s functions.php or in a plugin.  You can replace &#8220;administrator&#8221; with any role that you choose.</p>
<pre class="brush:php">
function wp_admin_role_limiter() {
     if ( ( is_user_logged_in() ) &#038;&#038; ( preg_match( '/wp-admin/', $_SERVER['REQUEST_URI'] ) ) ) {
          if ( !current_user_can( 'administrator' ) ) {
	       header( 'Location: http://www.domain.com/custom-profile-page/' );
	  }
     }
}
add_action( 'admin_head', 'wp_admin_role_limiter' );
</pre>
]]></content:encoded>
			<wfw:commentRss>http://matthewaprice.com/keep-users-based-on-role-out-of-wp-admin/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	<enclosure url="" />	</item>
		<item>
		<title>Google Products Base Feed Parser</title>
		<link>http://matthewaprice.com/google-products-base-feed-parser/</link>
		<comments>http://matthewaprice.com/google-products-base-feed-parser/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 03:30:12 +0000</pubDate>
		<dc:creator>Matthew Price</dc:creator>
				<category><![CDATA[php classes]]></category>
		<category><![CDATA[base feed]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://matthewaprice.com/?p=1289</guid>
		<description><![CDATA[<p>Here is a simple Google base feed parser php class I wrote recently.  It lets you pick and choose which fields you would like to grab from the feed</p>
<p><a href="https://github.com/matthewaprice/Google-Base-Feed-Parser">https://github.com/matthewaprice/Google-Base-Feed-Parser</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Here is a simple Google base feed parser php class I wrote recently.  It lets you pick and choose which fields you would like to grab from the feed</p>
<p><a href="https://github.com/matthewaprice/Google-Base-Feed-Parser">https://github.com/matthewaprice/Google-Base-Feed-Parser</a></p>
]]></content:encoded>
			<wfw:commentRss>http://matthewaprice.com/google-products-base-feed-parser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="" />	</item>
		<item>
		<title>My First VideoPress Video</title>
		<link>http://matthewaprice.com/my-first-videopress-video/</link>
		<comments>http://matthewaprice.com/my-first-videopress-video/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 03:15:14 +0000</pubDate>
		<dc:creator>Matthew Price</dc:creator>
				<category><![CDATA[videos]]></category>

		<guid isPermaLink="false">http://matthewaprice.com/?p=1283</guid>
		<description><![CDATA[<p>so this is embarrassing, but worthy of a first video post</p>
<p>[wpvideo PhJUsA94]</p>
]]></description>
			<content:encoded><![CDATA[<p>so this is embarrassing, but worthy of a first video post</p>
<div id="v-PhJUsA94-1" class="video-player"><embed id="v-PhJUsA94-1-video" src="http://s0.videopress.com/player.swf?v=1.03&amp;guid=PhJUsA94&amp;isDynamicSeeking=true" type="application/x-shockwave-flash" width="950" height="712" title="Snowshoe snow dive" wmode="direct" seamlesstabbing="true" allowfullscreen="true" allowscriptaccess="always" overstretch="true"></embed></div>
]]></content:encoded>
			<wfw:commentRss>http://matthewaprice.com/my-first-videopress-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="" />	</item>
		<item>
		<title>Upload Image and Attach to WordPress Post from Template</title>
		<link>http://matthewaprice.com/upload-image-attach-to-wordpress-post-from-template/</link>
		<comments>http://matthewaprice.com/upload-image-attach-to-wordpress-post-from-template/#comments</comments>
		<pubDate>Sun, 30 Oct 2011 00:51:20 +0000</pubDate>
		<dc:creator>Matthew Price</dc:creator>
				<category><![CDATA[image gallery]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[front end]]></category>
		<category><![CDATA[media library]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://matthewaprice.com/?p=1060</guid>
		<description><![CDATA[Here is some handy code that allows you to upload image(s) from a form on the front end of your WordPress site and have it become attached to a specific post.  There is optional code that allows you to make the post the featured image (post thumbnail) as well.]]></description>
			<content:encoded><![CDATA[<p>Here is some handy code that allows you to upload image(s) from a form on the front end of your WordPress site and have it become attached to a specific post. There is optional code that allows you to make the post the featured image (post thumbnail) as well.</p>
<p>So for my example, let&#8217;s say that you want to have users add images to a specific post from the front end. For this demonstration, it can be a photo gallery that you want multiple users to be able to add to.</p>
<p>First things first, make a form in your template that will let the users choose multiple images to add to the post&#8217;s gallery.</p>
<pre class="brush:html">&lt;!-- you can place the upload script into your theme folder or in a plugin --&gt;
&lt;form action="/path/to/upload/script/upload.php" method="POST" enctype="multipart/form-data"&gt;
	&lt;input type="file" name="files[]" multiple&gt;
	&lt;!-- The following hidden field contains the post id for which you will be uploading images to --&gt;
	&lt;input type="hidden" name="post_id" value="100"&gt;
	&lt;input type="submit" class="btn" value="Start Upload »"&gt;
&lt;/form&gt;</pre>
<p>Now here is the contents of upload.php</p>
<pre class="brush:php">&lt;?php
// if you have this in a file you will need to load "wp-load.php" to get access to WP functions.  If you post to "self" with this code then WordPress is by default loaded
require $_SERVER['DOCUMENT_ROOT'] . "/wp-load.php";
// require two files that are included in the wp-admin but not on the front end.  These give you access to some special functions below.
require $_SERVER['DOCUMENT_ROOT'] . "/wp-admin/includes/file.php";
require $_SERVER['DOCUMENT_ROOT'] . "/wp-admin/includes/image.php";

// required for wp_handle_upload() to upload the file
$upload_overrides = array( 'test_form' =&gt; FALSE );

global $current_user;
get_currentuserinfo();
$logged_in_user = $current_user-&gt;ID;

// count how many files were uploaded
$count_files = count( $_FILES['files'] );

// load up a variable with the upload direcotry
$uploads = wp_upload_dir();

// foreach file uploaded do the upload
foreach ( range( 0, $count_files ) as $i ) {

	// create an array of the $_FILES for each file
	$file_array = array(
		'name' 		=&gt; $_FILES['files']['name'][$i],
		'type'		=&gt; $_FILES['files']['type'][$i],
		'tmp_name'	=&gt; $_FILES['files']['tmp_name'][$i],
		'error'		=&gt; $_FILES['files']['error'][$i],
		'size'		=&gt; $_FILES['files']['size'][$i],
	);

	// check to see if the file name is not empty
	if ( !empty( $file_array['name'] ) ) {

	 	// upload the file to the server
	    $uploaded_file = wp_handle_upload( $file_array, $upload_overrides );

		// checks the file type and stores in in a variable
	    $wp_filetype = wp_check_filetype( basename( $uploaded_file['file'] ), null );	

	    // set up the array of arguments for "wp_insert_post();"
	    $attachment = array(
	    	'post_mime_type' =&gt; $wp_filetype['type'],
	    	'post_title' =&gt; preg_replace('/\.[^.]+$/', '', basename( $uploaded_file['file'] ) ),
	    	'post_content' =&gt; '',
	    	'post_author' =&gt; $logged_in_user,
	    	'post_status' =&gt; 'inherit',
	    	'post_type' =&gt; 'attachment',
	    	'post_parent' =&gt; $_POST['post_id'],
	    	'guid' =&gt; $uploads['baseurl'] . '/' . $file_array['name']
	    );

	    // insert the attachment post type and get the ID
	    $attachment_id = wp_insert_post( $attachment );

		// generate the attachment metadata
		$attach_data = wp_generate_attachment_metadata( $attachment_id, $uploaded_file['file'] );

		// update the attachment metadata
		wp_update_attachment_metadata( $attachment_id,  $attach_data );

                // this is optional and only if you want to.  it is here for reference only.
                // you could set up a separate form to give a specific user the ability to change the post thumbnail
                // set_post_thumbnail( $_POST['post_id', $attachment_id );

	}
}
// setup redirect.  i used the referer so that i can say "file uploaded" in a div if the files query string variable is set.
header("Location: " . $_SERVER['HTTP_REFERER'] . "/?files=uploaded");
?&gt;</pre>
<p>Now automatically, any image uploaded to this form will be added to the gallery for this page/post. Depending upon your server&#8217;s limits for uploaded files, you will be limited to an amount of data that can be uploaded at once.</p>
]]></content:encoded>
			<wfw:commentRss>http://matthewaprice.com/upload-image-attach-to-wordpress-post-from-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://matthewaprice.com/assets/1320173204_07_note.png" />	</item>
		<item>
		<title>Collapsable Categories in Post Editor</title>
		<link>http://matthewaprice.com/collapsable-categories-in-post-editor/</link>
		<comments>http://matthewaprice.com/collapsable-categories-in-post-editor/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 03:52:33 +0000</pubDate>
		<dc:creator>Matthew Price</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[categories]]></category>
		<category><![CDATA[checkboxs]]></category>

		<guid isPermaLink="false">http://www.matthewaprice.com/?p=978</guid>
		<description><![CDATA[So you have a ton of categories and there are a lot of child categories at the list and the post editor has become unruly?  In order to change a posts' category or to add it to a new one the list is unmanageable.  Here is a jQuery code snippet that you can use to make the categories collapsable.  It removes the label functionality.  You cannot click on the name to select the item's checkbox, but it now allows you to click on the name to expand the categories.]]></description>
			<content:encoded><![CDATA[<p>So you have a ton of categories and there are a lot of child categories and the list in the post editor has become unruly? In order to change a posts&#8217; category or to add it to a new one the list is unmanageable. Here is a jQuery code snippet that you can use to make the categories collapsable. It removes the label functionality. You cannot click on the name to select the item&#8217;s checkbox, but it now allows you to click on the name to expand the categories.</p>
<p>You could definitely put this script into a js file and then enqueue it, but for the purposes of this demo, this works ok too.</p>
<p>Here is a demo video:  <span style="text-align:center; display: block;"><a href="http://matthewaprice.com/collapsable-categories-in-post-editor/"><img src="http://img.youtube.com/vi/TKMoOrQ-rQI/2.jpg" alt="" /></a></span></p>
<pre class="brush:php">function make_categories_selector_collapsable() {
?&gt;
&lt;script&gt;
jQuery(document).ready(function() {
	// first we need to hide the children to only see the top level categories
	jQuery('#categorychecklist ul.children').css('display','none');

	// This removes the label functionality as when we click the category name we do not necessarily want to select the item's checkbox, just want to expand the list
	jQuery('#categorychecklist label').each(function() {
		var labelHtml = jQuery(this).html();
		jQuery(this).replaceWith(labelHtml);
	});

	// we now want to grab each of the &gt;li&lt;'s so that we can use a click function
	jQuery('#categorychecklist li').each(function() {
		jQuery(this).click(function() {
		// so when the item is clicked it shows the sub categories
		jQuery(this).children().show();
	});
});

});
&lt;/script&gt;
&lt;?
}

add_action( 'admin_head' , 'make_categories_selector_collapsable' );</pre>
]]></content:encoded>
			<wfw:commentRss>http://matthewaprice.com/collapsable-categories-in-post-editor/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	<enclosure url="http://matthewaprice.com/assets/1313379998_view_tree.png" />	</item>
		<item>
		<title>Resize Image on the Fly to Fit in a Square Box</title>
		<link>http://matthewaprice.com/resize-image-on-the-fly-to-fit-in-a-square-box/</link>
		<comments>http://matthewaprice.com/resize-image-on-the-fly-to-fit-in-a-square-box/#comments</comments>
		<pubDate>Sun, 17 Jul 2011 16:48:08 +0000</pubDate>
		<dc:creator>Matthew Price</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[php classes]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[wordpress plugins]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[resize]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.matthewaprice.com/?p=949</guid>
		<description><![CDATA[This simple image class will allow you to get an image from your server to dynamically resize it and center it top/bottom and left/right in a square box.  If you have some images that are all good kb size but are a bit random in their dimensions, you can use this class to make them fit dynamically in a box.  It will make images that are larger than the bounds of the box smaller, but will not adjust the size of images that are smaller than then bounds.  That would make them blurry, so instead it just makes them centered in the box.

I am using this in a scenario where there are images that have been uploaded to the server that are very small 200x200 and rather large 1000x1200.  The size of my display box in this example is 400x400.  

Here is a demo: <a href="http://www.matthewaprice.com/image-resize-demo/">http://www.matthewaprice.com/image-resize-demo/</a>]]></description>
			<content:encoded><![CDATA[<p>This simple image class will allow you to get an image from your server or an external one to dynamically resize it and center it top/bottom and left/right in a square box.  If you have some images that are all good kb size but are a bit random in their dimensions, you can use this class to make them fit dynamically in a box.  It will make images that are larger than the bounds of the box smaller, but will not adjust the size of images that are smaller than then bounds.  That would make them blurry, so instead it just makes them centered in the box.</p>
<p>I am using this in a scenario where there are images that have been uploaded to the server that are very small 200&#215;200 and rather large 1000&#215;1200.  The size of my display box in this example is 400&#215;400.  </p>
<p>Here is a demo: <a href="http://www.matthewaprice.com/image-resize-demo/">http://www.matthewaprice.com/image-resize-demo/</a></p>
<p>Here is how you implement the class.</p>
<pre class="brush:php">
// this first line relies on the GD Image Library to get the image's dimensions
$size = getimagesize('/path/to/your/image.jpg'); // can be from root of server or http://...
$new_image = new ImageResizer('400'); // Set the size of the box that will house the images
$new_image-&gt;setOriginalImageWidth($size[0]); // Input the original image's height
$new_image-&gt;setOriginalImageHeight($size[1]);
// Output the new dimensions as an array.  The "margin-top" argument says that you also want to center the image top/bottom.  This dynamically creates a "margin-top" css rule based on the new height of the image. Without it, your image will just be centered left/right
$new_dimensions = $new_image-&gt;outputNewDimensions('margin-top');
</pre>
<p>Here is the HTML</p>
<pre class="brush:php">

&lt;div style="width: 400px; height: 400px;"&gt;
&lt;!-- You can create a css rule for this, but for the demo it is easier to show inline --&gt;
	&lt;!-- This div will center the image "left/right" and "top/bottom" --&gt;
	&lt;div style="text-align: center; margin-top: &lt;?php echo $new_dimensions['margin_top']; ?&gt;px;"&gt;
		&lt;!-- The style rules here are the new computed width and height of the image --&gt;
		&lt;img src="/path/to/your/image.jpg" style="width: &lt;?php echo $new_dimensions['width']; ?&gt;px; height: &lt;?php echo $new_dimensions['height']; ?&gt;px;"&gt;
	&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>And here is the class. I have used this with WordPress to access images not imported by WordPress that are on a different server.  So in this case it is a plugin.  You can definitely take just the class and use in your app as necessary.</p>
<pre class="brush:php">

&lt;?php
/*
Plugin Name: Image Resizer
Plugin URI: http://www.matthewaprice.com/resize-image-on-the-fly-to-fit-in-a-square-box/
Description: This plugin give you the ability to resize images on the fly to fit in a square fixed width/height box
Version: 1.0
Author: Matthew Price
Author URI: http://www.matthewaprice.com
License: GPL2
*/	

class ImageResizer {

        private $bounds;

	public function __construct($bounds) {

		$this-&gt;bounds = $bounds;

	}

	public function setOriginalImageWidth($width) {

		$this-&gt;original_width = $width;

	}	

	public function setOriginalImageHeight($height) {

		$this-&gt;original_height = $height;

	}	

	public function outputNewDimensions($margin = '') {

		if ( ($this-&gt;original_width &lt; $this-&gt;bounds) &#038;&#038; ($this-&gt;original_height &lt; $this-&gt;bounds) ) {
			// keep the original dimensions as the image is by default smaller than bounds
			$new_width = $this-&gt;original_width;
			$new_height = $this-&gt;original_height;
			$margin_top = ($this-&gt;bounds - $new_height) / 2;
		} else if ( ($this-&gt;original_width &gt; $this-&gt;bounds) &#038;&#038; ($this-&gt;original_width == $this-&gt;original_height) ) {
			// square image larger than bounds
			$ratio = $this-&gt;original_width / $this-&gt;bounds;
			$new_width = $this-&gt;bounds;
			$new_height = round($this-&gt;original_height / $ratio);
			$margin_top = ($this-&gt;bounds - $new_height) / 2;
		} else {
			// start resizing image to get new width and height
			if ($this-&gt;original_width &gt; $this-&gt;original_height) {
				// width is bigger than height
				$ratio = $this-&gt;original_width / $this-&gt;bounds;
				$new_width = $this-&gt;bounds;
				$new_height = round($this-&gt;original_height / $ratio);
				$margin_top = ($this-&gt;bounds - $new_height) / 2;
			} else if ($this-&gt;original_height &gt; $this-&gt;original_width) {
				// height is bigger than width
				$ratio = $this-&gt;original_height / $this-&gt;bounds;
				$new_height = $this-&gt;bounds;
				$new_width = round($this-&gt;original_width / $ratio);
				$margin_top = ($this-&gt;bounds - $new_height) / 2;
			}
		}

		$new_image_dimensions['width'] = $new_width;
		$new_image_dimensions['height'] = $new_height;
		if ($margin) { $new_image_dimensions['margin_top'] = $margin_top; }	

		return $new_image_dimensions;	

	}		

}
?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://matthewaprice.com/resize-image-on-the-fly-to-fit-in-a-square-box/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	<enclosure url="" />	</item>
		<item>
		<title>WordPressFeeder.com – Embed Your WordPress Feed Externally</title>
		<link>http://matthewaprice.com/wordpressfeeder-com-%e2%80%93-embed-your-wordpress-feed-externally/</link>
		<comments>http://matthewaprice.com/wordpressfeeder-com-%e2%80%93-embed-your-wordpress-feed-externally/#comments</comments>
		<pubDate>Sat, 25 Jun 2011 21:00:51 +0000</pubDate>
		<dc:creator>Matthew Price</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[embed]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[feed]]></category>

		<guid isPermaLink="false">http://www.matthewaprice.com/?p=911</guid>
		<description><![CDATA[<p>Introducing a new tool!  This site lets you create a snippet that you can embed or give to someone else to display your blog articles outside of your site.  I built this as there are some hosted shopping cart solutions where you cannot run PHP, and you cannot style elements in an iFrame not from your own site.  By creating <a href="http://www.wordpressfeeder.com" target="_blank">WordPressFeeder.com</a>, I got around both of these issues.  The generated code creates stylable elements on your external site.</p>
<p>Here is a demo of this in action <a href="http://www.matthewaprice.com/wordpress-feeder-demo/">view demo</a></p>
<p>Feel free to let me know any suggestions, feature requests, or issues you may have with this by commenting on this post.</p>
<p>The first step is to simply put in a link to your feed and choose from the following options:</p>
<ul>
<li>Article content character limit</li>
<li>You can choose what you want your article titles to be wrapped in: h1 ,h2, span, div, etc</li>
<li>How many posts do you want to show</li>
<li>Read more link customization.  You can pick from up to 9 options</li>
<li>and...Whether or not you want to display The Post Thumbnail</li>
</ul>
]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE May 8, 2012:<br />
The WordPress Feeder Tool is now on a dedicated machine!  No more shared hosting for this baby.  I am hoping to have more people use it, and I wanted to make sure that this tool would be available whenever needed.</strong></p>
<p>Introducing a new tool!  This site lets you create a snippet that you can embed or give to someone else to display your blog articles outside of your site.  I built this as there are some hosted shopping cart solutions where you cannot run PHP, and you cannot style elements in an iFrame not from your own site.  It would be great to use WordPress&#8217; great blogging capability and have the posts automatically fed to your shopping cart or other site.  </p>
<p>By creating <a href="http://www.wordpressfeeder.com" target="_blank">WordPressFeeder.com</a>, I got around both of these issues.  The generated code creates stylable elements on your external site.</p>
<p>Here is a simple demo of this in action <a href="http://www.matthewaprice.com/wordpress-feeder-demo/">view demo</a></p>
<p>Here is a more <a href="http://www.store-91e33.mybigcommerce.com/" target="_blank">complex implementation</a>.  This includes post thumbnails and category feeds.  The three &#8220;featured&#8221; sections on the bottom of the page are driven by WordPress posts with this technology.  As it generates &lt;ul&gt;s with a class on them, you can have multiple instances.  Just change the class name in the jQuery that is generated along with your css.  I currently work for a development firm where i installed this technology on one of their servers for them to use on their sites.</p>
<p>Feel free to let me know any suggestions, feature requests, or issues you may have with this by commenting on this post.</p>
<p>The first step is to simply put in a link to your feed (example feeds are on the site) and choose from the following options:</p>
<ul>
<li>Article content character limit</li>
<li>You can choose what you want your article titles to be wrapped in: h1 ,h2, span, div, etc</li>
<li>How many posts do you want to show</li>
<li>Read more link customization.  You can pick from up to 9 options</li>
<li>and&#8230;Whether or not you want to display The Post Thumbnail</li>
</ul>
<p>In order to use the post thumbnail (this assumes that your theme has them <a href="http://codex.wordpress.org/Function_Reference/the_post_thumbnail" target="_blank">enabled</a>), you need to add a function (provided on www.wordpressfeeder.com) to your theme&#8217;s functions.php as the_post_thumbnail() is not natively included by WordPress&#8217; RSS Feeds.</p>
<p>Once you generate the code, you get some javascript, css, and html to use.  The javascript goes either in your html &lt;head&gt; or in a scripts.js file for your site.  Note: this code requires jQuery right now.  Hopefully i will have an option soon to support other javascript frameworks and possibly framework independent.  But for now, it is only jQuery. </p>
<p>All you have to place in your html is:  &#8220;&lt;ul class=&#8221;wordpress-feeder&#8221;&gt;&lt;/ul&gt;&#8221;</p>
<p>The javascript dynamically fills the &lt;ul&gt; with &lt;li&gt;s for the number of posts you selected.  Every item in the &lt;ul&gt; gets wrapped in an element for easy styling with CSS.  Here is the standard CSS you can use with it:</p>
<pre class="brush:css">

.wordpress-feeder { } // the main ul that contains the feed
.wordpress-feeder li { } // this is the container for each article
.wordpress-feeder li  h2 { } // this will be what you chose on the options page
.wordpress-feeder li .pubdate { } // this is the container for the post date
.wordpress-feeder li .description { } // this is the container for the article text
.wordpress-feeder li .image { } // this is the container for the image.

// there is currently no customization for the date, so if you dont' want to use it, just "display:none;" on that element
</pre>
]]></content:encoded>
			<wfw:commentRss>http://matthewaprice.com/wordpressfeeder-com-%e2%80%93-embed-your-wordpress-feed-externally/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://matthewaprice.com/assets/wordpressfeeder-150x130.jpg" />	</item>
		<item>
		<title>Jquery Tabs Without Jquery UI</title>
		<link>http://matthewaprice.com/jquery-tabs-without-jquery-ui/</link>
		<comments>http://matthewaprice.com/jquery-tabs-without-jquery-ui/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 20:00:42 +0000</pubDate>
		<dc:creator>Matthew Price</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[tabs]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.matthewaprice.com/?p=890</guid>
		<description><![CDATA[<p>Here is a compact way to replicate jQuery UI tabs without the UI.  I wrote this code to account for unlimited tabs and to create dynamic "selected" class on the clicked item and removes the class when you click on another tab.  This lends itself to easier styling of the tabs as well.</p>
]]></description>
			<content:encoded><![CDATA[<p>Here is a compact way to replicate jQuery UI tabs without the UI.  I wrote this code to account for unlimited tabs and to create dynamic &#8220;selected&#8221; class on the clicked item and removes the class when you click on another tab.  This lends itself to easier styling of the tabs as well.  It also degrades to show all the content if javascript is disabled.  </p>
<p><a title="Jquery Tab Demo" href="http://www.matthewaprice.com/jquery-tab-demo/" target="_blank">View Demo</a></p>
<p>Here is the HTML Markup<br />
You can start any of the LIs with class=&#8221;selected&#8221; to have that tab start as the selected item.  The tab navigation is set up in the javascript.  This way, if javascript is disabled the tabs go away and all the content in the tabs is displayed.  Thanks to <a href="http://kylegeminden.com/" target="_blank">Kyle Geminden</a> for this.</p>
<pre class="brush:html">
&lt;div id="tabs-content"&gt;
	&lt;div id="tab-content-1"&gt;here is some content for tab 1&lt;/div&gt;
	&lt;div id="tab-content-2"&gt;here is some content for tab 2&lt;/div&gt;
	&lt;div id="tab-content-3"&gt;here is some content for tab 3&lt;/div&gt;
&lt;/div&gt;</pre>
<p>Here is the CSS<br />
You can change the last line here to match the LI that you want to display by default</p>
<pre class="brush:css">#tabs { margin: 0; padding: 0; list-style-type: none; overflow: hidden; }
#tabs li { cursor: pointer; float: left; margin: 5px; padding: 5px; background: #EFEFEF; }
#tabs li.selected { background: #888888; }
#tabs-content { clear: both; }
#tabs-content.js > div { display: none; }
#tabs-content.js > #tab-content-1 { display: block; }</pre>
<p>Here is the Javascript/jQuery</p>
<pre class="brush:javascript">
$('#tabs-content').before('&lt;ul id="tabs"&gt;&lt;li id="tab-1" class="selected"&gt;Tab 1&lt;/li&gt;&lt;li id="tab-2"&gt;Tab 2&lt;/li&gt;&lt;li id="tab-3"&gt;Tab 3&lt;/li&gt;&lt;/ul&gt;');
$('#tabs-content').addClass('js');	

	$("#tabs li").each(function() {

		$(this).click(function() {
			var tabId = $(this).attr('id');
			var tabId = tabId.split('-');
			var tabContent = document.getElementById('tab-content-' + tabId[1]);
			tabContent.style.display = 'block';
			$(this).addClass('selected');
			$(this).siblings().removeClass('selected');
			$(tabContent).siblings().css('display','none');
		});

	});
</pre>
<h2>UPDATE &#8211; March 25. 2012</h2>
<p>So I have been asked to provide code that makes these tabs bookmarkable.  Well&#8230;here it is!<br />
In order to get these to be bookmarked, I make up a $_GET variable that is specific to these tabs.</p>
<p>So after the normal tab js code if you put this and the url is http://domain.com/?tab=1<br />
this will overwrite the tab function and highlight the one you want.</p>
<p>see:  <a href="http://matthewaprice.com/jquery-tab-demo/">View Revised Demo</a><br />
there are direct links on this page to the tabs</p>
<pre class="brush:js">
if ( getQueryString('tab') != '' ) {
        // get the value of the query string var called "tab"
	var tab = getQueryString('tab');
        // remove all the "selected" classes from the LIs
	$('#tabs li').each(function() { $(this).removeClass(); });
        // based off of the tab in the query string, readd the "selected" class back to the appropriate tab
	$('#tabs li#tab-' + tab).addClass('selected');
        // hide all of the content divs
	$('#tabs-content &gt; div').css({'display':'none'});
        // based off of the tab in the query string, make the selected tab visible
	$('#tabs-content #tab-content-' + tab).css({'display':'block'});
}
</pre>
<p>WHERE getQueryString(); is the function below</p>
<pre class="brush:php">
// http://www.bloggingdeveloper.com/post/JavaScript-QueryString-ParseGet-QueryString-with-Client-Side-JavaScript.aspx
function getQueryString(key, default_) {
	if (default_==null) default_="";
	key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	var regex = new RegExp("[\\?&#038;]"+key+"=([^&#]*)");
	var qs = regex.exec(window.location.href);
	if(qs == null)
		return default_;
	else
		return qs[1];
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://matthewaprice.com/jquery-tabs-without-jquery-ui/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	<enclosure url="" />	</item>
		<item>
		<title>Simple WordPress Accordion Menu</title>
		<link>http://matthewaprice.com/simple-wordpress-accordion-menu/</link>
		<comments>http://matthewaprice.com/simple-wordpress-accordion-menu/#comments</comments>
		<pubDate>Mon, 30 May 2011 17:21:06 +0000</pubDate>
		<dc:creator>Matthew Price</dc:creator>
				<category><![CDATA[menus]]></category>
		<category><![CDATA[accordion]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wp_nav_menu]]></category>

		<guid isPermaLink="false">http://www.matthewaprice.com/?p=862</guid>
		<description><![CDATA[So when WordPress introduced the wp_nav_menu() function, it made it easier to create navigation menus for the average user.  You can create dropdown navigation simply moving the items around in the admin -&#62; appearance -&#62; menu section of your dashboard.  This tutorial requires jQuery, but is not a jQuery plugin. ]]></description>
			<content:encoded><![CDATA[<p>So when WordPress introduced the wp_nav_menu() function, it made it easier to create navigation menus for the average user.  You can create dropdown navigation simply moving the items around in the admin -&gt; appearance -&gt; menu section of your dashboard.  This tutorial requires jQuery, but is not a jQuery plugin. </p>
<p>See live demo I installed at:  <a href="http://www.belocalnc.org" target="_blank">http://www.belocalnc.org</a>. For example, try clicking on &#8220;For Business&#8221; and then &#8220;Membership&#8221; and then on &#8220;For Community.&#8221;  The nav collapses appropriately and stays open to the last item clicked on the resulting page.</p>
<p>The code here is CSS and a few of jQuery that are effective and work well with the generated menus from wp_nav_menu().</p>
<p>First you must make sure that your current theme supports these types of menus.  Add this to your themes &#8220;functions.php&#8221; if it is not already there.</p>
<pre class="brush:php">
add_theme_support('menus');
register_nav_menus(
	array(
	  'primary_navigation' =&gt; 'Primary Navigation',
	  'utility_navigation' =&gt; 'Utility Navigation' // i like to set up a coupple at first in case i need them later
	)
);
</pre>
<p>Here is the html in your header.php</p>
<pre class="brush:html">

&lt;nav id="nav-main" role="navigation"&gt;
	&lt;?php wp_nav_menu(array('theme_location' =&gt; 'primary_navigation')); ?&gt;
&lt;/nav&gt;
</pre>
<p>Now here is the CSS for the nav</p>
<pre class="brush:css">
// Portions adapted from http://rootstheme.com
// The CSS here is slightly different from the live demo as i didn't include any of the images that are on the live site
#nav-main ul { list-style: none; margin: 0; padding :0; text-align: left; }
#nav-main ul a {
  display: block;
  text-decoration: none;
}
#nav-main ul li { display:inline-block; width: 100%;}
#nav-main ul li a {
	text-decoration:none;
	display:block;
	font-size:1.0em;
	padding: 10px 0px 10px 25px;
	color:#464646;
	margin: 0px 0px;
	border-top: 1px #a9aaa9 solid;
	letter-spacing: 1px;
}

#nav-main ul li a:hover { background: #ffffff; }
#nav-main ul li ul li a:hover { background: none; color: #0f6cb6; }
#nav-main ul li ul { position: relative; top: -2px; }

#nav-main ul ul li a { background: none; border: none; padding: 2px 0px 2px 0px; margin: 0 0 0 27px; }
#nav-main ul ul li ul { margin: 0 0 0 8px; }

ul.sub-menu li.current-menu-item  { color: #0f6cb6 !important; font-weight: bold; } 
</pre>
<p>Lastly, we can add this to either your themes &#8220;scripts.js&#8221; file, or just in your header.php</p>
<pre class="brush:javascript">
  // Portions of this were adapted from "http://www.i-marco.nl/weblog/jquery-accordion-menu/".
  // It only went one level deep.
  // This now accounts for more levels of accordion.

$(document).ready( function($) {

  // This hides all the sub menus on page load
  $('#nav-main ul.sub-menu').hide();
  // This makes sure that all the sub menus are open when applicable
  $('#nav-main li.current-menu-item').children().show();
  // This keeps the nav open to the item that you are navigating to.
  $('#nav-main li.current-menu-item').parents().show(); 

  $('#nav-main ul li a').click(
    function() {
      var checkElement = $(this).next();
      if((checkElement.is('ul')) &#038;&#038; (checkElement.is(':visible'))) {
        return false;
        }
      if((checkElement.is('ul')) &#038;&#038; (!checkElement.is(':visible'))) {
		$(this).parent().siblings("li:has(ul)").find("ul").slideUp('normal');
        $('#nav-main ul ul li ul:visible').slideUp('normal');
        checkElement.slideDown('normal');
        return false;
        }
      }
    );
  $('#nav-main ul ul li a').click(
    function() {
      var checkElement = $(this).next();
      if((checkElement.is('ul')) &#038;&#038; (checkElement.is(':visible'))) {
        return false;
        }
      if((checkElement.is('ul')) &#038;&#038; (!checkElement.is(':visible'))) {
        $('#nav-main ul ul').slideUp('normal');
        $('#nav-main ul ul li ul:visible').slideUp('normal');
        checkElement.slideDown('normal');
        return false;
        }
      }
    );	

});
</pre>
]]></content:encoded>
			<wfw:commentRss>http://matthewaprice.com/simple-wordpress-accordion-menu/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
	<enclosure url="http://matthewaprice.com/assets/accordion-menu1.png" />	</item>
	</channel>
</rss>

