<?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>bavotasan.com &#187; Display</title>
	<atom:link href="http://bavotasan.com/tag/display/feed/" rel="self" type="application/rss+xml" />
	<link>http://bavotasan.com</link>
	<description>by c.bavota</description>
	<lastBuildDate>Tue, 07 Feb 2012 15:42:10 +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>Display Random Posts in WordPress</title>
		<link>http://bavotasan.com/2009/display-random-posts-in-wordpress/</link>
		<comments>http://bavotasan.com/2009/display-random-posts-in-wordpress/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 17:16:23 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[bit]]></category>
		<category><![CDATA[cat]]></category>
		<category><![CDATA[category]]></category>
		<category><![CDATA[category id]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Display]]></category>
		<category><![CDATA[List]]></category>
		<category><![CDATA[Little Bit]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=1384</guid>
		<description><![CDATA[I am working on a new WordPress site and I wanted to display a selection of random posts at the bottom of every page. It is pretty simple to do, but I also wanted to make sure that on single post pages, the current post would be excluded. That took a little bit more figuring [...]]]></description>
			<content:encoded><![CDATA[<p>I am working on a new WordPress site and I wanted to display a selection of random posts at the bottom of every page. It is pretty simple to do, but I also wanted to make sure that on single post pages, the current post would be excluded. That took a little bit more figuring out but I got it working.<br />
<span id="more-1384"></span><br />
Here is a quick piece of code to insert into your WordPress templates so that you can display a list of random posts, excluding the current post that is displayed.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$post</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$postid</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$args</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
<span style="color: #0000ff;">'orderby'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'rand'</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'showposts'</span><span style="color: #339933;">=&gt;</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'post__not_in'</span><span style="color: #339933;">=&gt;</span>array<span style="color: #009900;">&#40;</span><span style="color: #000088;">$postid</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
query_posts<span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;ul&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;li&gt;&lt;a href=&quot;'</span><span style="color: #339933;">.</span>get_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; title=&quot;'</span><span style="color: #339933;">.</span>the_title<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">.</span>the_title<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;&lt;/li&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;/ul&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>You can always change the number of random posts displayed by increasing or decreasing the &#8216;showposts&#8217; variable. You can also make it category specific by adding a <code>'cat'=>24,</code> to the $args array, where &#8217;24&#8242; is the category ID.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/display-random-posts-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Clearing the &lt;hr /&gt; Tag with CSS That Works in IE</title>
		<link>http://bavotasan.com/2009/clearing-the-hr-tag-with-css-that-works-in-ie/</link>
		<comments>http://bavotasan.com/2009/clearing-the-hr-tag-with-css-that-works-in-ie/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 21:39:09 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[anyone]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Display]]></category>
		<category><![CDATA[Explorer]]></category>
		<category><![CDATA[height]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Lt]]></category>
		<category><![CDATA[overflow]]></category>
		<category><![CDATA[Padding]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[tag]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[use]]></category>
		<category><![CDATA[visibility]]></category>
		<category><![CDATA[Width]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=941</guid>
		<description><![CDATA[There is nothing more annoying than Internet Explorer. Every time you build a site you usually need to add a few CSS hacks just to make sure it works in IE. Here is some nice CSS to help anyone who wants to use &#60;hr /&#62; tags to clear sections of their site. hr.clear &#123; background: [...]]]></description>
			<content:encoded><![CDATA[<p>There is nothing more annoying than Internet Explorer. Every time you build a site you usually need to add a few CSS hacks just to make sure it works in IE.</p>
<p>Here is some nice CSS to help anyone who wants to use &lt;hr /&gt; tags to clear sections of their site.<br />
<span id="more-941"></span></p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;">hr.<span style="color: #000000; font-weight: bold;">clear</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">both</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">visibility</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #00AA00;">&#125;</span></pre></div></td></tr></table></div>

<p>Just use the following code whenever you want to clear with an  &lt;hr /&gt; tag.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>hr <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;clear&quot;</span> <span style="color: #339933;">/&gt;</span></pre></div></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/clearing-the-hr-tag-with-css-that-works-in-ie/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Simple Image Grabber WordPress Plugin</title>
		<link>http://bavotasan.com/2009/simple-image-grabber-wordpress-plugin/</link>
		<comments>http://bavotasan.com/2009/simple-image-grabber-wordpress-plugin/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 21:35:15 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Downloads]]></category>
		<category><![CDATA[alignleft]]></category>
		<category><![CDATA[alignright]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Display]]></category>
		<category><![CDATA[fan]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[Images]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[Second Image]]></category>
		<category><![CDATA[Width]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=382</guid>
		<description><![CDATA[I created a plugin for the function I talked about in my post Retrieve and Display Images from a WordPress Post just in case there is anyone out there who isn&#8217;t a fan of hacking code. Just install this sucker and use the following function: &#60;?php images&#40;$number, $width, $height, $class, $link&#41;; ?&#62; Make sure it [...]]]></description>
			<content:encoded><![CDATA[<p>I created a plugin for the function I talked about in my post <a href="http://bavotasan.com/tidbits/retrieve-the-first-image-from-a-wordpress-post/">Retrieve and Display Images from a WordPress Post</a> just in case there is anyone out there who isn&#8217;t a fan of hacking code.<span id="more-382"></span> Just install this sucker and use the following function:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> images<span style="color: #009900;">&#40;</span><span style="color: #000088;">$number</span><span style="color: #339933;">,</span> <span style="color: #000088;">$width</span><span style="color: #339933;">,</span> <span style="color: #000088;">$height</span><span style="color: #339933;">,</span> <span style="color: #000088;">$class</span><span style="color: #339933;">,</span> <span style="color: #000088;">$link</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></td></tr></table></div>

<p>Make sure it is within the loop and it will display whichever image you want.</p>
<p>$number = the image you want to pull from your post, ie. the first image from the post (&#8217;1&#8242;) or the second image from the post (&#8217;2&#8242;) and so on. NOTE: If you use &#8216;all&#8217;, it will display all images from the post.</p>
<p>$width = the width of the displayed image</p>
<p>$height = the height of the displayed image</p>
<p>$class = the class name you would like to assign to the displayed image</p>
<p>$link = whether you would like the displayed image to link to the post or not</p>
<p>So, the following function:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> images<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'2'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'150'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'200'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'alignleft'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></td></tr></table></div>

<p>would display the second image from a post (if there is one) with a width of 150px and a height of 200px, the class name alignleft and no link to the post.</p>
<p>The following:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> images<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'all'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'alignright'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></td></tr></table></div>

<p>would display all images from a post with their original width and height, a class name of alignright and a link to the post.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/simple-image-grabber-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>145</slash:comments>
		</item>
	</channel>
</rss>

