<?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>RLASKEY: words &#187; wordpress</title>
	<atom:link href="http://rlaskey.org/words/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://rlaskey.org/words</link>
	<description>thoughts, by RML3</description>
	<lastBuildDate>Sun, 05 Feb 2012 22:11:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Finding RSS for tags, categories, etc. in WordPress</title>
		<link>http://rlaskey.org/words/824/finding-rss-for-tags-categories-etc-in-wordpress/</link>
		<comments>http://rlaskey.org/words/824/finding-rss-for-tags-categories-etc-in-wordpress/#comments</comments>
		<pubDate>Fri, 25 Feb 2011 03:01:01 +0000</pubDate>
		<dc:creator>rlaskey</dc:creator>
				<category><![CDATA[Code/Systems]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://rlaskey.org/words/?p=824</guid>
		<description><![CDATA[On the whole I like WordPress a lot, though there are sometimes some funky bits which make it a tad awkward.  Namely, if you&#8217;re looking to get an RSS feed link for a category, a tag, an author, or a &#8230; <a href="http://rlaskey.org/words/824/finding-rss-for-tags-categories-etc-in-wordpress/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>On the whole I like WordPress a lot, though there are sometimes some funky bits which make it a tad awkward.  Namely, if you&#8217;re looking to get an RSS feed link for a category, a tag, an author, or a search, you can do the following:</p>
<blockquote><pre>get_category_feed_link(get_queried_object_id());
get_tag_feed_link(get_queried_object_id());
get_author_feed_link(get_queried_object_id());
get_search_feed_link();</pre>
</blockquote>
<p>So, I&#8217;ll use one of the above in the appropriate place in my template file, generally with something like:</p>
<blockquote><pre>&lt;?php $feed = get_category_feed_link(get_queried_object_id());
echo 'Available via RSS: &lt;a href="'.$feed.'"&gt;'.$feed.'&lt;/a&gt;';
unset($feed); ?&gt;</pre>
</blockquote>
<p>No, this isn&#8217;t rocket science or anything too heavy, but hopefully it will save some time for those who are searching the same amount of time I needed in order to find the fix.  It&#8217;s also worth noting that the ID of the tag/category/author can replace the <code>get_queried_object_id()</code> if so desired, in a loop or other context.</p>
]]></content:encoded>
			<wfw:commentRss>http://rlaskey.org/words/824/finding-rss-for-tags-categories-etc-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook: look, but don&#8217;t touch</title>
		<link>http://rlaskey.org/words/543/facebook-look-but-dont-touch/</link>
		<comments>http://rlaskey.org/words/543/facebook-look-but-dont-touch/#comments</comments>
		<pubDate>Thu, 06 May 2010 14:18:50 +0000</pubDate>
		<dc:creator>rlaskey</dc:creator>
				<category><![CDATA[Science/Technology]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://rlaskey.org/words/?p=543</guid>
		<description><![CDATA[Facebook is absolutely massive.  If you don&#8217;t have an account with them, I&#8217;d currently recommend that you stay away.  If you have an account, my advice at this point is that while it may not be worth removing your account, &#8230; <a href="http://rlaskey.org/words/543/facebook-look-but-dont-touch/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Facebook is <a href="http://www.facebook.com/press/info.php?statistics">absolutely massive</a>.  If you don&#8217;t have an account with them, I&#8217;d currently recommend that you stay away.  If you have an account, my advice at this point is that while it may not be worth removing your account, it is certainly worth limiting your exposure to the service.</p>
<p>Yes, I said exposure, as though it were some sort of bacterial infection.  There&#8217;s a bunch of information on the Internet; the one that caught my eye in a big way was Dan Yoder&#8217;s <a href="http://gizmodo.com/5530178/top-ten-reasons-you-should-quit-facebook">Top Ten Reasons You Should Quit Facebook</a>.  The <a href="http://www.eff.org/">EFF</a> also has a number of great articles related to Facebook on its <a href="http://www.eff.org/related/9769/blog">Deeplink Blogs related to Social Networks</a>.  I highly encourage everyone visiting this page to dive deeper into these articles, and for those that come in the future.</p>
<h3>Look, but don&#8217;t touch</h3>
<p>My advice to those who aren&#8217;t already in Facebook is that it&#8217;s best to stay away.  You&#8217;ve done alright by this point without it, and there are enough snags that it&#8217;s worth keeping away.</p>
<p>For those already in the system, I&#8217;m not sure that deleting your account makes all that much sense.  In many ways there is a lot of concrete value in having a Facebook account, connected to your friends and family.</p>
<p>With that said, I do think it&#8217;s best to not put any more information into the system, and to remove what Likes you have left.  Think of Facebook more as a read-only system, not as read-write.</p>
<h3>Alternatives</h3>
<p>In truth, there are countless reasonable alternatives to each of Facebook&#8217;s features, and you can rather easily find the same value outside. This may be the time to start a <a href="http://wordpress.com/">blog</a>, a <a href="http://www.bluehost.com/track/rlaskey/rlaskeyorg">website</a>, a <a href="https://twitter.com/">Twitter feed</a>, a <a href="http://www.flickr.com/">flickr</a> or <a href="http://picasaweb.google.com/">Picasa</a> account; or, sans all that, to just go back to <a href="http://mail.google.com/">email</a> as a primary mode of communication.</p>
<p>There are countless other options where you can get out what you put in, without the same threats of privacy or lock-in.  Don&#8217;t click on any of the Facebook ads, and if there are people whose content you really like, softly encourage them to put their efforts somewhere else.</p>
<p>I&#8217;m not particularly pushing Google, though their <a href="http://www.dataliberation.org/">Data Liberation Front</a> is a wonderful initiative which puts the power back towards the user.  <a href="http://wordpress.org/">WordPress</a>, additionally, makes it easy to export all your content in a <a href="http://codex.wordpress.org/Tools_Export_SubPanel">couple of clicks</a>.  <a href="http://twitter.com/">Twitter</a> has an option of <a href="http://help.twitter.com/entries/14016-public-vs-protected-accounts">protecting your content</a> from anyone beyond the list of those who you accept.</p>
<h3>Final thoughts</h3>
<p>In the end, I think the solution is by a number of small movements.  With my Facebook account, I may still &#8220;Like&#8221; someone&#8217;s status from time to time, though I&#8217;m done with Community Pages or Pages.  I&#8217;m no longer letting Facebook import my data from Netflix or <a href="http://twitter.com/rlaskey">Twitter</a>.  I&#8217;m no longer going to use its messaging, instant messaging, status updates, notes, wall posts, etc.  It&#8217;s up to you to decide where you want to go with all of these decisions, though I certainly do recommend less over time rather than more, in terms of any kinds of Facebook interactions.</p>
]]></content:encoded>
			<wfw:commentRss>http://rlaskey.org/words/543/facebook-look-but-dont-touch/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Subtle theme update</title>
		<link>http://rlaskey.org/words/307/subtle-theme-update/</link>
		<comments>http://rlaskey.org/words/307/subtle-theme-update/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 20:47:55 +0000</pubDate>
		<dc:creator>rlaskey</dc:creator>
				<category><![CDATA[Code/Systems]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://rlaskey.org/words/?p=307</guid>
		<description><![CDATA[Not moving anything around too much, though I&#8217;ve been getting tired of the strange dirt red that was there previously.  Instead, I went back to an older idea in my site before, whereby I have a few colors, one of &#8230; <a href="http://rlaskey.org/words/307/subtle-theme-update/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Not moving anything around too much, though I&#8217;ve been getting tired of the strange dirt red that was there previously.  Instead, I went back to an older idea in my site before, whereby I have a few colors, one of which is selected at random and used for the header background.  I may add in more colors as time goes on, though for the time being I&#8217;m sated.</p>
<h3>WordPress/PHP code</h3>
<p>This isn&#8217;t rocket science, though in the case that other people want to do the same, here&#8217;s what I have.  Please adapt to fit in with whatever schemes you have in your site:</p>
<blockquote><p><code>&lt;link rel="stylesheet" href="&lt;?php bloginfo('stylesheet_url'); ?&gt;" type="text/css" media="screen" /&gt;<br />
</code></p>
<p><code>&lt;?php $header_colors = array('rgb(111,111,111)', 'rgb(222,64,0)', 'rgb(0,111,222)');<br />
$header_color = $header_colors[array_rand($header_colors)]; ?&gt;<br />
</code></p>
<p><code>&lt;style type="text/css"&gt;<br />
#header {background-color:&lt;?php echo $header_color; ?&gt;;}<br />
&lt;/style&gt;</code></p></blockquote>
<p>Add to / subtract from the <code>$header_colors</code> array to make changes to the set of colors which are randomly selected.  Nothing too complicated here, but it can spice things up a bit without too much work.</p>
]]></content:encoded>
			<wfw:commentRss>http://rlaskey.org/words/307/subtle-theme-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blogging softwares and blogging conceptions</title>
		<link>http://rlaskey.org/words/247/blogging-softwares-and-blogging-conceptions/</link>
		<comments>http://rlaskey.org/words/247/blogging-softwares-and-blogging-conceptions/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 05:01:22 +0000</pubDate>
		<dc:creator>rlaskey</dc:creator>
				<category><![CDATA[Science/Technology]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://rlaskey.org/words/?p=247</guid>
		<description><![CDATA[Have been working with WordPress a lot lately, and as of today I found some nice features of the &#8220;visual&#8221; post editor: it&#8217;s possible to drag down the editing window to expand to a larger area, which for longer entries &#8230; <a href="http://rlaskey.org/words/247/blogging-softwares-and-blogging-conceptions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Have been working with WordPress a lot lately, and as of today I found some nice features of the &#8220;visual&#8221; post editor: it&#8217;s possible to drag down the editing window to expand to a larger area, which for longer entries can be quite helpful.  There&#8217;s then the &#8220;full screen&#8221; mode which similarly gives a better space to re-read and edit and write.  All in all, the WordPress system is a rather great tool, both for managing and creating content.</p>
<p>I still look back to my old &#8220;blog,&#8221; titled RINTA, which was much more cut down.  I had one text box into which I wrote, and I primarily used <a href="http://en.wikipedia.org/wiki/Textile_(markup_language)">Textile markup</a> for any sort of code or media.  That did seem to work a bit better, in terms of entries such as this where I&#8217;m leaving crumbs rather than more structured and categorized essays, as I have here.</p>
<p>Indeed, I do find that the form and the system of software does have a rather large impact on the way that I am writing.  With RINTA, I had a few close friends who I knew followed my writings, and in terms of the general Internet I never did the things that Google or any other traffic generator liked all that much.  I imagine, to the aggregating and filtering software out there, my content was a bit too primitive and possibly tied more closely to spam or some other similarly unworthy drivel.</p>
<p>Since I switched to WordPress, my numbers with Google rather improved, and I&#8217;ve been able to get more traffic from other sources by a much greater degree.  The general framework that WordPress creates is something that the Internet likes.  It&#8217;s more familiar and packaged in a more common way.  Because of that, I&#8217;ve been checking my stats much more regularly, and, eventually, thinking about finding ways to make those numbers creep up, make my audience larger.  At the end of the day it&#8217;s sort of a silly enterprise, and on the other end I&#8217;ve been a bit more reserved and concerned with making more &#8220;premium&#8221; content.  I&#8217;ve been a bit less personal, looking towards these web-crawling spider &#8220;robots.&#8221;</p>
<p>I don&#8217;t know that I particularly have a plan, now, seeing the above trends.  In the end, though, I know what is important to me is being able to get back into the mind set of what I had with RINTA, where I didn&#8217;t care quite as much about the structure or the numbers.  A website should be something a bit more about a legacy, I think; something created, fairly common, yet standing for years on the wave of bits passing through all these Internet tubes.</p>
<p>And with all of that said, I do have to say that the word &#8220;blog&#8221; really has always sounded rather dirty to me, and I hate to use it.  I try &#8220;website&#8221; or &#8220;journal&#8221; or whatever else, even though at the end of the day it&#8217;s just a word for some content and, again, by any other name my words will sound just as sweet.</p>
]]></content:encoded>
			<wfw:commentRss>http://rlaskey.org/words/247/blogging-softwares-and-blogging-conceptions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finally: a fresh theme</title>
		<link>http://rlaskey.org/words/176/finally-a-fresh-theme/</link>
		<comments>http://rlaskey.org/words/176/finally-a-fresh-theme/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 04:38:27 +0000</pubDate>
		<dc:creator>rlaskey</dc:creator>
				<category><![CDATA[Code/Systems]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://rlaskey.org/words/?p=176</guid>
		<description><![CDATA[It took me a little while, though I finally moved on to a custom theme. It is most important to note that it is highly derivative of the original &#8220;Kubrik&#8221; WordPress theme, which is the default that ships with all &#8230; <a href="http://rlaskey.org/words/176/finally-a-fresh-theme/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It took me a little while, though I finally moved on to a custom theme.  It is most important to note that it is highly derivative of the original &#8220;Kubrik&#8221; WordPress theme, which is the default that ships with all installations as of late.  However, it is also rather similar to my other site designs, with almost no graphical elements and a lot of careful placement. </p>
<p>I will hopefully get into more about the mobile version at some point.. though if you&#8217;re trying it now, this page ought to look just as good on smaller screens, as well as large.</p>
<p>One further step I&#8217;ve taken in this theme is to use a bit of WordPress functionality in adding a configuration menu, in the vein of <a href="http://codex.wordpress.org/Adding_Administration_Menus">this Codex page</a>.  I&#8217;m not getting into anything fancy, and anyone visiting really won&#8217;t care or even be able to notice.. though I now have my own simple menu by which I can place in my Google Analytics code and have it show up at the bottom of the page as it should.  Again, that&#8217;s a topic for another day, which I hopefully will not neglect to write up in more detail.  For now, I give myself a mini-yay.</p>
]]></content:encoded>
			<wfw:commentRss>http://rlaskey.org/words/176/finally-a-fresh-theme/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Theme switchup: Journalist</title>
		<link>http://rlaskey.org/words/109/theme-switchup-journalist/</link>
		<comments>http://rlaskey.org/words/109/theme-switchup-journalist/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 16:19:06 +0000</pubDate>
		<dc:creator>rlaskey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://rlaskey.org/words/?p=109</guid>
		<description><![CDATA[I started out with this site using the wonderful Arclight theme from digitalnature; today I switched over to Journalist by Lucian E. Marin. It&#8217;s a bit more subdued, and rather clean. Who knows, maybe I&#8217;ll switch up again in the &#8230; <a href="http://rlaskey.org/words/109/theme-switchup-journalist/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I started out with this site using the wonderful <a href="http://wordpress.org/extend/themes/arclite">Arclight</a> theme from <a href="http://wordpress.org/extend/themes/profile/digitalnature">digitalnature</a>; today I switched over to <a href="http://wordpress.org/extend/themes/journalist">Journalist</a> by <a href="http://wordpress.org/extend/themes/profile/kalphegor">Lucian E. Marin</a>.  It&#8217;s a bit more subdued, and rather clean.  Who knows, maybe I&#8217;ll switch up again in the near future again.  I&#8217;d really like to make my own at some point, though I&#8217;ve been lacking the time to do so in a major way, and the free offerings out there in the WP community are very good.  If other people have recommendations, feel free to put your thoughts below.</p>
<p>I&#8217;m not looking to pay for a theme at this point, and I personally don&#8217;t feel as though that cheapens the content of what I have down on the site.  If there are differing opinions on this point, of course, I&#8217;d like to hear them.</p>
]]></content:encoded>
			<wfw:commentRss>http://rlaskey.org/words/109/theme-switchup-journalist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extending WordPress Slideshow</title>
		<link>http://rlaskey.org/words/100/extending-wordpress-slideshow/</link>
		<comments>http://rlaskey.org/words/100/extending-wordpress-slideshow/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 15:09:44 +0000</pubDate>
		<dc:creator>rlaskey</dc:creator>
				<category><![CDATA[Code/Systems]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://rlaskey.org/words/?p=100</guid>
		<description><![CDATA[In a previous post I had created a system for making automated slideshows using only jQuery and the built-in WordPress attachments system. While it certainly works, I today changed around the behavior to instead read the images off sequentially, rather &#8230; <a href="http://rlaskey.org/words/100/extending-wordpress-slideshow/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In a <a href="/words/2009/09/18/wordpress-attachments-gallery-shortcode-and-jquery/">previous post</a> I had created a system for making automated slideshows using only jQuery and the built-in WordPress attachments system.   While it certainly works, I today changed around the behavior to instead read the images off sequentially, rather than picking one at random.</p>
<p>The trouble with the random selection, at least with the way I had previously coded it, was that especially for small sets of photos, you&#8217;d get the same image twice in a row.  By keeping track of a counter variable, you can easily get by this.  There are, of course, many other ways to do this, though I want to share:</p>
<blockquote><p><code>function advanceSlide(item_class, display_id)<br />
{<br />
var display = $('#' + display_id);<br />
display.empty();</code></p>
<p><code>var items = $('.' + item_class);<br />
display.append(items.eq(currentItem).clone());<br />
display.children('.' + item_class).fadeIn();</code></p>
<p><code>currentItem = (currentItem + 1) % itemCount;<br />
}</code></p>
<p><code>$(document).ready(function()<br />
{<br />
var item_class = 'gallery-item';<br />
var display_id = 'gallery-display';<br />
$('#gallery-1').before('&lt;div id="' + display_id + '"&gt;&lt;/div&gt;');<br />
$('#' + display_id).attr('style','height:500px');<br />
$('.' + item_class).hide();</code></p>
<p><code>itemCount = $('.' + item_class).size();<br />
currentItem = 0;</code></p>
<p><code> advanceSlide(item_class, display_id);<br />
setInterval("advanceSlide('" + item_class + "','" + display_id + "')", 4000);<br />
});</code></p></blockquote>
<p>The main difference is in using global variables to keep track of which image we&#8217;re on, and to keep track of how many images total we have.  The modulo operator (<code>%</code>) is a standard method for restarting the count once it reaches a certain level, which is what you want when you reach the end of the list of images.</p>
<p>Although I generally do not like global variables, using them in the above (announced by having the variable declaration without the <code>var</code> keyword, in JavaScript) certainly does cut down on the complexity of the code.</p>
]]></content:encoded>
			<wfw:commentRss>http://rlaskey.org/words/100/extending-wordpress-slideshow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress attachments + Gallery Shortcode + jQuery</title>
		<link>http://rlaskey.org/words/40/wordpress-attachments-gallery-shortcode-and-jquery/</link>
		<comments>http://rlaskey.org/words/40/wordpress-attachments-gallery-shortcode-and-jquery/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 23:28:08 +0000</pubDate>
		<dc:creator>rlaskey</dc:creator>
				<category><![CDATA[Code/Systems]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://rlaskey.org/words/?p=40</guid>
		<description><![CDATA[I had this dream that I would be able to get some vague slideshow system worked out using only the stock WordPress system and some jQuery magic. Long story short, the dream came true, though it could probably use some &#8230; <a href="http://rlaskey.org/words/40/wordpress-attachments-gallery-shortcode-and-jquery/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I had this dream that I would be able to get some vague slideshow system worked out using only the stock WordPress system and some jQuery magic.  Long story short, the dream came true, though it could probably use some further work for production use.</p>
<p>The motivation starts with <a href="http://codex.wordpress.org/Using_Image_and_File_Attachments">WordPress attachments</a>.  Combined with <a href="http://codex.wordpress.org/Gallery_Shortcode">Gallery Shortcode</a>, this system can function reasonably well for a no-frills image gallery.  All I needed for a slideshow, then, was a bit of sprucing up via <a href="http://jquery.com/">jQuery</a>.</p>
<h3>First step: Gallery Shortcode</h3>
<blockquote><p><code>&#91;gallery columns="0" size="medium" link="file" itemtag="div" icontag="span" captiontag="p"&#93;</code></p></blockquote>
<p>The above can be inserted in any post, and provides a stock arrangement of the images attached to the given page.  It uses a &#8220;medium&#8221; size of the image (original sized images only pared down via CSS style resizing; not an ultimate solution, but reasonable if you remember to resize before uploading), and utilizes <code>div</code>&#8216;s, <code>span</code>&#8216;s, and <code>p</code>&#8216;s rather than the default definition list tags.  For an extra bit of flash, we can improve upon this via the second step:</p>
<h3>Second step: using jQuery to transform this into a slideshow</h3>
<blockquote><p><code>function advanceSlide(item_class, display_id)<br />
{<br />
  var items = $('.' + item_class);<br />
  var newIndex = Math.floor(Math.random() * items.length);</p>
<p>  var display = $('#' + display_id);<br />
  display.empty();<br />
  display.append(items.eq(newIndex).clone());<br />
  display.children('.' + item_class).fadeIn();<br />
}</p>
<p>$(document).ready(function()<br />
{<br />
  var item_class = 'gallery-item';<br />
  var display_id = 'gallery-display';<br />
  $('#gallery-1').before('&lt;div id="' + display_id + '"&gt;&amp;nbsp;&lt;/div&gt;');<br />
  $('#' + display_id).attr('style','height:450px');<br />
  $('.' + item_class).hide();<br />
  advanceSlide(item_class, display_id);<br />
  setInterval("advanceSlide('" + item_class + "','" + display_id + "')", 6000);<br />
});</code></p></blockquote>
<p>The above code is a first pass, though it seems to work rather well.  For those who don&#8217;t want to parse the code alone, here&#8217;s essentially what I&#8217;m doing:</p>
<ul>
<li>a new <code>div</code> with id <em>gallery-display</em> is created above the <em>gallery-1</em> <code>div</code> which the Gallery Shortcode creates.</li>
<li>all images within <em>gallery-1</em> are hidden.</li>
<li>every six seconds, one image is selected at random, and its <code>div</code> is cloned into <em>gallery-display</em>.  Before this cloned copy is placed into <em>gallery-display</em>, the content of this destination (i.e., the previous image that was being displayed) is removed in order to make space for the incoming image.</li>
</ul>
<h3>Current limitations and methods for improvement</h3>
<p>One important point to the above is that <em>gallery-display</em> has a fixed height.  If you don&#8217;t include this part, the <code>div</code> will reduce to a zero height and then expand again to meet the new image.  In this process the screen flickers and the browser window can often get moved up a reasonable amount.</p>
<p>Even with the fixed height it&#8217;s not a perfect display, though again the intent of this example is more a proof of concept than it is a production level solution.  With that said, someone sufficiently motivated could easily enough add in the extra CSS and lines of code along the lines of other tutorials out on the web.  Other slideshow systems generally layer all of the images on the same point (i.e., top left corner of <em>gallery-display</em>) via absolute positioning.  Transitions then work by altering the z-index of the image coming into focus.</p>
<p>Also, for a small number of images the random selection here does not work all that well, as it gives the same image after itself reasonably often.  You can again fix this fairly easily by keeping an index of the current image and then incrementing, using a modulo operator to keep the value in the range of 0 and items.length.</p>
<p>With that said, if the above idea saves at least a person or two the trouble of having to deal with additional plugins or other more painful solutions, then that makes me very happy.</p>
<h3>UPDATE</h3>
<p>For those interested, I later posted a <a href="/words/2009/10/02/extending-wordpress-slideshow/">follow-up</a> to this post where I ditch the random selection for a sequential playback.</p>
]]></content:encoded>
			<wfw:commentRss>http://rlaskey.org/words/40/wordpress-attachments-gallery-shortcode-and-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress impressions</title>
		<link>http://rlaskey.org/words/34/wordpress-impressions/</link>
		<comments>http://rlaskey.org/words/34/wordpress-impressions/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 13:27:31 +0000</pubDate>
		<dc:creator>rlaskey</dc:creator>
				<category><![CDATA[Code/Systems]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://rlaskey.org/words/?p=34</guid>
		<description><![CDATA[I&#8217;m currently using WordPress for this site, and for a number of projects for work as well. For work, I am currently trying out WordPress MU, which is a system which allows for multiple WordPress installations to live together in &#8230; <a href="http://rlaskey.org/words/34/wordpress-impressions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently using <a href="http://wordpress.org/">WordPress</a> for this site, and for a number of projects for work as well.  For work, I am currently trying out <a href="http://mu.wordpress.org/">WordPress MU</a>, which is a system which allows for multiple WordPress installations to live together in a little WordPress hovel.  In general, I&#8217;ve been crazy impressed by the structure of the system, namely via the database structure and by the various built in PHP commands laid out for relatively easy hacking.</p>
<p>With that said, given that the WordPress ecosystem is rather large, the amount of crap out there is pretty incredible.  Finding plugins, for example, is a bit of a nightmare: for any given function, there&#8217;s about a million different options all named about the same thing, with scant idea as to which is the most accepted.  There&#8217;s obviously a plus to that: developers who think differently and have good ideas are not drowned out by a monoculture of ten or so solutions.  It gives the little guy a voice.  But with so many voices, it&#8217;s a bit difficult to sort out the signals.</p>
<p>Currently, I&#8217;m resigning myself to using about as much of the base functionality without any &#8220;funny stuff,&#8221; and so far I&#8217;ve been rather impressed just by how much is offered, if not hidden, in the base functionality of the stock system.  <a href="http://codex.wordpress.org/Gallery_Shortcode">Gallery Shortcode</a> is my latest revelation in this arena, whereby it is actually rather simple to organize a basic photo gallery within a post or page without the need for external plugins or management systems.  It may not be as fully featured as some other options, though it&#8217;s a built-in core functionality that seems to work and will presumably be preserved in the default installation.. so that adds up to a win, in my mind.</p>
]]></content:encoded>
			<wfw:commentRss>http://rlaskey.org/words/34/wordpress-impressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Removing revision data from the WordPress DB (v2.8)</title>
		<link>http://rlaskey.org/words/18/removing-revision-data-from-the-wordpress-db/</link>
		<comments>http://rlaskey.org/words/18/removing-revision-data-from-the-wordpress-db/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 14:58:32 +0000</pubDate>
		<dc:creator>rlaskey</dc:creator>
				<category><![CDATA[Code/Systems]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://rlaskey.org/words/?p=18</guid>
		<description><![CDATA[I have been playing with WordPress a short amount of time, though the first thing that&#8217;s getting to me is the mass of revisions that are stored in the DB. In most respects it seems to do a great job &#8230; <a href="http://rlaskey.org/words/18/removing-revision-data-from-the-wordpress-db/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have been playing with WordPress a short amount of time, though the first thing that&#8217;s getting to me is the mass of revisions that are stored in the DB.  In most respects it seems to do a great job at garbage collecting, though I noticed that the <code>wp_term_relationships</code> table does not quite keep as tidy; tags are seemingly not preserved, though categories for revisions most certainly are.  Ergo, after some delving into the DB and looking briefly over the codebase, I came up with this monster query:</p>
<blockquote><p><code>SELECT r.* FROM wp_posts p<br />
LEFT JOIN wp_term_relationships r ON r.object_id=p.id<br />
LEFT JOIN wp_term_taxonomy t ON t.term_taxonomy_id=r.term_taxonomy_id<br />
LEFT JOIN wp_terms ON t.term_id=wp_terms.term_id<br />
WHERE post_type='revision' AND taxonomy IN ('category','post_tag');</code></p></blockquote>
<p>Essentially, I&#8217;m just finding the rows in <code>wp_term_relationships</code> which are tied to revisions.  I then can write a small bit of PHP which will go through this data and run SQL <code>DELETE FROM</code> statements for each of the found rows.  You can potentially do this entirely in SQL, though you&#8217;ll need a temporary table and a series of statements due to the fact that in MySQL you cannot run a <code>DELETE FROM</code> with a <code>WHERE</code> referencing the table from which you are deleting.  Of course, once these processes are finished, you then can easily enough run the following simple query: <code>DELETE FROM wp_posts WHERE post_type='revision';</code></p>
]]></content:encoded>
			<wfw:commentRss>http://rlaskey.org/words/18/removing-revision-data-from-the-wordpress-db/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

