<?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>CodeJoust Blog &#187; Websites</title>
	<atom:link href="http://iain.codejoust.com/tag/websites/feed/" rel="self" type="application/rss+xml" />
	<link>http://iain.codejoust.com</link>
	<description>Iain's thoughts, ideas, interests from CodeJoust</description>
	<lastBuildDate>Wed, 07 Jul 2010 21:05:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Wordpress Quick Tip</title>
		<link>http://iain.codejoust.com/2010/02/wordpress-quick-tip/</link>
		<comments>http://iain.codejoust.com/2010/02/wordpress-quick-tip/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 00:50:19 +0000</pubDate>
		<dc:creator>Code Dude</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://iain.codejoust.com/?p=315</guid>
		<description><![CDATA[There are times when you might want to display your blog posts on a page other than the blog page in Wordpress. To successfully do this, requires a short piece of PHP code. For example, you could show your latest work on the homepage on your website. Here&#8217;s the code I used to show my [...]]]></description>
			<content:encoded><![CDATA[<p>There are times when you might want to display your blog posts on a page other than the blog page in Wordpress. To successfully do this, requires a short piece of PHP code. For example, you could show your latest work on the homepage on your website. Here&#8217;s the code I used to show my latest work on a portfolio I was building for myself. </p>
<p>There is however, something else that made this extra hard. I wanted to integrate it with the Jquery <a href="http://fancybox.net/">Fancybox</a> plugin. To do required some extra code that didn&#8217;t make things simpler. </p>
<p>The basic code outline for using Fancybox for your images is this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;a href=&quot;the url to the normal sized version of the image&quot; title=&quot;The name of the image” class=&quot;zoom&quot;&gt;
&lt;img src=&quot;the url to thumbnail sizes version of the image&quot; /&gt;
&lt;/a&gt;</pre></div></div>

<p>This presents some problems with integrating this into Wordpress. Here how I changed it to work with Wordpress posts.</p>
<p><img class="hide" style="display:none;" src="http://iain.codejoust.com/wp-content/uploads/2010/02/php1.png" alt="php" width="556" height="225" class="alignnone size-full wp-image-324" /></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$postslist</span> <span style="color: #339933;">=</span> get_posts<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'numberposts=3&amp;order=ASC&amp;orderby=title'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
	<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$postslist</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$post</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> 
	setup_postdata<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> 
	&lt;div class=&quot;project&quot;&gt;
		&lt;a class=&quot;zoom&quot; 
                      rel=&quot;group&quot;
                      title=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;
                      href=&quot;wp-content/themes/starkers/style/images/<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>.png&quot;&gt;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	        &lt;/a&gt;
	&lt;h4&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h4&gt; 
	&lt;/div&gt;			
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endforeach</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>The first 4 lines are the php that grab the posts. (Note I set it to show the 3 latest posts.)<br />
In the 5th line I enclose each post in a div with an id of &#8220;project&#8221;.<br />
In the 6th line, there are the basic Fancybox classes that make it work in this particular image.<br />
On the 7th line, I set the name of the image to the title of the post<br />
On the 8th line, I set the url of the normal sized version of the image, in this case it was an image in the theme&#8217;s image folder. Notice how I used &#8220;the_title();&#8221; in the url to make it dynamic for each post.<br />
On the 9th line I just set it to grab the content of the post<br />
10th line-closing out the link<br />
On the 11th line I grab the title of the post<br />
And then close the div and end the foreach statement.</p>
<p>There is one thing you have to do manually to make this work. Set a unique category for the posts to be used here. In this case I used the category &#8220;1&#8243;</p>
<p>Also, the body of the post must only have the small version of the image in it. </p>
<p>Pretty cool, heh?</p>
]]></content:encoded>
			<wfw:commentRss>http://iain.codejoust.com/2010/02/wordpress-quick-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PrivacyChoice &#8211; Online Privacy Service</title>
		<link>http://iain.codejoust.com/2009/05/privacychoice-online-privacy-service/</link>
		<comments>http://iain.codejoust.com/2009/05/privacychoice-online-privacy-service/#comments</comments>
		<pubDate>Sun, 10 May 2009 21:52:11 +0000</pubDate>
		<dc:creator>Iain</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[lifehacker]]></category>
		<category><![CDATA[online]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Websites]]></category>

		<guid isPermaLink="false">http://iain.codejoust.com/?p=170</guid>
		<description><![CDATA[Web site Privacychoice rolls the opt-out routines for a couple dozen advertising networks into a single javascript button—so you can stop them tracking you without having to mess with cookie settings. from Lifehacker
PrivacyChoice.org.
]]></description>
			<content:encoded><![CDATA[<blockquote><p>Web site Privacychoice rolls the opt-out routines for a couple dozen advertising networks into a single javascript button—so you can stop them tracking you without having to mess with cookie settings. <small>from <a href="http://lifehacker.com/5170408/privacychoice-stops-advertisers-froma-profiling-you">Lifehacker</a></small></p></blockquote>
<p><small><a href="http://www.privacychoice.org/">PrivacyChoice.org</a>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://iain.codejoust.com/2009/05/privacychoice-online-privacy-service/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

