<?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; php</title>
	<atom:link href="http://iain.codejoust.com/tag/php/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>Learning PHP &#8211; xHTML &#8211; CSS</title>
		<link>http://iain.codejoust.com/2009/05/learning-php-xhtml-css/</link>
		<comments>http://iain.codejoust.com/2009/05/learning-php-xhtml-css/#comments</comments>
		<pubDate>Wed, 06 May 2009 03:41:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Hobbies]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://iain.codejoust.com/?p=94</guid>
		<description><![CDATA[Do you want to learn how to write, tweak websites?
I&#8217;ve always liked computers, websites, and have recently started getting into PHP after learning xHTML and CSS.
Throughout this process, I&#8217;ve discovered lots of great resources and learned lots of great things.
Some of these are there is always something to learn or do. This stuff fascinates me.
If [...]]]></description>
			<content:encoded><![CDATA[<p>Do you want to learn how to write, tweak websites?</p>
<p>I&#8217;ve always liked computers, websites, and have recently started getting into PHP after learning xHTML and CSS.</p>
<p>Throughout this process, I&#8217;ve discovered lots of great resources and learned lots of great things.</p>
<p>Some of these are there is always something to learn or do. This stuff fascinates me.</p>
<p>If you are interested in learning more about (x)HTML (to get your feet wet <img src='http://iain.codejoust.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ), visit my favorite tutorial for getting started in (x)HTML (and no, it isn&#8217;t HTML for dummies) &#8212; <a href="http://htmldog.com/guides/htmlbeginner/" target="_blank">http://htmldog.com</a>. There, just thumb through the tutorials, do the exercises (if you wish).</p>
<p>Once you&#8217;ve done that, I&#8217;d recommend looking further at <a href="http://w3schools.com">W3Schools</a> and <a href="http://tizag.com">Tizag.com</a>, both are more indepth, but they can help you find out how to do something and supplement what you&#8217;ve already done.</p>
<p>Then, consider reading the <a href="http://www.nettuts.com/">nettuts.com</a> (great all-around tutorial website) and <a href="http://cssnewbie.com/">CSS Newbie</a> (css help and interesting tutorials) and <a href="http://alistapart.com/">AlistApart.com</a> (slightly more technical, but great archives, pioneering techniques).</p>
<p>Phew! Some fun stuff to look at for learning javascript, go to <a href="http://w3schools.com/">W3Schools</a>&#8217;s tutorial and <a href="http://tizag.com/">Tizag Tutorials</a>. Then, look at <a href="http://jquery.com/">jquery.com</a> or another javascript framework, like <a href="http://www.prototypejs.org/">Prototype Javascript</a>. A good resource for jquery is <a href="http://jqueryfordesigners.com/">http://jqueryfordesigners.com/</a>.</p>
<p>And, some good PHP tutorials can be found in this article, I&#8217;ll get to more in depth ones later. &#8212; <a href="http://nettuts.com/articles/web-roundups/25-resources-to-get-you-started-with-php-from-scratch/">Nettuts PHP from Scratch</a>.</p>
<p>If you still want links <img src='http://iain.codejoust.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  look at this article (which probably includes the kitchen sink <img src='http://iain.codejoust.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> ) &#8211; <a href="http://blog.themeforest.net/resources/html-css-php-and-jquery-killer-tutorials/">blog.themeforest.net</a>.</p>
<p>If you have any questions, feel free to leave a comment, and I&#8217;ll consider writing a tutorial or just emailing you if you need help.</p>
<p>When things quiet down around here, I&#8217;ll start writing my own tutorials here.</p>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://iain.codejoust.com/2009/05/learning-php-xhtml-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
