<?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>jspr &#187; wordpress</title>
	<atom:link href="http://jspr.tndy.me/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://jspr.tndy.me</link>
	<description>buy a vowel</description>
	<lastBuildDate>Tue, 27 Jul 2010 15:44:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Custom Ordering of WordPress posts.</title>
		<link>http://jspr.tndy.me/2009/01/custom-ordering-of-wordpress-posts/</link>
		<comments>http://jspr.tndy.me/2009/01/custom-ordering-of-wordpress-posts/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 10:57:00 +0000</pubDate>
		<dc:creator>Jasper</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[post order]]></category>

		<guid isPermaLink="false">http://echohelloworld.com/?p=872</guid>
		<description><![CDATA[I seem to be becoming the go-to guy for WordPress in my circle of friends. I don&#8217;t mind&#8212;I&#8217;ve grown fond of pulling apart other people&#8217;s code, and the monster that WordPress is always makes that interesting. Last night, I was asked if I know how to order posts differently in The Loop. I don&#8217;t trust [...]]]></description>
			<content:encoded><![CDATA[<p>I seem to be becoming the go-to guy for <a href="http://wordpress.org">WordPress</a> in my circle of friends. I don&#8217;t mind&mdash;I&#8217;ve grown fond of pulling apart other people&#8217;s code, and the monster that WordPress is always makes that interesting.</p>
<p>Last night, I was asked if I know how to order posts differently in <a href="http://codex.wordpress.org/The_Loop">The Loop</a>. I don&#8217;t trust The Loop. I much prefer to use <a href="http://codex.wordpress.org/Function_Reference/WP_Query">WP_Query</a>, as I feel more in control, but my friend had already written a lot of functions that seemed to depend on using The Loop, and I&#8217;ve never been one for rocking the boat where live code is concerned!<br />
<span id="more-872"></span><br />
So, my buddy has the current code and it&#8217;s not working:</p>
<p><code><br />
        query_posts($query_string . '&#038;order=asc&#038;orderby=title');<br />
</code></p>
<p>The more perceptive will spot that he&#8217;s trying to order his posts by title, rather than by date, but no matter how you order/rename the variables, the results come back the same. A few minutes hunting later leads me to a query string variable called suppress_filters, which is called at the last minute in the query build, which applies things like ordering for stickies. Obviously, if you&#8217;re running a custom query, chances are you don&#8217;t care about stickies, so simply set suppress_filters to true when calling query_posts() :</p>
<p><code><br />
        query_posts($query_string . '&#038;order=asc&#038;orderby=title&#038;suppress_filters=true');<br />
</code></p>
<p>and the posts in your loop will be ordered the way you told them to be ordered. I&#8217;m pretty sure that there&#8217;s a point for this in the grand scheme of things, but I&#8217;m damned if I can see it.</p>
]]></content:encoded>
			<wfw:commentRss>http://jspr.tndy.me/2009/01/custom-ordering-of-wordpress-posts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter Stuff 0.3</title>
		<link>http://jspr.tndy.me/2009/01/twitter-stuff-03/</link>
		<comments>http://jspr.tndy.me/2009/01/twitter-stuff-03/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 02:26:12 +0000</pubDate>
		<dc:creator>Jasper</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[twitter-stuff]]></category>

		<guid isPermaLink="false">http://echohelloworld.com/?p=856</guid>
		<description><![CDATA[happy downloading! It&#8217;s been literally minutes in the making, but it&#8217;s here. Now with lovely added templates, to save you lazy people even more leg work, you can do things like: &#123;twitter:jaspertandy:avatar_link&#125; and get , and &#123;twitter:jaspertandy:username_link&#125; and get jaspertandy. Awesome, huh? I&#8217;ve also added the ability to force re-caching. If someone updates their avatar [...]]]></description>
			<content:encoded><![CDATA[<p><a href="/lib/downloads/twitter-stuff.php.zip">happy downloading!</a></p>
<p>It&#8217;s been literally minutes in the making, but it&#8217;s here. Now with lovely added templates, to save you lazy people even more leg work, you can do things like:<br />
<span id="more-856"></span><br />
<code>&#123;twitter:jaspertandy:avatar_link&#125;</code></p>
<p>and get <a href="http://twitter.com/jaspertandy"><img src="/lib/cache/https3.amazonaws.comtwitterproductionprofileimages71142678DSC0010normal.jpg" alt="jaspertandy"/></a>, and</p>
<p><code>&#123;twitter:jaspertandy:username_link&#125;</code></p>
<p>and get <a href="http://twitter.com/jaspertandy">jaspertandy</a>. Awesome, huh? I&#8217;ve also added the ability to force re-caching. If someone updates their avatar before your cache refreshes (this will probably only happen with people upgrading, but still!), then you&#8217;ll get a dead image link or an error. If you append <em>:force</em> to your tag, their data will be re-cached and their avatar updated:</p>
<p><code>&#123;twitter:jaspertandy:avatar_link:force&#125;</code></p>
<p>Becomes <a href="http://twitter.com/jaspertandy"><img src="/lib/cache/https3.amazonaws.comtwitterproductionprofileimages71142678DSC0010normal.jpg" alt="jaspertandy"/></a>. Only use :force if you get broken images, though, as it unnecessarily bullies twitter&#8217;s api.</p>
<p>I have also made it easy for you to create your own templates by adding a function with the incredibly convoluted prefix; <em>template_</em>, so your personal functions might look something like:<br />
<code><br />
public function template_jasper_rocks($user_json){<br />
    return 'jasper rocks!';<br />
}<br />
</code></p>
<p>Obviously, if you don&#8217;t do any scripting then stay away from this or you&#8217;ll break stuff. If you <em>do</em>, then make sure your function returns a string to replace the tag and you&#8217;re good to go.</p>
<p>As before, if you break it then come crying to the comments box. If you don&#8217;t know any PHP, but would still like a custom template, hit up the comments box and if you find this useful, say so. It&#8217;s nice to hear from people!</p>
<p>Installation is <a href="http://echohelloworld.com/2009/01/wordpress-plugin-twitter-user-tags/">the same as before</a>, so once you&#8217;ve downloaded this, either copy your old config stuff or follow the <a href="http://echohelloworld.com/2009/01/wordpress-plugin-twitter-user-tags/">original post</a>. I&#8217;ll do an interface so you don&#8217;t have to keep doing this, if it becomes apparent that more than two people are using the plugin!</p>
]]></content:encoded>
			<wfw:commentRss>http://jspr.tndy.me/2009/01/twitter-stuff-03/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[WordPress Plugin] Twitter User Tags</title>
		<link>http://jspr.tndy.me/2009/01/wordpress-plugin-twitter-user-tags/</link>
		<comments>http://jspr.tndy.me/2009/01/wordpress-plugin-twitter-user-tags/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 11:56:50 +0000</pubDate>
		<dc:creator>Jasper</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[twitter-stuff]]></category>

		<guid isPermaLink="false">http://echohelloworld.com/?p=838</guid>
		<description><![CDATA[It seems to be almost habit-forming, my chats with Thomas at sharebrain lately. He has a habit of having these little ideas for sites and WordPress hacks that I just can&#8217;t resist! So we were chatting last night, and he wanted to be able to quickly insert a user&#8217;s Twitter profile image into a WordPress [...]]]></description>
			<content:encoded><![CDATA[<p>It seems to be almost habit-forming, my chats with <a href="http://twitter.com/sharebrain">Thomas</a> at <a href="http://sharebrain.info/">sharebrain</a> lately. He has a habit of having these little ideas for sites and <a href="http://wordpress.org">WordPress</a> hacks that I just can&#8217;t resist! So we were chatting last night, and he wanted to be able to quickly insert a user&#8217;s Twitter profile image into a WordPress post. This seemed like a cool idea, but I wanted to take it further and be able to insert any user info, rather than just the image. So here it is, I present, the Twitter User Tagging thinger:<br />
<span id="more-838"></span><br />
<a href="http://echohelloworld.com/lib/downloads/twitter-stuff.php.zip">download</a>.</p>
<p><strong>How to use:</strong><br />
Firstly, you&#8217;ll need to install the plugin. Like any other, put this in your plugins directory and go to your admin panel to activate. To decrease the impact on the <a href="http://apiwiki.twitter.com/">twitter API</a>, this plugin caches everything you request, so you&#8217;ll need a cache directory. The default is &#8220;/lib/cache/&#8221; so you&#8217;ll need to make sure that directory exists and is writable. If you don&#8217;t like that directory, create your own, <strong>make sure it is writable</strong> and edit the following:</p>
<p><code><br />
/**<br />
 * the directory to put cached images in - with the first and last /<br />
 */<br />
    private $cache_dir = '/lib/cache/';<br />
</code></p>
<p>It is really important to leave the first and last &#8220;/&#8221; characters in there, or you&#8217;ll get errors. Don&#8217;t say I didn&#8217;t warn you.</p>
<p>If you&#8217;ve ever used <a href="http://www.smarty.net/">Smarty</a> or anything like it, you&#8217;ll recognise this straight away. To insert information about a user, insert a tag in this format:</p>
<p>&#123;twitter:username:info&#125;</p>
<p>so inserting &#123;twitter:jaspertandy:profile_image_url&#125; will insert http://s3.amazonaws.com/twitter_production/profile_images/62898698/DSC_0004_normal.jpg and &#123;twitter:jaspertandy:description&#125; will insert &#8220;Camera-wielding, web-developing lover of cute, fluffy things.&#8221; without the quotes, obviously.</p>
<p>There is some information (regarding status updates) that is nested in the format parent/child. To insert this type of data, use the format &#123;twitter:jaspertandy:status/text&#125;, which will insert &#8220;@tommsinclair you have to have a BT line &#8211; bout £11.50 p/m then you have the internet set up on top of that.&#8221;.</p>
<p>This plugin uses the twitter API, specifically the <a href="http://apiwiki.twitter.com/REST+API+Documentation#show">show</a> function. To see what you can get, follow the instructions there and you&#8217;ll see what you can embed.</p>
]]></content:encoded>
			<wfw:commentRss>http://jspr.tndy.me/2009/01/wordpress-plugin-twitter-user-tags/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
