<?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>Themocracy WordPress Themes &#187; Tools</title>
	<atom:link href="http://themocracy.com/category/wordpress-tools/feed/" rel="self" type="application/rss+xml" />
	<link>http://themocracy.com</link>
	<description>WordPress Theme Design</description>
	<lastBuildDate>Mon, 26 Jul 2010 06:18:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using Google Code libraries with WordPress</title>
		<link>http://themocracy.com/2010/02/using-google-code-libraries-with-wordpress/</link>
		<comments>http://themocracy.com/2010/02/using-google-code-libraries-with-wordpress/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 15:54:40 +0000</pubDate>
		<dc:creator>Lisa</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[mootools]]></category>

		<guid isPermaLink="false">http://themocracy.com/?p=224</guid>
		<description><![CDATA[By default, WordPress loads the version of jQuery that comes with the package. But there is an alternative way of doing it and that&#8217;s to use the AJAX Libraries API at Google Code &#8211; use their bandwidth, why not&#8230;
A few lines added to your functions.php in the theme you&#8217;re building and you&#8217;re ready to go.

 [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthemocracy.com%2F2010%2F02%2Fusing-google-code-libraries-with-wordpress%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthemocracy.com%2F2010%2F02%2Fusing-google-code-libraries-with-wordpress%2F" height="61" width="51" /></a></div><p><img class="alignright size-full wp-image-207" title="wordpress-250x250" src="http://themocracy.com/wp-content/uploads/2010/01/wordpress-250x250.png" alt="" width="192" height="192" /><strong>By default, WordPress loads the version of jQuery that comes with the package.</strong> But there is an alternative way of doing it and that&#8217;s to use the AJAX Libraries API at Google Code &#8211; use their bandwidth, why not&#8230;</p>
<p>A few lines added to your functions.php in the theme you&#8217;re building and you&#8217;re ready to go.<br />
<span id="more-224"></span><br />
<strong> wp_register_script()</strong> &#8211; the useful point is that you can use this function to access scripts hosted elsewhere&#8230;</p>
<p>Just add this code to your <strong>functions.php</strong> file:</p>
<pre class="brush: php">
add_action(&#039;template_redirect&#039;, &#039;js_head_load&#039;);

function js_head_load(){

if(is_admin()) return;

wp_deregister_script(&#039;jquery&#039;);
wp_register_script(&#039;jquery&#039;, &#039;http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js&#039;);
wp_enqueue_script(&#039;jquery&#039;);
// and then any other scripts to register and queue...
}
</pre>
<p>Notice the first line of the function ensures that the jQuery isn&#8217;t loaded on WP admin pages -<em> if a script isn&#8217;t needed, don&#8217;t load it on the page</em> &#8211; and in this case jQuery in noConflict mode  can cause the admin rich text editor and the widget drag and drop interface to go awry..</p>
<p><strong>The advantages</strong>:-<br />
You&#8217;ll be able to update the version your site is using quickly and easily, probably a good thing.</p>
<p>Google Code tends to have a policy of only including versions demonstrated to be stable, jQuery 1.2.4 and 1.2.5 didn&#8217;t make the grade</p>
<p>The user may already have it cached in their browser via some previously visited site instead of downloading from a location on your site (and if enough sites do it, the chances are that much greater that they will have a copy in the cache).</p>
<p>Not just jQuery &#8211; check out jQuery UI<br />
<a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js">http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js</a><br />
And MooTools, which seems seriously under-used in conjunction with WordPress<br />
<a href="http://ajax.googleapis.com/ajax/libs/mootools/1.2.4/mootools-yui-compressed.js">http://ajax.googleapis.com/ajax/libs/mootools/1.2.4/mootools-yui-compressed.js</a></p>
<p>Always grab the minified version.</p>
<p>And lastly, one disadvantage:- googleapis.com does go down very occasionally &#8211; but then again a site ought to function, more or less, without javaScript.</p>
]]></content:encoded>
			<wfw:commentRss>http://themocracy.com/2010/02/using-google-code-libraries-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Fatal Error &#8211; Cannot modify header information</title>
		<link>http://themocracy.com/2010/01/error-cannot-modify-header-information/</link>
		<comments>http://themocracy.com/2010/01/error-cannot-modify-header-information/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 13:30:19 +0000</pubDate>
		<dc:creator>Lisa</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://themocracy.com/?p=221</guid>
		<description><![CDATA[You&#8217;ve been hacking around in WordPress and you get&#8230;
Fatal Error &#8211; Cannot modify header information &#8211; headers already sent &#8230;
Why? Very simply, because the script has output something (&#8230; ie. printed it to your browser) before trying to execute a  PHP header(&#8220;&#8230;&#8221;) statement &#8211; which just isn&#8217;t allowed with PHP. Often, it&#8217;s a header(&#8220;Location: &#8230;&#8221;) [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthemocracy.com%2F2010%2F01%2Ferror-cannot-modify-header-information%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthemocracy.com%2F2010%2F01%2Ferror-cannot-modify-header-information%2F" height="61" width="51" /></a></div><p><img class="alignright size-full wp-image-222" title="error_warning" src="http://themocracy.com/wp-content/uploads/2010/01/error_warning.gif" alt="" width="100" height="100" />You&#8217;ve been hacking around in WordPress and you get&#8230;</p>
<blockquote><p><strong>Fatal Error &#8211; Cannot modify header information &#8211; headers already sent &#8230;</strong></p></blockquote>
<p>Why? Very simply, because the script has output something (&#8230; ie. printed it to your browser) before trying to execute a  PHP header(&#8220;&#8230;&#8221;) statement &#8211; which just isn&#8217;t allowed with PHP. Often, it&#8217;s a header(&#8220;Location: &#8230;&#8221;) command.<span id="more-221"></span></p>
<p>So the output might be an echo or a print you&#8217;ve just added in the wrong place &#8211; but much more likely it&#8217;s a blank space or line(s) outside the opening &lt;?php or closing ?&gt;  in a file.</p>
<p>Have a look at the error message to find which file has produced the warning and edit out the whitespace &#8211; remember, check top and bottom.</p>
<p>And always use a PHP/HTML text editor for this &#8211; or anything lo-tech&#8230; the big heavy word processing programs, Word, Open Office often insert hidden characters in the file. ﻿</p>
]]></content:encoded>
			<wfw:commentRss>http://themocracy.com/2010/01/error-cannot-modify-header-information/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Theme Frameworks</title>
		<link>http://themocracy.com/2010/01/wordpress-theme-frameworks/</link>
		<comments>http://themocracy.com/2010/01/wordpress-theme-frameworks/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 16:18:31 +0000</pubDate>
		<dc:creator>Lisa</dc:creator>
				<category><![CDATA[Themes]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://themocracy.com/?p=214</guid>
		<description><![CDATA[Since the arrival of WordPress 2.7, the true framework is based on the concept of parent/child WordPress themes. A child theme is dependent on its parent - here, the framework - for its template files and functions, it's not going work without it.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthemocracy.com%2F2010%2F01%2Fwordpress-theme-frameworks%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthemocracy.com%2F2010%2F01%2Fwordpress-theme-frameworks%2F" height="61" width="51" /></a></div><p><img class="alignright size-full wp-image-220" title="wordpress-framework" src="http://themocracy.com/wp-content/uploads/2010/01/wordpress-framework.jpg" alt="" width="290" height="169" /><strong>Since the arrival of WordPress 2.7, the true framework is based on the concept of parent/child WordPress themes.</strong></p>
<p>A child theme is dependent on its parent &#8211; here, the framework &#8211; for its template files and functions, it&#8217;s not going work without it &#8211; &#8216;parasite&#8217; might be a better name.</p>
<p>When you install a WordPress framework theme, it doesn&#8217;t look very impressive to start with &#8211; black and white &#8211; but that&#8217;s not the point. The basic idea is to cover all the fundamentals in the parent framework, the stuff every good theme needs, and keep separate the fancy styling, add-ons etc. in the child theme.<br />
<span id="more-214"></span><br />
The art of a good framework is how it lets in the customization. Much like PHP frameworks, used wisely, they allow flexibility and concise code, quickly applied &#8211; used unwisely, they rapidly become a big old mess with far too many moving parts&#8230;</p>
<p>Any good WordPress theme developer will have ended up with a core code that does the job the way he or she thinks best &#8211; and this is the origin of a framework. Frankly, if you are are more programming-orientated as a theme designer than design-orientated, they may not be for you. Whether you stick with your code, or dip into your first framework child theme, up to you&#8230; but here are the current market leaders, as it were, in no particularly significant order.</p>
<p><a href="http://themeshaper.com/thematic/">Thematic</a><br />
<a href="http://themeshaper.com/thematic/"><img class="alignright size-full wp-image-215" title="mw372" src="http://themocracy.com/wp-content/uploads/2010/01/mw372.png" alt="" width="400" height="125" /></a> Produced by Ian Stewart, the prime mover in getting parent-child themes off the ground, Thematic has grids, CSS  frameworks, and 13 different widget-ready areas. There&#8217;s a growing selection of child themes, free and premium, and support forums.</p>
<p><a href="http://themehybrid.com/">ThemeHybrid</a><br />
<a href="http://themehybrid.com/"><img class="alignright size-full wp-image-216" title="ThemeHybrid" src="http://themocracy.com/wp-content/uploads/2010/01/mw373.png" alt="" width="400" height="125" /></a>Again, all the usual goodies, ThemeHybrid also comes with a good selection of child themes built up. For enhanced support in developing and customizing your own theme, ThemeHybrid has a paid club membership option (currently US$25).</p>
<p><a href="http://www.zy.sg/the-buffet-framework/">Buffet</a><br />
<a href="http://www.zy.sg/the-buffet-framework/"><img class="alignright size-full wp-image-217" title="buffet" src="http://themocracy.com/wp-content/uploads/2010/01/mw374.png" alt="" width="400" height="125" /></a>Buffet has a variety of jQuery features &#8211; Superfish menus, SuperSleight for png transparency in IE6, jBreadcrumb.  It also offers 2 CSS frameworks &#8211; 960gs and the Blueprint CSS frameworks &#8211; and support for microformats, XOXO, hAtom, hCard&#8230;</p>
<p><a href="http://www.plaintxt.org/themes/sandbox/">Sandbox</a><br />
<a href="http://www.plaintxt.org/themes/sandbox/"><img class="alignright size-full wp-image-218" title="sandbox" src="http://themocracy.com/wp-content/uploads/2010/01/mw376.png" alt="" width="400" height="125" /></a>Sandbox is probably the original &#8211; been around for years &#8211; a minimalist Wordpress Theme, designed for developers to build on and produce workable themes simply using CSS. But it&#8217;s fully widget-ready, XHTML valid and released under the GPL.</p>
<p><a href="http://onepresscommunity.com/">OnePress</a><br />
<a href="http://onepresscommunity.com"><img class="alignright size-full wp-image-219" title="onepress" src="http://themocracy.com/wp-content/uploads/2010/01/mw371.png" alt="" width="400" height="125" /></a>The unique proposition for OnePress is its integration with phpBB, with a unified login and forum messages displayed on the blog &#8211; if you&#8217;re a jobbing site-builder this is certainly something that comes up as a very common client requirement.</p>
<p><strong>Conclusion</strong></p>
<p>There are other frameworks &#8211; many other frameworks &#8211; in different states of development. This is a hot topic in WordPress theme design and I&#8217;m sure the situation will continue to evolve &#8211; much like the arrival of javascript libraries, there&#8217;ll be a fair amount of competition before the winner(s) emerge.</p>
]]></content:encoded>
			<wfw:commentRss>http://themocracy.com/2010/01/wordpress-theme-frameworks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JQuery, Cufon and WordPress</title>
		<link>http://themocracy.com/2010/01/jquery-cufon-and-wordpress/</link>
		<comments>http://themocracy.com/2010/01/jquery-cufon-and-wordpress/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 13:48:58 +0000</pubDate>
		<dc:creator>Lisa</dc:creator>
				<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[cufon]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://themocracy.com/?p=209</guid>
		<description><![CDATA[Just at the moment the best font replacement technique around is cufón – so how to get this technique into your WordPress theme design?]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthemocracy.com%2F2010%2F01%2Fjquery-cufon-and-wordpress%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthemocracy.com%2F2010%2F01%2Fjquery-cufon-and-wordpress%2F" height="61" width="51" /></a></div><p><img class="alignright size-thumbnail wp-image-207" title="wordpress-250x250" src="http://themocracy.com/wp-content/uploads/2010/01/wordpress-250x250-150x150.png" alt="" width="150" height="150" />Just at the moment the best font replacement technique around is <a href="http://wiki.github.com/sorccu/cufon/">cufón</a> &#8211; so how to get this technique into your WordPress theme design?</p>
<p>You&#8217;ll need 3 javascript files &#8211; best to put them in the theme directory under /scripts</p>
<p>1. The Cufon javascript<br />
2. The individual font javascript &#8211; downloaded from cufon &#8211; or use their excellent generator http://cufon.shoqolate.com/generate/  (not all fonts as .ttf will do the trick, there&#8217;s issues of licensing in terms of web embedding)<br />
3. A custom script, very simple, just to activate.<br />
<span id="more-209"></span><br />
The plan is to get the scripts loading in the WP header, and the best action hook for this is <strong>template_redirect</strong> &#8211; so, in <strong>functions.php</strong></p>
<pre class="brush: php">
add_action(&#039;template_redirect&#039;, &#039;them_js_head_load&#039;);

function them_js_head_load(){

define(TH_TEMPLATE_URL, get_bloginfo(&#039;template_url&#039;));

wp_register_script(&#039;cufon&#039;, TH_TEMPLATE_URL . &#039;/scripts/cufon-yui.js&#039;, array(&#039;jquery&#039;), &#039;1.0&#039;);
wp_register_script(&#039;my_font&#039;, TH_TEMPLATE_URL . &#039;/scripts/myfont.font.js&#039;, array(&#039;jquery&#039;), &#039;1.0&#039;);
wp_enqueue_script(&#039;fontsactivate&#039;, TH_TEMPLATE_URL . &#039;/scripts/fontsactivate.js&#039;, array(&#039;jquery&#039;, &#039;cufon&#039;, &#039;them_font&#039;), &#039;1.0&#039;);
}
</pre>
<p><strong>fontsactivate.js</strong> is as simple as you want to make it &#8211; just this, for example, will replace all post h2 headings on the page</p>
<pre class="brush: js">
Cufon.replace(&#039;.post h2&#039;);
</pre>
<p>Don&#8217;t imagine it&#8217;s a great idea to replace all the text on a page with a custom font, that&#8217;ll make the server chug a bit &#8211; stick with headings&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://themocracy.com/2010/01/jquery-cufon-and-wordpress/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>WordPress, Twitter and URL-shortening</title>
		<link>http://themocracy.com/2010/01/wordpress-twitter-and-url-shortening/</link>
		<comments>http://themocracy.com/2010/01/wordpress-twitter-and-url-shortening/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 09:26:10 +0000</pubDate>
		<dc:creator>Lisa</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://themocracy.com/?p=196</guid>
		<description><![CDATA[You&#8217;re producing a WordPress theme, or plugin, that is related to Twitter and for obvious reasons you want to include url-shortening functionality&#8230; How&#8217;s it, generally, done?
Just the briefest snippet of PHP, this example for is.gd:-

	function shorten_url($url)	{
		$request = &#039;http://is.gd/api.php?longurl=&#039; . $url;
		return @file_get_contents($request);
	}


You might want to do a bit of error-catching on that. We&#8217;ve used file_get_contents() on [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthemocracy.com%2F2010%2F01%2Fwordpress-twitter-and-url-shortening%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthemocracy.com%2F2010%2F01%2Fwordpress-twitter-and-url-shortening%2F" height="61" width="51" /></a></div><p><img src="http://themocracy.com/wp-content/uploads/2010/01/wordpress-250x250-150x150.png" alt="" title="wordpress-250x250" width="150" height="150" class="alignright size-thumbnail wp-image-207" /><strong>You&#8217;re producing a WordPress theme, or plugin, that is related to Twitter </strong>and for obvious reasons you want to include url-shortening functionality&#8230; How&#8217;s it, generally, done?</p>
<p>Just the briefest snippet of PHP, this example for is.gd:-</p>
<pre class="brush: php">
	function shorten_url($url)	{
		$request = &#039;http://is.gd/api.php?longurl=&#039; . $url;
		return @file_get_contents($request);
	}
</pre>
<p><span id="more-196"></span><br />
You might want to do a bit of error-catching on that. We&#8217;ve used <strong>file_get_contents()</strong> on the basis that we write themes and plugins that work on PHP5 &#8211; the &#8216;official&#8217; WordPress way is probably still to use the bundled version of Snoopy. Or there&#8217;s always cURL &#8211; unless there isn&#8217;t on your server&#8230;</p>
<p>Any decent url-shortening service will have its own RESTful API location to do this &#8211; hunt in their Developer Tools</p>
<p>http://tinyurl.com/api-create.php?url={long_url}</p>
<p>et al&#8230; though some require login/password parameters to be passed, and some definitely require urlencoded parameters</p>
<p><strong>But&#8230;. your own name</strong></p>
<p>Don&#8217;t forget, in the particular case, if you&#8217;re customising your own WordPress installation, the possibility of using $_GET urls -these may well be short enough (if your domain name is short enough&#8230; obviously&#8230;.) . Using your own domain name has 2 advantages, 1 significant</p>
<p>1. If third parties quote the link directly on their web pages it&#8217;s your site getting the link value.<br />
2. Still works if the url-shortening site happens to die before your blog does&#8230;</p>
<p>And even if you have permalinks active, urls will redirect&#8230;.</p>
<p><a target="_blank" href="http://themocracy.com/?p=188">http://themocracy.com/?p=188</a> will redirect you to the pretty permalink version &#8211; job done.</p>
]]></content:encoded>
			<wfw:commentRss>http://themocracy.com/2010/01/wordpress-twitter-and-url-shortening/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>WordPress Twitter Integration</title>
		<link>http://themocracy.com/2010/01/wordpress-twitter-integration/</link>
		<comments>http://themocracy.com/2010/01/wordpress-twitter-integration/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 17:35:01 +0000</pubDate>
		<dc:creator>Lisa</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://themocracy.com/?p=204</guid>
		<description><![CDATA[Publicity, relationship-building, just plain keeping in touch &#8211; Twitter offers it all and the art is to integrate your tweeting into your blogging, if that doesn&#8217;t sound too salacious. Here&#8217;s a few scattered suggestions on the subject.
First up, to begin at the beginning, reply to @&#8217;s &#8211; I know it&#8217;s absolutely bleedin&#8217; obvious, but if [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthemocracy.com%2F2010%2F01%2Fwordpress-twitter-integration%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthemocracy.com%2F2010%2F01%2Fwordpress-twitter-integration%2F" height="61" width="51" /></a></div><p><img class="alignright size-full wp-image-205" title="twitter" src="http://themocracy.com/wp-content/uploads/2010/01/twitter.jpg" alt="" width="261" height="193" /><strong>Publicity, relationship-building, just plain keeping in touch</strong> &#8211; <em>Twitter offers it all and the art is to integrate your tweeting into your blogging, if that doesn&#8217;t sound too salacious.</em> Here&#8217;s a few scattered suggestions on the subject.</p>
<p>First up, to begin at the beginning, <strong>reply to @&#8217;s</strong> &#8211; I know it&#8217;s absolutely bleedin&#8217; obvious, but if you&#8217;re going to use Twitter at all, then it does make sense to keep an eye on people taking the trouble to contact you &#8211; if the @message isn&#8217;t total spam, of course. And probably a good idea nowadays never to let a tweet out on the world without one #hashtag.<br />
<span id="more-204"></span><br />
<strong>Display your twitterstream on the blog</strong> &#8211; there&#8217;s WordPress plugins for this &#8211; a lot of plugins, in all shapes, sizes and functionalities, such that the jury is still out on who&#8217;s the market leader. At the moment, the advice has to be download two or three, try them out and find the one that suits you&#8230;</p>
<p><a href="http://wordpress.org/extend/plugins/twitter-tools/">Twitter Tools</a> has a fair few features. Personally, I haven&#8217;t had much luck with this one &#8211; it seems to give up after a while and only start again when re-installed, and I haven&#8217;t got round to digging around the code to see if it&#8217;s a localised problem or intrinsic to the plugin. There&#8217;s also the issue of deleting manually, ie directly at the database level, any deleted tweets.</p>
<p>Twitter itself supplies <a href="http://twitter.com/account/badge">javascript snippets</a> to produce a badge of tweet lists &#8211; just paste it on your page somewhere, somehow &#8211; in practice, not recommended simply because the request takes a while to come back from Twitter&#8217;s overburdened servers and your page will likely hang at times. Tho&#8217; fair enough, things seem to be improving a lot in that direction recently &#8211; and I wouldn&#8217;t like the job myself of keeping Twitter up and running at that rate of growth.</p>
<p>Wider than just Twitter, there&#8217;s also the <a href="http://www.enthropia.com/labs/wp-lifestream/">Lifestream WordPress plugin</a>. Lots of features included, which do take a little bit of figuring out but you can merge twitter feeds, extra RSS and then any of the other social entities, Digg, FriendFeed etc etc.</p>
<p>One thing &#8211; if you&#8217;re going through a twitter-lazy period and all that appears in the sidebar is a set of auto-generated new blog posts 181 days ago, 193 days ago &#8211; that doesn&#8217;t look so good. A successful blog does actually require some work.</p>
<p>Among other Twitter-related WordPress plugins: -</p>
<p><a href="http://wordpress.org/extend/plugins/twitterlink-comments/">TwitterLink Comments</a> is a WordPress plugin which adds an input field to a post&#8217;s comment form for commenters to include their Twitter username &#8211; a follow me link is shown against that commenter&#8217;s profile &#8211; caution, a definite invitation for spam&#8230;</p>
<p>The slightly bilious <a href="http://wordpress.org/extend/plugins/tweetmeme/">TweetMeme</a> retweet button does what it says &#8211; a link allowing visitors to your blog to quickly retweet the post. For the competitive, there&#8217;s also a display of number of retweets of that url across Twitter.</p>
<p><strong>Do consider having a custom Twitter landing page on your blog</strong>. A relatively old dodge, but useful&#8230;</p>
<p>Instead of using your blog front page as your profile url without even thinking about it &#8211; take the trouble to produce a specialised landing page &#8211; a digest of who you are, what&#8217;s going on, all in a couple of hundred words. The logic behind this is that people using Twitter may well have different priorities and interests than your average blog-reader who&#8217;s arrived via search engine.</p>
<p>This profile url appears on your Twitter web page (and with the growth in non-browser-based twitter tools that gets viewed less and less) but also in various other places, directories etc. so it&#8217;s worth considering.</p>
<p>If you can give them what they want, grab their attention better, that&#8217;s one more connection made. Attention spans (of the young) are not very long nowadays&#8230;</p>
<p><strong>And do watch out for shortened urls</strong> &#8211; don&#8217;t display or retweet anything you haven&#8217;t checked, and that definitely includes anything that arrives in a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://themocracy.com/2010/01/wordpress-twitter-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More WordPress and jQuery</title>
		<link>http://themocracy.com/2010/01/more-wordpress-and-jquery/</link>
		<comments>http://themocracy.com/2010/01/more-wordpress-and-jquery/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 13:15:57 +0000</pubDate>
		<dc:creator>Lisa</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://themocracy.com/?p=195</guid>
		<description><![CDATA[To refine a previous post on WordPress and jQuery and the use of the wp_enqueue_script function, its paths and dependencies.
As a barebones example, this is how we do it when we we&#8217;re enqueueing &#8211; if that&#8217;s a word &#8211; the jQuery Cycle plugin, so that we can make a slideshow on the page.

The important point [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthemocracy.com%2F2010%2F01%2Fmore-wordpress-and-jquery%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthemocracy.com%2F2010%2F01%2Fmore-wordpress-and-jquery%2F" height="61" width="51" /></a></div><p>To refine a previous post on WordPress and jQuery and the use of the <a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script">wp_enqueue_script</a> function, its paths and dependencies.</p>
<p>As a barebones example, this is how we do it when we we&#8217;re enqueueing &#8211; if that&#8217;s a word &#8211; the <a href="http://www.malsup.com/jquery/cycle/">jQuery Cycle plugin</a>, so that we can make a slideshow on the page.<br />
<span id="more-195"></span><br />
The important point is probably in the dependencies &#8211; firstly, the Cycle plugin depends on jQuery, so has to be loaded after &#8211; secondly, our custom script to run the whole process on depends on the jQuery Cycle plugin and therefore also on jQuery and is the last to load.</p>
<p>The custom script we&#8217;ve written is in <strong>them_directory/scripts/them.cycle.js</strong>  &#8211; something very simple, like this:-</p>
<pre class="brush: js">
jQuery(document).ready(function($) {

$(&#039;#images&#039;).cycle({
//some parameters
 });
});
</pre>
<p>(Don&#8217;t forget, the dollar $ object isn&#8217;t defined in WordPress jQuery (historical reasons) &#8211; hence the form of the first line) </p>
<p>This is client-display side javascript, as opposed to admin-side, (which tends to follow slightly different rules in the WordPress setup) and in this case, the action hook &#8216;template_redirect&#8217; is usually the time to do it.</p>
<p>To enqueue the jQuery library itself is simple &#8211; it&#8217;s already registered by default in WordPress, no need to specify other than the default path and version.</p>
<p>So in <strong>functions.php</strong> </p>
<pre class="brush: php">
add_action(&#039;template_redirect&#039;, &#039;them_js_head_load&#039;);

function them_js_head_load(){

	//register the plugin
	wp_enqueue_script(&#039;jquery-cycle&#039;, THEM_TEMPLATEURL.&#039;/scripts/jquery.cycle.lite.min.js&#039;, array(&#039;jquery&#039;), &#039;1.0&#039;);
	//register the custom script
	wp_enqueue_script(&#039;them-cycle&#039;, THEM_TEMPLATEURL.&#039;/scripts/them.cycle.js&#039;, array(&#039;jquery&#039;, &#039;jquery-cycle&#039;), &#039;1.0&#039;);

}
</pre>
<p>Note for convenience and efficiency, we&#8217;ve previously defined</p>
<pre class="brush: php">

define(THEM_TEMPLATEURL, get_bloginfo(&#039;template_directory&#039;));
</pre>
<p>And what you end up with in the page source should be something like this &#8211; javascripts loaded in the right place in the page head, up and running</p>
<p><strong>&lt;script type=&#8217;text/javascript&#8217; src=&#8217;http://localhost/test/wp-content/themes/this-theme/scripts/jquery.cycle.lite.min.js?ver=1.0&#8242;&gt;&lt;/script&gt;</strong></p>
<p><strong>&lt;script type=&#8217;text/javascript&#8217; src=&#8217;http://localhost/test/wp-content/themes/this-theme/scripts/them.cycle.js?ver=1.0&#8242;&gt;&lt;/script&gt;</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://themocracy.com/2010/01/more-wordpress-and-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress Database Functions</title>
		<link>http://themocracy.com/2009/07/wordpress-database-functions/</link>
		<comments>http://themocracy.com/2009/07/wordpress-database-functions/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 11:56:36 +0000</pubDate>
		<dc:creator>Lisa</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://themocracy.com/?p=93</guid>
		<description><![CDATA[If you&#8217;re going to be a WordPress plugin author, pretty soon you&#8217;ll have to get into the area of database operations, manipulating existing data or even adding your own tables &#8211; assuming you have a basic knowledge of PHP/MySQL, here&#8217;s how the fundamentals work
WordPress uses the ezSQL database wrapper &#8211; not a high-tech solution (WordPress [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthemocracy.com%2F2009%2F07%2Fwordpress-database-functions%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthemocracy.com%2F2009%2F07%2Fwordpress-database-functions%2F" height="61" width="51" /></a></div><p><img src="http://themocracy.com/wp-content/uploads/2009/07/mysql.gif" alt="mysql" title="mysql" width="130" height="74" class="alignright size-full wp-image-105" />If you&#8217;re going to be a WordPress plugin author, pretty soon you&#8217;ll have to get into the area of database operations, manipulating existing data or even adding your own tables &#8211; assuming you have a basic knowledge of PHP/MySQL, here&#8217;s how the fundamentals work</p>
<p>WordPress uses the <a href="http://www.woyano.com/jv/ezsql">ezSQL database wrapper</a> &#8211; not a high-tech solution (WordPress isn&#8217;t high-tech, probably one of its strengths&#8230;), but simple, stable and useful. It wouldn&#8217;t be a bad idea here to grab a copy, read the FAQ and play around with the basic functions to understand the PHP syntax involved.<br />
<span id="more-93"></span><br />
(I think) it&#8217;s safe to say that anything you can do with ezSQL, you can replicate inside the WordPress environment with $wpdb &#8211; but don&#8217;t quote me on that one&#8230;.</p>
<p><strong>The WordPress Database Object &#8211; $wpdb</strong></p>
<p>$wpdb is the database object created by an instance of the ezSQL class &#8211; this part is already done for you.</p>
<p>Rule 1 for beginners &#8211; <em>scope</em> &#8211; remember to declare the object in any function in which you&#8217;re going to make use of $wpdb  </p>
<pre class="brush: php">
&lt;?php
	function my_wordpress_function(){
	global $wpdb;
		// etc....
	}
?&gt;
</pre>
<p>Let&#8217;s jump in and try something &#8211; how to get the names and email addresses of the commenters on your blog:- </p>
<pre class="brush: php">
&lt;?php
$commentEmails = $wpdb-&gt;get_results(&quot;SELECT comment_author, comment_author_email
FROM $wpdb-&gt;comments ORDER BY comment_date DESC LIMIT 20&quot;);
?&gt;
</pre>
<p>You&#8217;ve got the raw data, as an object, you can dump it  &#8211; print_r($commentEmails) &#8211;  write it to a csv file and download it, whatever you need.</p>
<p>If you want the results as an associative array &#8211; maybe for further ordering, or some such &#8211; the method is to add ARRAY_A &#8211; see the ezSQL documentation.</p>
<pre class="brush: php">
&lt;?php
$commentEmails = $wpdb-&gt;get_results(&quot;SELECT comment_author, comment_author_email
FROM $wpdb-&gt;comments ORDER BY comment_date DESC LIMIT 20&quot;, ARRAY_A);
?&gt;
</pre>
<p>Most of this is straightforward MySQL syntax &#8211; the one significant point involves the specifying of the table, here, comments &#8211; there&#8217;s a database prefix involved, which will vary from one installation to another.</p>
<p>The current WordPress method is to use an associated variable of the database object &#8211; $wpdb->comments, and you&#8217;ll be selecting from the correct table. Again, this has already been declared for you. Similarly, $wpdb->posts will get you the posts table to work with, $wpdb->users, $wpdb->options etc&#8230;</p>
<p>It&#8217;s a better way than using $table_prefix from wp-config.php and adding this into the sql string. The slight complication comes when you start adding and using your own custom tables, not already a part of the $wpdb object &#8211; and that&#8217;s for later&#8230; </p>
<p>Meanwhile, try a few SELECTs and then maybe a few UPDATEs/INSERTs to see what&#8217;s going on.</p>
]]></content:encoded>
			<wfw:commentRss>http://themocracy.com/2009/07/wordpress-database-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using jQuery with WordPress</title>
		<link>http://themocracy.com/2009/04/using-jquery-with-wordpress/</link>
		<comments>http://themocracy.com/2009/04/using-jquery-with-wordpress/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 12:51:04 +0000</pubDate>
		<dc:creator>Lisa</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://localhost/themocracy/?p=3</guid>
		<description><![CDATA[If you&#8217;re a theme developer, you&#8217;ll (perhaps) be looking at keeping up with the latest in javascript/AJAX and incorporating a few tweaks into your brand new theme &#8211; in some ways, it&#8217;s been made very easy for you (and in one or two ways it&#8217;s just a little tricky&#8230;)

So, assuming you have a basic knowledge [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthemocracy.com%2F2009%2F04%2Fusing-jquery-with-wordpress%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthemocracy.com%2F2009%2F04%2Fusing-jquery-with-wordpress%2F" height="61" width="51" /></a></div><p><img style="padding:2px;border:2px solid #ccc;margin:0 0 0 10px;" src="http://themocracy.com/wp-content/uploads/2009/04/mw022.png" alt="mw022" title="mw022" width="229" height="75" class="alignright size-full wp-image-6" /><strong>If you&#8217;re a theme developer, you&#8217;ll (perhaps) be looking at keeping up with the latest in javascript/AJAX and incorporating a few tweaks into your brand new theme</strong> &#8211; in some ways, it&#8217;s been made very easy for you (and in one or two ways it&#8217;s just a little tricky&#8230;)<br />
<span id="more-3"></span><br />
So, assuming you have a basic knowledge of PHP, theme design and javascript, here&#8217;s how it works:-</p>
<p><strong>Loading up jQuery</strong></p>
<p>WordPress arrives with jQuery already bundled, so this bit&#8217;s easy enough. But we need to get it loaded onto the page, which doesn&#8217;t happen automatically&#8230;</p>
<p>The plan here would be to get some nice tabbed divisions going, maybe in the sidebar, courtesy of jQuery.</p>
<pre class="brush: php">
&lt;?php
add_action(&#039;template_redirect&#039;, &#039;them_js_head_load&#039;);

function them_js_head_load(){

 // we don&#039;t need this on admin pages, so...
	if(is_admin()) return;

      wp_enqueue_script(&#039;tabber&#039;, get_bloginfo(&#039;template_directory&#039;) . &#039;/scripts/tabs.js&#039;, array(&#039;jquery&#039;, &#039;jquery-ui-core&#039;, &#039;jquery-ui-tabs&#039;), &#039;1.0&#039;);
}
 ?&gt;
</pre>
<p>In this code, we&#8217;ve enqueued a custom script <strong>tabs.js</strong>, that&#8217;s going to initiate the whole process &#8211; and we&#8217;ve also declared its dependencies &#8211; <strong>jquery</strong>, <strong>jquery-ui-core</strong>, <strong>jquery-ui-tabs</strong>, the user interface sublibraries, also bundled into WordPress as standard.</p>
<p>These are already registered, so only the handle is required, here: &#8216;jquery-ui-tabs&#8217;, etc. </p>
<p>The full list of bundled libraries is at: <a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script">WordPress wp_enqueue_script</a>.</p>
<p><strong>Vital!</strong> &#8211; The snippets of jQuery code you&#8217;ll find while out and about on the net make extensive use of the shortcut $ to express the jQuery global object. This isn&#8217;t going to work in WordPress, so at all times we use  <strong>jQuery</strong>(document).ready(function($) &#8211; and then it will work&#8230; Once inside the function, we can use $ as a shortcut. </p>
<p>The reason for this slight complication is that Prototype and Scriptaculous libraries arrived first into WordPress and have got to hold on to using the $ shortcut. And don&#8217;t be tempted to dabble with <strong>jQuery.noConflict()</strong> here &#8211; you won&#8217;t get good results.</p>
<p>And from here, since you know what you want to put in your theme in terms of flashy javascript/AJAX add-ons, I&#8217;ll leave you to get on with thieving some snippets and getting them up and running&#8230;.</p>
<p><strong>* Update</strong> &#8211; some of this information is superseded by changes in the way WordPress handles the loading of javascript &#8211; there&#8217;s a follow-up here &#8211; <a href="http://themocracy.com/2010/01/more-wordpress-and-jquery/">More about WordPress and jQuery</a></p>
]]></content:encoded>
			<wfw:commentRss>http://themocracy.com/2009/04/using-jquery-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
		</item>
	</channel>
</rss>
