<?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>It's Called Web Design &#187; PHP</title>
	<atom:link href="http://itscalledwebdesign.com/category/tutorials/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://itscalledwebdesign.com</link>
	<description>Web 2.0 is so 2004. . . .</description>
	<lastBuildDate>Fri, 27 Jan 2012 16:59:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Random Image</title>
		<link>http://itscalledwebdesign.com/tutorials/random-image/</link>
		<comments>http://itscalledwebdesign.com/tutorials/random-image/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 21:13:56 +0000</pubDate>
		<dc:creator>eckert</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[randomizer]]></category>
		<category><![CDATA[rotator]]></category>

		<guid isPermaLink="false">http://itscalledwebdesign.com/?p=592</guid>
		<description><![CDATA[Do you want to have a group of random images pop-up on the page using PHP? Before we go any further, this does not allow each image to link to a different location. Copy this code into your header and modify it to represent wherever the images are located: &#60;style type="text/css"&#62; #randomimage { background:url(http://yourdomain.com/imagesfolder/randomimage&#60;?php echo [...]]]></description>
			<content:encoded><![CDATA[<p>Do you want to have a group of random images pop-up on the page using PHP?<br />
<span id="more-592"></span><br />
Before we go any further, this does not allow each image to link to a different location.</p>
<p>Copy this code into your header and modify it to represent wherever the images are located:</p>
<pre>&lt;style type="text/css"&gt;
#randomimage { background:url(http://yourdomain.com/imagesfolder/randomimage&lt;?php echo (rand()%10); ?&gt;.jpg); }
&lt;/style&gt;</pre>
<p>Copy this code into your page where you want the images to show up:</p>
<pre>&lt;div id="randomimage"&gt;&lt;/div&gt;</pre>
<p>Copy this into your CSS and modify accordingly:</p>
<pre>#randomimage {
}</pre>
<p>Now, you can change the name of the div and you can also put the images wherever you want, just make sure you change the path so that they match.</p>
<p>One very important thing about this code is that you need to have 10 images.  Also, the images need to be named very specifically.</p>
<p>Using this code, the images have to be named: randomimage0.jpg, randomimage1.jpg&#8230; and continuing up through randomimage9.jpg.  If you do not have an image representing this, then nothing will show up on your page.</p>
<p>While not necessarily the best php image randomizer I&#8217;ve seen, it&#8217;s quick and will get the job done.</p>
]]></content:encoded>
			<wfw:commentRss>http://itscalledwebdesign.com/tutorials/random-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create PHP web submission forms in minutes</title>
		<link>http://itscalledwebdesign.com/tutorials/php/create-php-web-submission-forms-in-minutes/</link>
		<comments>http://itscalledwebdesign.com/tutorials/php/create-php-web-submission-forms-in-minutes/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 19:41:49 +0000</pubDate>
		<dc:creator>Lloyd Armbrust</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://itscalledwebdesign.com/?p=409</guid>
		<description><![CDATA[Easily create a slick PHP submit form in minutes with absolutly no coding experience needed. Simply go here: http://phpformgen.sourceforge.net/new_demo/phpformgen/ and use the generator.  It&#8217;s free and easy.]]></description>
			<content:encoded><![CDATA[<p>Easily create a slick PHP submit form in minutes with absolutly no coding experience needed.  Simply go here: <a href="http://phpformgen.sourceforge.net/new_demo/phpformgen/">http://phpformgen.sourceforge.net/new_demo/phpformgen/</a> and use the generator.  It&#8217;s free and easy.</p>
]]></content:encoded>
			<wfw:commentRss>http://itscalledwebdesign.com/tutorials/php/create-php-web-submission-forms-in-minutes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WP Theme Disciple &#8220;About Blog&#8221; fix</title>
		<link>http://itscalledwebdesign.com/tutorials/php/wp-theme-disciple-about-blog-fix/</link>
		<comments>http://itscalledwebdesign.com/tutorials/php/wp-theme-disciple-about-blog-fix/#comments</comments>
		<pubDate>Tue, 30 Sep 2008 15:12:28 +0000</pubDate>
		<dc:creator>Lloyd Armbrust</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress Themes]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://itscalledwebdesign.com/?p=221</guid>
		<description><![CDATA[Here is a really great theme from regis that you can download from the new WP Theme repository. I really liked the simple clean design, but I was upset to find that the author hard-coded an &#8220;About my blog&#8221; mini-post with a picture (of the author) into the themes sidebar. I thought it would be [...]]]></description>
			<content:encoded><![CDATA[<p><img class="screenshot alignleft" style="padding: 5px; width: 240px; height: 180px;" src="http://wp-themes.com/wp-content/themes/disciple/screenshot.png" alt="screenshot" /></p>
<p>Here is a really great theme from <a href="http://wnw.blogwarhammer.net/themes/disciple/">regis</a> that you can download from the new <a href="http://wordpress.org/extend/themes/disciple">WP Theme </a>repository.</p>
<p>I really liked the simple clean design, but I was upset to find that the author hard-coded an &#8220;About my blog&#8221; mini-post with a picture (of the author) into the themes sidebar.  I thought it would be much better if the author would have pulled some text from the default WP &#8220;About&#8221; page.<br />
<span id="more-221"></span><br />
<br clear="all" /></p>
<pre class="syntax-highlight:php">
&lt;?php
    query_posts(&#039;pagename=about&#039;);
    if (have_posts()) :  while (have_posts()) : the_post();
?&gt;
        &lt;li class=&quot;widget&quot;&gt;
       &lt;h2&gt;&lt;?php the_title(); ?&gt;&lt;/h2&gt;
       &lt;p&gt;&lt;?php the_content(&#039;&lt;p&gt;&lt;b&gt;Continue Reading &amp;amp;amp;raquo;&lt;/b&gt;&lt; p&gt;&#039;); ?&gt;&lt;/p&gt;
        &lt;/li&gt;
&lt;?php
    endwhile; else : ?&gt;&lt;?php endif;
?&gt;
</pre>
<p>All you have to do is replace the authors hard-coded &#8220;about the blog&#8221; post with the above code. Of course, it would be better if the theme came shipped this way&#8211;as it such a great theme that many none-coders would use.  But I do understand why the author would want to keep their own personal touch.</p>
<p>You can download the theme from the authors site: <a href="http://wnw.blogwarhammer.net/themes/disciple/">http://wnw.blogwarhammer.net/themes/disciple/</a><br />
Or, from the WP Theme repository: <a href="http://wordpress.org/extend/themes/disciple">http://wordpress.org/extend/themes/disciple</a></p>
]]></content:encoded>
			<wfw:commentRss>http://itscalledwebdesign.com/tutorials/php/wp-theme-disciple-about-blog-fix/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Publish the date automatically w/ PHP</title>
		<link>http://itscalledwebdesign.com/tutorials/php/publish-the-date-automatically-w-php/</link>
		<comments>http://itscalledwebdesign.com/tutorials/php/publish-the-date-automatically-w-php/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 02:01:13 +0000</pubDate>
		<dc:creator>eckert</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://itscalledwebdesign.com/?p=206</guid>
		<description><![CDATA[Want to have the current date on your site? Insert the following lines of code into your site: &#60;?php $my_t=getdate(date("U")); print("$my_t[weekday], $my_t[month] $my_t[mday], $my_t[year]"); ?&#62; The variables being used are weekday, month, numeric date and year. You can remove any of these depending on what you want the output to be.]]></description>
			<content:encoded><![CDATA[<p>Want to have the current date on your site?<br />
<span id="more-206"></span>Insert the following lines of code into your site:</p>
<pre>&lt;?php $my_t=getdate(date("U")); print("$my_t[weekday], $my_t[month] $my_t[mday], $my_t[year]"); ?&gt;</pre>
<p>The variables being used are weekday, month, numeric date and year.  You can remove any of these depending on what you want the output to be.</p>
]]></content:encoded>
			<wfw:commentRss>http://itscalledwebdesign.com/tutorials/php/publish-the-date-automatically-w-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t use Meta Redirect!</title>
		<link>http://itscalledwebdesign.com/tutorials/html/dont-use-meta-redirect/</link>
		<comments>http://itscalledwebdesign.com/tutorials/html/dont-use-meta-redirect/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 21:26:01 +0000</pubDate>
		<dc:creator>Lloyd Armbrust</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[meta]]></category>
		<category><![CDATA[redirect]]></category>

		<guid isPermaLink="false">http://itscalledwebdesign.com/?p=198</guid>
		<description><![CDATA[Okay, sometimes you need to move (redirect) an HTML page. It happens to everyone! But really want to never ever never Meta Redirects. In fact, the W3C has pronounced it in their top ten mistakes of new web design: http://www.w3.org/QA/Tips/reback If you can&#8217;t or won&#8217;t make an .htaccess redirect, perhaps you can use another language [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, sometimes you need to move (redirect) an HTML page.  It happens to everyone! But really want to never ever never <a href="http://itscalledwebdesign.com/meta-redirect/">Meta Redirects</a>.  In fact, the W3C has pronounced it in their top ten mistakes of new web design: http://www.w3.org/QA/Tips/reback<br />
<span id="more-198"></span><br />
If you can&#8217;t or won&#8217;t make an <a href="http://itscalledwebdesign.com/htaccess-redirect/">.htaccess redirect</a>, perhaps you can use another language at your disposal. </p>
<p>For example:</p>
<p>ColdFusion Redirect:</p>
<pre>
<.cfheader statuscode="301" statustext="Moved permanently">
<.cfheader name="Location" value="http://www.new-url.com">
</pre>
<p>PHP Redirect:</p>
<pre>
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.new-url.com" );
</pre>
<p>ASP Redirect:</p>
<pre>
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www.new-url.com/"
%>
</pre>
<p>JSP (Java) Redirect:</p>
<pre>
<%
response.setStatus(301);
response.setHeader( "Location", "http://www.new-url.com/" );
response.setHeader( "Connection", "close" );
%>
</pre>
<p>CGI PERL Redirect:</p>
<pre>
$q = new CGI;
print $q->redirect("http://www.new-url.com/");
</pre>
<p>Ruby on Rails Redirect:</p>
<pre>
def old_action
headers["Status"] = "301 Moved Permanently"
redirect_to "http://www.new-url.com/"
end
</pre>
<p>And if you have CPanel, Plesk, or some other web-based domain-management system they probably have a way for you to tap directly into Apache and make that change in a nice GUI.  </p>
<p>If some inexplicatble reason you are compelled to use Meta Redirects, please use the techniques found here so that Google and your browser can make sense of what&#8217;s going on:</p>
<p>http://itscalledwebdesign.com/meta-redirect/</p>
<p>Some external links: </p>
<p>http://www.webconfs.com/how-to-redirect-a-webpage.php</p>
<p>http://en.wikipedia.org/wiki/URL_redirection</p>
]]></content:encoded>
			<wfw:commentRss>http://itscalledwebdesign.com/tutorials/html/dont-use-meta-redirect/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WordPress Lightbox Fix</title>
		<link>http://itscalledwebdesign.com/tutorials/wordpress-lightbox-fix/</link>
		<comments>http://itscalledwebdesign.com/tutorials/wordpress-lightbox-fix/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 00:05:26 +0000</pubDate>
		<dc:creator>Rief</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://itscalledwebdesign.com/?p=178</guid>
		<description><![CDATA[I recently installed the Lightbox WordPress plugin and started having an &#8220;operation abort&#8221; error message on both IE6 and 7 that would crash the browser. I found the the crash was being caused from the plugin, but the fix was very easy. Login Navigate to plugins and select edit on the Lightbox plugin At the [...]]]></description>
			<content:encoded><![CDATA[<p>I recently installed the Lightbox WordPress plugin and started having an &#8220;operation abort&#8221; error message on both IE6 and 7 that would crash the browser.  I found the the crash was being caused from the plugin, but the fix was very easy.</p>
<ol>
<li>Login</li>
<li>Navigate to plugins and select edit on the Lightbox plugin</li>
<li>At the bottom of the code change wp_head to wp_footer</li>
<li>Click update, and you are done.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://itscalledwebdesign.com/tutorials/wordpress-lightbox-fix/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Get Recent Posts</title>
		<link>http://itscalledwebdesign.com/tutorials/get-recent-posts/</link>
		<comments>http://itscalledwebdesign.com/tutorials/get-recent-posts/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 20:10:02 +0000</pubDate>
		<dc:creator>eckert</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[get]]></category>
		<category><![CDATA[posts]]></category>
		<category><![CDATA[recent]]></category>

		<guid isPermaLink="false">http://itscalledwebdesign.com/?p=79</guid>
		<description><![CDATA[Stick this in your sidebar&#8230; &#8230;that&#8217;s what she said. Get Recent Posts (5) &#60;h2&#62;Recent Posts&#60;/h2&#62; &#60;ul&#62; &#60;?php wp_get_archives('type=postbypost&#38;limit=5'); ?&#62; &#60;/ul&#62;]]></description>
			<content:encoded><![CDATA[<p>Stick this in your sidebar&#8230;<br />
<span id="more-79"></span></p>
<p>&#8230;that&#8217;s what she said.</p>
<p><strong>Get Recent Posts (5)</strong></p>
<pre>&lt;h2&gt;Recent Posts&lt;/h2&gt;
   &lt;ul&gt;
     &lt;?php wp_get_archives('type=postbypost&amp;limit=5'); ?&gt;
   &lt;/ul&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://itscalledwebdesign.com/tutorials/get-recent-posts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Page Templates</title>
		<link>http://itscalledwebdesign.com/tutorials/wordpress-page-templates/</link>
		<comments>http://itscalledwebdesign.com/tutorials/wordpress-page-templates/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 19:30:43 +0000</pubDate>
		<dc:creator>eckert</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://itscalledwebdesign.com/?p=44</guid>
		<description><![CDATA[You can make your own page templates for WP by making a new PHP file on the server. Name it accordingly, for this example, I will call it specialpage.php. Within that file place the following code at the top &#60;?php /* Template Name: specialpage */ ?&#62; Now you can continue with your page.  Use the [...]]]></description>
			<content:encoded><![CDATA[<p>You can make your own page templates for WP by making a new PHP file on the server.  Name it accordingly, for this example, I will call it specialpage.php.<br />
<span id="more-44"></span></p>
<p>Within that file place the following code at the top</p>
<pre>&lt;?php
/*
Template Name: specialpage
*/
?&gt;</pre>
<p>Now you can continue with your page.  Use the default wordpress codes for getting your header, sidebar and footer and do whatever you want in between.  I usually just copy and paste all the code from the default page.php and then modify it accordingly.</p>
<p>When editing a page, select Page Templates in the bottom options.  If you&#8217;ve done this correctly, you will see specialpage as an option.  Select it for whichever pages you desire and those pages will follow that template.</p>
]]></content:encoded>
			<wfw:commentRss>http://itscalledwebdesign.com/tutorials/wordpress-page-templates/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Text Navs</title>
		<link>http://itscalledwebdesign.com/tutorials/text-navs/</link>
		<comments>http://itscalledwebdesign.com/tutorials/text-navs/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 18:45:12 +0000</pubDate>
		<dc:creator>eckert</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://itscalledwebdesign.com/?p=40</guid>
		<description><![CDATA[This is how you put text-based navigation in your header, or anywhere else for that matter. This is going to be set up using a &#60;div&#62; labeled &#8220;nav&#8221;.  You can change it, but make sure you change it acrossed the board, otherwise it won&#8217;t work. In your header, place the following code - &#60;div id="nav"&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>This is how you put text-based navigation in your header, or anywhere else for that matter.<br />
<span id="more-40"></span></p>
<p>This is going to be set up using a &lt;div&gt; labeled &#8220;nav&#8221;.  You can change it, but make sure you change it acrossed the board, otherwise it won&#8217;t work.</p>
<p>In your header, place the following code -</p>
<pre id="line49">&lt;<span class="start-tag">div</span><span class="attribute-name"> id</span>=<span class="attribute-value">"nav"</span>&gt;
&lt;<span class="start-tag">ul</span>&gt;
&lt;<span class="start-tag">li</span>&gt;&lt;<span class="start-tag">a</span><span class="attribute-name"> href</span>=<span class="attribute-value">"http://yourdomain.com/page1"</span>&gt;Page 1&lt;/<span class="end-tag">a</span>&gt;&lt;/<span class="end-tag">li</span>&gt;
&lt;<span class="start-tag">li</span>&gt;&lt;<span class="start-tag">a</span><span class="attribute-name"> href</span>=<span class="attribute-value">"</span><span class="attribute-value">http://yourdomain.com/page2</span><span class="attribute-value">"</span>&gt;Page 2&lt;/<span class="end-tag">a</span>&gt;&lt;/<span class="end-tag">li</span>&gt;
&lt;<span class="start-tag">li</span>&gt;&lt;<span class="start-tag">a</span><span class="attribute-name"> href</span>=<span class="attribute-value">"</span><span class="attribute-value">http://yourdomain.com/page</span>3<span class="attribute-value">"</span>&gt;Page 3&lt;/<span class="end-tag">a</span>&gt;&lt;/<span class="end-tag">li</span>&gt;
&lt;/<span class="end-tag">ul</span>&gt;
&lt;/<span class="end-tag">div</span>&gt;</pre>
<p>Now these links are not dynamic, you will have to add or subtract the pages that you want listed.</p>
<p>If you want them dynamic, in WordPress simply use this -</p>
<pre id="line49">&lt;<span class="start-tag">div</span><span class="attribute-name"> id</span>=<span class="attribute-value">"nav"</span>&gt;
&lt;<span class="start-tag">ul</span>&gt;
&lt;<span class="start-tag">li</span>&gt;&lt;?php wp_list_pages('title_li='); ?&gt;&lt;/li&gt;
&lt;/<span class="end-tag">ul</span>&gt;
&lt;/<span class="end-tag">div</span>&gt;</pre>
<p>My only issue with doing this, is that it will include all your WordPress pages, which you may not want.  You can still use this, but you will need to change the php code to -</p>
<pre>  &lt;?php wp_list_pages('exclude=17,38' ); ?&gt;</pre>
<p>with the exclude numbers representing the pages that you want excluded.  More examples of how to change how this list works can be found in the WordPress Codex <a href="http://codex.wordpress.org/wp_list_pages" target="_blank">HERE</a>.</p>
<p>Now for the CSS.</p>
<p>Copy the following code into your CSS file -</p>
<pre>#nav	{
	width: 475px;
	height: 37px;
	margin: 0 auto;
	padding: 0;
	font-size: 14px;
	position: relative;
	left: 190px;
	z-index: 99;
	color: #fff;
	line-height: 33px;
}

#nav ul {
	list-style:  none;
	margin: 0;
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

#nav li	{
	list-style:  none;
	float: left;
	padding: 0 4px;
	background: none;
}

#nav a {
	display: block;
	font: bold 0.9em Arial, san-serif;
	text-transform: uppercase;
	color: #fff;
	text-align: center;
	line-height: 37px;
	vertical-align: middle;
}

#nav a:hover {
	line-height: 37px;
	vertical-align: middle;
	color: #000;
	text-decoration: none !important;
}</pre>
<p>This code is set up so that it will be a navigation bar that is 475px wide and 37px tall.  The text link will be white (#fff) and then change to black (#000) when hovered.  There is no underline, since text-decoration on the a:hover is set to none.  You can change this to underline or any other hover variable you prefer.  The text in this case is also all caps due to the &#8220;text-transform: uppercase;&#8221;.  You can remove that line if you want the text to appear as written.</p>
<p>To create more or less space between the words, simply increase or decrease the second number in the nav li padding.  Currently, each &lt;li&gt; has a 4px padding on both the left and the right sides.  Note, if you increase this padding much, or have more than a couple links, you will need to increase the width of the nav div.  Otherwise, the links will drop down onto a second line.</p>
]]></content:encoded>
			<wfw:commentRss>http://itscalledwebdesign.com/tutorials/text-navs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Better image navigation</title>
		<link>http://itscalledwebdesign.com/tutorials/better-image-navigation/</link>
		<comments>http://itscalledwebdesign.com/tutorials/better-image-navigation/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 14:52:13 +0000</pubDate>
		<dc:creator>eckert</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[nav]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[next]]></category>
		<category><![CDATA[previous]]></category>

		<guid isPermaLink="false">http://itscalledwebdesign.com/?p=16</guid>
		<description><![CDATA[if you are using the wordpress image.php to show your photos, you know that the next and previous photo option sucks.  I&#8217;m sure they&#8217;ll fix it in a soon-to-be-released update, but for now, use this: Place this code in your functions.php - add_action( &#8216;init&#8217;, &#8216;mf_text_based_image_links&#8217; ); function mf_text_based_image_links() { if ( function_exists( &#8216;mf_previous_image_link&#8217; ) === [...]]]></description>
			<content:encoded><![CDATA[<p>if you are using the wordpress image.php to show your photos, you know that the next and previous photo option sucks.  I&#8217;m sure they&#8217;ll fix it in a soon-to-be-released update, but for now, use this:<br />
<span id="more-16"></span></p>
<p>Place this code in your functions.php -</p>
<p>add_action( &#8216;init&#8217;, &#8216;mf_text_based_image_links&#8217; );</p>
<p>function mf_text_based_image_links() {</p>
<p>if ( function_exists( &#8216;mf_previous_image_link&#8217; ) === false ) {<br />
function mf_previous_image_link( $link_text=&#8217;Previous Image&#8217; ) {<br />
if ( $l = mf_adjacent_image_link( $link_text, true ) )<br />
print $l;<br />
else<br />
print &#8216;&lt;span class=&#8221;inactive&#8221;&gt;&#8217; . $link_text . &#8216;&lt;/span&gt;&#8217;;<br />
}<br />
}</p>
<p>if ( function_exists( &#8216;mf_next_image_link&#8217; ) === false ) {<br />
function mf_next_image_link( $link_text=&#8217;Next Image&#8217; ) {<br />
if ( $l = mf_adjacent_image_link( $link_text, false ) )<br />
print $l;<br />
else<br />
print &#8216;&lt;span class=&#8221;inactive&#8221;&gt;&#8217; . $link_text . &#8216;&lt;/span&gt;&#8217;;<br />
}<br />
}</p>
<p>if ( function_exists( &#8216;mf_adjacent_image_link&#8217; ) === false ) {<br />
function mf_adjacent_image_link( $link_text, $prev = true ) {<br />
global $post;<br />
$post = get_post($post);<br />
$attachments = array_values(get_children( array(&#8216;post_parent&#8217; =&gt; $post-&gt;post_parent, &#8216;post_status&#8217; =&gt; &#8216;inherit&#8217;, &#8216;post_type&#8217; =&gt; &#8216;attachment&#8217;, &#8216;post_mime_type&#8217; =&gt; &#8216;image&#8217;, &#8216;order&#8217; =&gt; &#8216;ASC&#8217;, &#8216;orderby&#8217; =&gt; &#8216;menu_order ID&#8217;) ));</p>
<p>foreach ( $attachments as $k =&gt; $attachment )<br />
if ( $attachment-&gt;ID == $post-&gt;ID )<br />
break;</p>
<p>$k = $prev ? $k &#8211; 1 : $k + 1;<br />
if ( isset($attachments[$k]) )<br />
return &#8216;&lt;a href=&#8221;&#8216; . get_attachment_link( $attachments[$k]-&gt;ID ) . &#8216;&#8221;&gt;&#8217; . $link_text . &#8216;&lt;/a&gt;&#8217;;<br />
else<br />
return false;<br />
}<br />
}<br />
}</p>
<p>Then place this code in your image.php file where you want the navigation to appear -</p>
<p>&lt;h2&gt;&lt;small&gt;&lt;?php mf_previous_image_link( &#8216;&amp;laquo; Previous Photo&#8217; ) ?&gt;&lt;/small&gt; -<br />
&lt;a href=&#8221;&lt;?php echo get_permalink($post-&gt;post_parent); ?&gt;&#8221; rev=&#8221;attachment&#8221;&gt;&lt;?php echo get_the_title($post-&gt;post_parent); ?&gt;&lt;/a&gt; -<br />
&lt;small&gt;&lt;?php mf_next_image_link( &#8216;Next Photo &amp;raquo;&#8217; ) ?&gt;&lt;/small&gt;&lt;/h2&gt;</p>
<p>You can of course change the Previous Photo and Next Photo to whatever you prefer.</p>
]]></content:encoded>
			<wfw:commentRss>http://itscalledwebdesign.com/tutorials/better-image-navigation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

