<?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>Walker News &#187; PHP</title>
	<atom:link href="http://www.walkernews.net/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.walkernews.net</link>
	<description>A capsule of walker's experience in life...</description>
	<lastBuildDate>Sun, 29 Jan 2012 16:29:08 +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>How To Display WordPress EXIF&#8217;s Shutter Speed As Fraction?</title>
		<link>http://www.walkernews.net/2009/07/02/how-to-display-wordpress-exifs-shutter-speed-as-fraction/</link>
		<comments>http://www.walkernews.net/2009/07/02/how-to-display-wordpress-exifs-shutter-speed-as-fraction/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 20:57:40 +0000</pubDate>
		<dc:creator>Walker</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[EXIF]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.walkernews.net/?p=2808</guid>
		<description><![CDATA[Is there a way to convert the WordPress's shutter speed data from decimal to fractional figure?]]></description>
			<content:encoded><![CDATA[Every photographers read shutter speed in fractional form, unless it&#8217;s slower than or equal to 1 second.<br />
<span id="more-2808"></span><br />
Why it&#8217;s like that? Well, I figure out that is probably easier to interpret speed in fractional form at a glance for most people (especially artists, not scientists). Isn&#8217;t easier to tell difference between 1/100 and 1/4000 than reading 0.01 and 0.00025?<br />
<br /><!--wgadh-->However, the WordPress Gallery stores the EXIF&#8217;s shutter speed as decimal figure in database table. Apparently, computer programming is easier to deal with decimal than fractional.<br />
<br />So, in order to follow photography&#8217;s convention, there must be a way to render the decimal form of shutter speed stored in WordPress EXIF table in a fractional figure.<br />
<br />Unfortunately, there is no documented WordPress function to do this job (except the wp_get_attachment_metadata function), not even available in the latest WordPress 2.8 release.<br />
<br />Unless using WordPress plugin, you will have to create a image.php template file for the active WordPress theme, with a block PHP code to display decimal shutter speed as a fraction, if the speed is faster than 1 seconds; otherwise, the shutter speed should be displayed in integer or decimal form.<br />
<br />Sound scary? No worry, Andrew Kniowski figured that out and share it in his post titled <a href="http://www.enliteart.com/blog/2008/08/30/quick-shutter-speed-fix-for-wordpress-exif/" target="_blank">Quick shutter-speed fix for WordPress EXIF</a>.<br />

<a href='http://www.walkernews.net/2009/04/13/turn-on-wordpress-feature-to-display-photo-exif-data-and-iptc-information/a-peter-walker/' title='Peter Walker - Delicious home-made food!'><img width="100" height="100" src="http://www.walkernews.net/wp-content/uploads/2009/04/a-peter-walker-100x100.jpg" class="attachment-thumbnail" alt="Peter Walker - Delicious home-made food!" title="Peter Walker - Delicious home-made food!" /></a>
<a href='http://www.walkernews.net/2009/04/13/turn-on-wordpress-feature-to-display-photo-exif-data-and-iptc-information/a-walker-house/' title='Walker House - The house of Walker?'><img width="100" height="100" src="http://www.walkernews.net/wp-content/uploads/2009/04/a-walker-house-100x100.jpg" class="attachment-thumbnail" alt="Walker House - The house of Walker?" title="Walker House - The house of Walker?" /></a>
<a href='http://www.walkernews.net/2009/04/13/turn-on-wordpress-feature-to-display-photo-exif-data-and-iptc-information/a-walkers-shortbread/' title='Walkers Shortbread - The best of Scotland'><img width="100" height="100" src="http://www.walkernews.net/wp-content/uploads/2009/04/a-walkers-shortbread-100x100.jpg" class="attachment-thumbnail" alt="Walkers Shortbread - The best of Scotland" title="Walkers Shortbread - The best of Scotland" /></a>
<br />

<a href='http://www.walkernews.net/2009/07/02/how-to-display-wordpress-exifs-shutter-speed-as-fraction/lower-shutter/' title='Display the photo shutter speed in WordPress EXIF as fractional figure.'><img width="100" height="100" src="http://www.walkernews.net/wp-content/uploads/2009/07/Lower-Shutter-100x100.jpg" class="attachment-thumbnail" alt="Display the photo shutter speed in WordPress EXIF as fractional figure." title="Display the photo shutter speed in WordPress EXIF as fractional figure." /></a>
<br />
I applied <a href="http://www.walkernews.net/2009/04/13/turn-on-wordpress-feature-to-display-photo-exif-data-and-iptc-information/" title="Turn On WordPress Feature To Display Photo EXIF Data and IPTC Information" rel="bookmark">that code in my WordPress theme</a>, but purposely removed this if-statement and hit a &#8220;divide by zero&#8221; error (for those photos without shutter speed or no EXIF data at all, e.g. screenshot):<br />
<pre>
 if (!empty($imgmeta['image_meta']['shutter_speed']))
</pre>
<br />After discovered that error, I put it back and now the screenshot looks better.<br />

<ul class="related_post"><li><a href="http://www.walkernews.net/2009/06/25/add-shutter-speed-aperture-exif-or-iptc-data-to-wordpress-gallery/" title="Add Shutter Speed, Aperture, EXIF, Or IPTC Data To WordPress Gallery">Add Shutter Speed, Aperture, EXIF, Or IPTC Data To WordPress Gallery</a></li><li><a href="http://www.walkernews.net/2009/04/13/turn-on-wordpress-feature-to-display-photo-exif-data-and-iptc-information/" title="Turn On WordPress Feature To Display Photo EXIF Data and IPTC Information">Turn On WordPress Feature To Display Photo EXIF Data and IPTC Information</a></li><li><a href="http://www.walkernews.net/2009/04/17/how-to-create-image-template-file-for-the-classic-wordpress-theme/" title="How To Create Image Template File For The Classic WordPress Theme?">How To Create Image Template File For The Classic WordPress Theme?</a></li><li><a href="http://www.walkernews.net/2008/09/09/how-to-change-wordpress-image-caption-text-style-to-superscripts/" title="How To Change WordPress Image Caption Text Style To Superscripts?">How To Change WordPress Image Caption Text Style To Superscripts?</a></li><li><a href="http://www.walkernews.net/2008/09/07/how-to-insert-multiple-images-in-wordpress-26-without-using-shortcode/" title="How To Insert Multiple Images In WordPress 2.6 Without Using Shortcode?">How To Insert Multiple Images In WordPress 2.6 Without Using Shortcode?</a></li><li><a href="http://www.walkernews.net/2009/07/18/how-to-embed-swf-in-html-code-or-wordpress-post/" title="How To Embed SWF In HTML Code Or WordPress Post?">How To Embed SWF In HTML Code Or WordPress Post?</a></li><li><a href="http://www.walkernews.net/2009/03/17/how-to-create-image-template-file-for-wordpress-theme-to-display-photo-gallery/" title="How To Create image.php Template File For WordPress Theme To Display Photo Gallery?">How To Create image.php Template File For WordPress Theme To Display Photo Gallery?</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.walkernews.net/2009/07/02/how-to-display-wordpress-exifs-shutter-speed-as-fraction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add Shutter Speed, Aperture, EXIF, Or IPTC Data To WordPress Gallery</title>
		<link>http://www.walkernews.net/2009/06/25/add-shutter-speed-aperture-exif-or-iptc-data-to-wordpress-gallery/</link>
		<comments>http://www.walkernews.net/2009/06/25/add-shutter-speed-aperture-exif-or-iptc-data-to-wordpress-gallery/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 17:04:20 +0000</pubDate>
		<dc:creator>Walker</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[EXIF]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[WordPress Theme]]></category>

		<guid isPermaLink="false">http://www.walkernews.net/?p=2754</guid>
		<description><![CDATA[The ways of extracting and displaying EXIF or IPTC data in WordPress gallery.]]></description>
			<content:encoded><![CDATA[If you would like to run a photo-blog using the latest WordPress platform, you should be interested to know the way of extracting and displaying EXIF or IPTC information of the picture.<br />
<span id="more-2754"></span><br />
Most, if not all, of the digital camera write some profile data, better known as EXIF data, to each of photo taken. The EXIF data contains information of camera model, focal length, data/time, shutter speed, aperture, exposure mode, etc.<br />
<br /><!--wgadh-->The best I can recall, WordPress 2.5 was the first version to introduce image gallery feature as well as functions to store and extract / display EXIF or IPTC information. Although the WordPress gallery shortcode is intuitive for posting a batch of photo in gallery mode, there is no easy option for one to display shutter speed, aperture, flash mode, etc, that interested by most photography enthusiasts.<br />
<br />Even the two bundled WordPress themes are not exampled with EXIF-related functions. But, there are always good people to share tricks with others, e.g. Sarah&#8217;s <a href="http://www.bloggingtips.com/2008/07/20/wordpress-gallery-and-exif/" target="_blank">WordPress Gallery and EXIF</a>, Andrew Kniowski&#8217;s <a href="http://www.enliteart.com/blog/2008/08/30/quick-shutter-speed-fix-for-wordpress-exif/" target="_blank">Quick shutter-speed fix for WordPress EXIF</a>, myself on <a href="http://www.walkernews.net/2009/04/13/turn-on-wordpress-feature-to-display-photo-exif-data-and-iptc-information/" title="Display EXIF and IPTC information in WordPress." rel="bookmark">Turn On WordPress Feature To Display Photo EXIF Data and IPTC Information</a> (with reference to the earlier two links).<br />
<br />If you&#8217;re ambitious, Kristarella&#8217;s <a href="http://www.kristarella.com/2008/12/geo-exif-data-in-wordpress/" target="_blank">Geo exif data in WordPress</a> could inspire you with her trick on adding GPS-tagging information to WordPress table, and of course showing them along with other EXIF information.<br />
<br /><span class="subhead2">Sample image gallery</span><br />

<a href='http://www.walkernews.net/2009/04/13/turn-on-wordpress-feature-to-display-photo-exif-data-and-iptc-information/a-peter-walker/' title='Peter Walker - Delicious home-made food!'><img width="100" height="100" src="http://www.walkernews.net/wp-content/uploads/2009/04/a-peter-walker-100x100.jpg" class="attachment-thumbnail" alt="Peter Walker - Delicious home-made food!" title="Peter Walker - Delicious home-made food!" /></a>
<a href='http://www.walkernews.net/2009/04/13/turn-on-wordpress-feature-to-display-photo-exif-data-and-iptc-information/a-walker-house/' title='Walker House - The house of Walker?'><img width="100" height="100" src="http://www.walkernews.net/wp-content/uploads/2009/04/a-walker-house-100x100.jpg" class="attachment-thumbnail" alt="Walker House - The house of Walker?" title="Walker House - The house of Walker?" /></a>
<a href='http://www.walkernews.net/2009/04/13/turn-on-wordpress-feature-to-display-photo-exif-data-and-iptc-information/a-walkers-shortbread/' title='Walkers Shortbread - The best of Scotland'><img width="100" height="100" src="http://www.walkernews.net/wp-content/uploads/2009/04/a-walkers-shortbread-100x100.jpg" class="attachment-thumbnail" alt="Walkers Shortbread - The best of Scotland" title="Walkers Shortbread - The best of Scotland" /></a>
<br />
Click the above thumbnail to view higher resolution of photo as well as the associated EXIF data rendered by less-documented WordPress functions discussed here.<br />

<ul class="related_post"><li><a href="http://www.walkernews.net/2009/04/13/turn-on-wordpress-feature-to-display-photo-exif-data-and-iptc-information/" title="Turn On WordPress Feature To Display Photo EXIF Data and IPTC Information">Turn On WordPress Feature To Display Photo EXIF Data and IPTC Information</a></li><li><a href="http://www.walkernews.net/2009/07/02/how-to-display-wordpress-exifs-shutter-speed-as-fraction/" title="How To Display WordPress EXIF&#8217;s Shutter Speed As Fraction?">How To Display WordPress EXIF&#8217;s Shutter Speed As Fraction?</a></li><li><a href="http://www.walkernews.net/2009/04/17/how-to-create-image-template-file-for-the-classic-wordpress-theme/" title="How To Create Image Template File For The Classic WordPress Theme?">How To Create Image Template File For The Classic WordPress Theme?</a></li><li><a href="http://www.walkernews.net/2009/03/17/how-to-create-image-template-file-for-wordpress-theme-to-display-photo-gallery/" title="How To Create image.php Template File For WordPress Theme To Display Photo Gallery?">How To Create image.php Template File For WordPress Theme To Display Photo Gallery?</a></li><li><a href="http://www.walkernews.net/2008/09/09/how-to-change-wordpress-image-caption-text-style-to-superscripts/" title="How To Change WordPress Image Caption Text Style To Superscripts?">How To Change WordPress Image Caption Text Style To Superscripts?</a></li><li><a href="http://www.walkernews.net/2008/09/07/how-to-insert-multiple-images-in-wordpress-26-without-using-shortcode/" title="How To Insert Multiple Images In WordPress 2.6 Without Using Shortcode?">How To Insert Multiple Images In WordPress 2.6 Without Using Shortcode?</a></li><li><a href="http://www.walkernews.net/2009/07/18/how-to-embed-swf-in-html-code-or-wordpress-post/" title="How To Embed SWF In HTML Code Or WordPress Post?">How To Embed SWF In HTML Code Or WordPress Post?</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.walkernews.net/2009/06/25/add-shutter-speed-aperture-exif-or-iptc-data-to-wordpress-gallery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Create Image Template File For The Classic WordPress Theme?</title>
		<link>http://www.walkernews.net/2009/04/17/how-to-create-image-template-file-for-the-classic-wordpress-theme/</link>
		<comments>http://www.walkernews.net/2009/04/17/how-to-create-image-template-file-for-the-classic-wordpress-theme/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 17:09:56 +0000</pubDate>
		<dc:creator>Walker</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Weblog]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[WordPress 2.5]]></category>
		<category><![CDATA[WordPress Theme]]></category>

		<guid isPermaLink="false">http://www.walkernews.net/?p=2472</guid>
		<description><![CDATA[Another attempt to show you how to create an image.php template file for old WordPress theme.]]></description>
			<content:encoded><![CDATA[WordPress image gallery is good for those who are running photo-blog or posting photograph regularly. With WordPress 2.5 and above inbuilt the feature at out of the box, you might not need to rely on more third party WordPress plugin.<br />
<span id="more-2472"></span><br />
According to <a href="http://codex.wordpress.org/Template_Hierarchy" title="WordPress Codex: Template file hierarchy" rel="bookmark" target="_blank">WordPress template hierarchy</a>, the WordPress 2.5 uses image.php template file to render a zoom-in image of the thumbnail being clicked. <br />
<br /><!--wgadh-->In case there is NO such template file, it looks for attachment.php, followed by single.php, and finally the index.php template file.<br />
<br />Therefore, it&#8217;s perfectly fine to apply image gallery even if the active WordPress theme does not come with image.php template file.<br />
<br />However, it is good to have this dedicated template file to gain most (if not all) features of WordPress image gallery. For example, it&#8217;s easier to include image gallery related functions in this new template file, to display hyperlinked thumbnail of next and previous image in gallery as well as the <a href="http://www.walkernews.net/2009/04/13/turn-on-wordpress-feature-to-display-photo-exif-data-and-iptc-information/" title="How to display or show photograph EXIF  and IPTC data with WordPress image gallery functions?" rel="bookmark">photograph EXIF or IPTC data</a> (such as Copyright info, shutter speed, aperture, ISO, focal length, camera model, etc).<br />
<br />So, <span class="subhead">how to create an image.php template file</span>, if your active WordPress theme does not have one?<br />
<br />Let me use the Classic WordPress theme bundled with WordPress 2.7 as an example. If you look at your WordPress installation, there is no image.php, single.php, or attachment.php template file in the classic directory.<br />
<br />Instead of creating a new template file from zero, it&#8217;s easier to use index.php template file as a base. So, just duplicate (copy) the index.php and name it as image.php:<br />
<pre>
cp index.php image.php
</pre>
<br />Next, open the image.php file for modification:<br />
<br />1) Replace the_permalink() and the_title() functions with image gallery functions, in order to present hyperlink of parent post instead of permalink of the medium size (zoom-in) image.<br />
<br />In this case, the original line<br />
<pre>
&lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;
</pre>
<br />is changed to be<br />
<pre>
&lt;a href="&lt;?php echo get_permalink($post-&gt;post_parent); ?&gt;" rel="bookmark"&gt;&lt;?php echo get_the_title($post-&gt;post_parent); ?&gt;&lt;/a&gt;
</pre>
<br />2) Look for the_content() and replace it with new functions that display hyperlinked thumbnail of previous and next image in gallery, the medium size image of thumbnail being clicked, and the photograph EXIF / IPTC data (if any).<br />
<br />So, this orginal line:<br />
<pre>
&lt;?php the_content(__('(more...)')); ?&gt;
</pre>
<br />is replaced by this block of PHP + HTML code:<br />
<pre>
<span style="color:#F00;font-weight:bold;">&lt;!-- To display thumbnail of previous and next image in the photo gallery --&gt;</span>
&lt;div style="float:right;"&gt;
      &lt;?php next_image_link() ?&gt;
&lt;/div&gt;&lt;?php previous_image_link() ?&gt;&lt;br /&gt;

<span style="color:#F00;font-weight:bold;">&lt;!-- To display current image in the photo gallery --&gt;</span>
&lt;div style="text-align: center;"&gt;
      &lt;a href="&lt;?php echo wp_get_attachment_url($post-&gt;ID); ?&gt;"&gt;&lt;?php echo wp_get_attachment_image( $post-&gt;ID, 'medium' ); ?&gt;&lt;/a&gt;
&lt;/div&gt;&lt;br /&gt;

<span style="color:#F00;font-weight:bold;">&lt;!-- Using WordPress functions to retrieve the extracted EXIF information from database --&gt;</span>
&lt;div style="padding:5px 0 5px 20px;border:1px dotted;"&gt;
   &lt;?php
      $imgmeta = wp_get_attachment_metadata( $id );

<span style="color:#F00;font-weight:bold;">// Convert the shutter speed retrieve from database to fraction</span>
      if ((1 / $imgmeta['image_meta']['shutter_speed']) &gt; 1)
      {
         if ((number_format((1 / $imgmeta['image_meta']['shutter_speed']), 1)) == 1.3
         or number_format((1 / $imgmeta['image_meta']['shutter_speed']), 1) == 1.5
         or number_format((1 / $imgmeta['image_meta']['shutter_speed']), 1) == 1.6
         or number_format((1 / $imgmeta['image_meta']['shutter_speed']), 1) == 2.5){
            $pshutter = "1/" . number_format((1 / $imgmeta['image_meta']['shutter_speed']), 1, '.', '') . " second";
         }
         else{
           $pshutter = "1/" . number_format((1 / $imgmeta['image_meta']['shutter_speed']), 0, '.', '') . " second";
         }
      }
      else{
         $pshutter = $imgmeta['image_meta']['shutter_speed'] . " seconds";
       }

<span style="color:#F00;font-weight:bold;">// Start to display EXIF and IPTC data of digital photograph</span>
       echo "Date Taken: " . date("d-M-Y H:i:s", $imgmeta['image_meta']['created_timestamp'])."&lt;br /&gt;";
       echo "Copyright: " . $imgmeta['image_meta']['copyright']."&lt;br /&gt;";
       echo "Credit: " . $imgmeta['image_meta']['credit']."&lt;br /&gt;";
       echo "Title: " . $imgmeta['image_meta']['title']."&lt;br /&gt;";
       echo "Caption: " . $imgmeta['image_meta']['caption']."&lt;br /&gt;";
       echo "Camera: " . $imgmeta['image_meta']['camera']."&lt;br /&gt;";
       echo "Focal Length: " . $imgmeta['image_meta']['focal_length']."mm&lt;br /&gt;";
       echo "Aperture: f/" . $imgmeta['image_meta']['aperture']."&lt;br /&gt;";
       echo "ISO: " . $imgmeta['image_meta']['iso']."&lt;br /&gt;";
       echo "Shutter Speed: " . $pshutter . "&lt;br /&gt;"
   ?&gt;
&lt;/div&gt;

&lt;?php if ( !empty($post-&gt;post_excerpt) ) the_excerpt(); ?&gt;&lt;br /&gt;
</pre>
<br />
<ul class="related_post"><li><a href="http://www.walkernews.net/2009/06/25/add-shutter-speed-aperture-exif-or-iptc-data-to-wordpress-gallery/" title="Add Shutter Speed, Aperture, EXIF, Or IPTC Data To WordPress Gallery">Add Shutter Speed, Aperture, EXIF, Or IPTC Data To WordPress Gallery</a></li><li><a href="http://www.walkernews.net/2009/04/13/turn-on-wordpress-feature-to-display-photo-exif-data-and-iptc-information/" title="Turn On WordPress Feature To Display Photo EXIF Data and IPTC Information">Turn On WordPress Feature To Display Photo EXIF Data and IPTC Information</a></li><li><a href="http://www.walkernews.net/2008/09/09/how-to-change-wordpress-image-caption-text-style-to-superscripts/" title="How To Change WordPress Image Caption Text Style To Superscripts?">How To Change WordPress Image Caption Text Style To Superscripts?</a></li><li><a href="http://www.walkernews.net/2008/09/07/how-to-insert-multiple-images-in-wordpress-26-without-using-shortcode/" title="How To Insert Multiple Images In WordPress 2.6 Without Using Shortcode?">How To Insert Multiple Images In WordPress 2.6 Without Using Shortcode?</a></li><li><a href="http://www.walkernews.net/2009/07/02/how-to-display-wordpress-exifs-shutter-speed-as-fraction/" title="How To Display WordPress EXIF&#8217;s Shutter Speed As Fraction?">How To Display WordPress EXIF&#8217;s Shutter Speed As Fraction?</a></li><li><a href="http://www.walkernews.net/2009/03/17/how-to-create-image-template-file-for-wordpress-theme-to-display-photo-gallery/" title="How To Create image.php Template File For WordPress Theme To Display Photo Gallery?">How To Create image.php Template File For WordPress Theme To Display Photo Gallery?</a></li><li><a href="http://www.walkernews.net/2008/12/16/how-easy-to-change-wordpress-27-post-permalink-with-post-slug/" title="How Easy To Change WordPress 2.7 Post Permalink With Post Slug">How Easy To Change WordPress 2.7 Post Permalink With Post Slug</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.walkernews.net/2009/04/17/how-to-create-image-template-file-for-the-classic-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Turn On WordPress Feature To Display Photo EXIF Data and IPTC Information</title>
		<link>http://www.walkernews.net/2009/04/13/turn-on-wordpress-feature-to-display-photo-exif-data-and-iptc-information/</link>
		<comments>http://www.walkernews.net/2009/04/13/turn-on-wordpress-feature-to-display-photo-exif-data-and-iptc-information/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 16:33:20 +0000</pubDate>
		<dc:creator>Walker</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[EXIF]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[IPTC]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[WordPress Theme]]></category>

		<guid isPermaLink="false">http://www.walkernews.net/?p=2390</guid>
		<description><![CDATA[WordPress supports EXIF and IPTC data out of the box since version 2.5. Do you know how to turn on this feature to display some technical detail of a photograph?]]></description>
			<content:encoded><![CDATA[WordPress supports EXIF and IPTC data extraction since WordPress 2.5. However, the functions to display the extracted EXIF and IPTC information have to be separately added to WordPress theme files.<br />
<span id="more-2390"></span><br />
Normally, the default WordPress theme bundled with WordPress archive provides reference on how to use new functions introduced by the latest release.<br />

However, these EXIF-related functions are not exampled in both default and classic theme, not even found in the latest WordPress 2.7.1. The only thing I found is how to create template of image.php theme file, with reference to the default theme.<br />
<br />If you prefer not to install additional WordPress plugin since the core is already inbuilt EXIF-related functions, here I show you how to &#8220;turn&#8221; it on (if you do not mind my poor presentation).<br />
<br /><span class="subhead">Enable WordPress theme to display the EXIF and IPTC data of digital photograph</span><br />
<br />Example:<br />
<br />
<a href='http://www.walkernews.net/2009/04/13/turn-on-wordpress-feature-to-display-photo-exif-data-and-iptc-information/a-peter-walker/' title='Peter Walker - Delicious home-made food!'><img width="100" height="100" src="http://www.walkernews.net/wp-content/uploads/2009/04/a-peter-walker-100x100.jpg" class="attachment-thumbnail" alt="Peter Walker - Delicious home-made food!" title="Peter Walker - Delicious home-made food!" /></a>
<a href='http://www.walkernews.net/2009/04/13/turn-on-wordpress-feature-to-display-photo-exif-data-and-iptc-information/a-walker-house/' title='Walker House - The house of Walker?'><img width="100" height="100" src="http://www.walkernews.net/wp-content/uploads/2009/04/a-walker-house-100x100.jpg" class="attachment-thumbnail" alt="Walker House - The house of Walker?" title="Walker House - The house of Walker?" /></a>
<a href='http://www.walkernews.net/2009/04/13/turn-on-wordpress-feature-to-display-photo-exif-data-and-iptc-information/a-walkers-shortbread/' title='Walkers Shortbread - The best of Scotland'><img width="100" height="100" src="http://www.walkernews.net/wp-content/uploads/2009/04/a-walkers-shortbread-100x100.jpg" class="attachment-thumbnail" alt="Walkers Shortbread - The best of Scotland" title="Walkers Shortbread - The best of Scotland" /></a>
<br />
<span class="subhead2">Steps:</span><br />
<br />First, <a href="http://www.walkernews.net/2009/03/17/how-to-create-image-template-file-for-wordpress-theme-to-display-photo-gallery/" title="How to create an image.php template file for WordPress theme?" rel="bookmark">create a image.php template file</a> if your WordPress theme doesn&#8217;t have one. As shown in my previous post, it is easy to create one in no time.<br />
<br />You just need to duplicate single.php or index.php and rename it to image.php.<br />
<br />Edit the image.php template file, search for the <span class="subhead2">PHP code</span> that calling <span class="fpath">the_content()</span> function and replace it with the codes that render image gallery as well as EXIF/IPTC information.<br />
<br />Note, the <span class="subhead2">PHP code</span> is referring to code that enclosed in a pair of <code>&lt;?php</code> and <code>?&gt;</code>.<br />
<br />So, let&#8217;s take the classic theme bundled with WordPress 2.7.1 as example, this is the line<br />
<pre>&lt;?php the_content(__('(more...)')); ?&gt;</pre>
<br />that should be replace with the following code:<br />
<pre>
<span style="color:#F00;font-weight:bold;">&lt;!-- To display thumbnail of previous and next image in the photo gallery --&gt;</span>
&lt;div style="float:right;"&gt;
      &lt;?php next_image_link() ?&gt;
&lt;/div&gt;&lt;?php previous_image_link() ?&gt;&lt;br /&gt;

<span style="color:#F00;font-weight:bold;">&lt;!-- To display current image in the photo gallery --&gt;</span>
&lt;div style="text-align: center;"&gt;
      &lt;a href="&lt;?php echo wp_get_attachment_url($post-&gt;ID); ?&gt;"&gt;&lt;?php echo wp_get_attachment_image( $post-&gt;ID, 'medium' ); ?&gt;&lt;/a&gt;
&lt;/div&gt;&lt;br /&gt;

<span style="color:#F00;font-weight:bold;">&lt;!-- Using WordPress functions to retrieve the extracted EXIF information from database --&gt;</span>
&lt;div style="padding:5px 0 5px 20px;border:1px dotted;"&gt;
   &lt;?php
      $imgmeta = wp_get_attachment_metadata( $id );

<span style="color:#F00;font-weight:bold;">// Convert the shutter speed retrieve from database to fraction</span>
      if ((1 / $imgmeta['image_meta']['shutter_speed']) &gt; 1)
      {
         if ((number_format((1 / $imgmeta['image_meta']['shutter_speed']), 1)) == 1.3
         or number_format((1 / $imgmeta['image_meta']['shutter_speed']), 1) == 1.5
         or number_format((1 / $imgmeta['image_meta']['shutter_speed']), 1) == 1.6
         or number_format((1 / $imgmeta['image_meta']['shutter_speed']), 1) == 2.5){
            $pshutter = "1/" . number_format((1 / $imgmeta['image_meta']['shutter_speed']), 1, '.', '') . " second";
         }
         else{
           $pshutter = "1/" . number_format((1 / $imgmeta['image_meta']['shutter_speed']), 0, '.', '') . " second";
         }
      }
      else{
         $pshutter = $imgmeta['image_meta']['shutter_speed'] . " seconds";
       }

<span style="color:#F00;font-weight:bold;">// Start to display EXIF and IPTC data of digital photograph</span>
       echo "Date Taken: " . date("d-M-Y H:i:s", $imgmeta['image_meta']['created_timestamp'])."&lt;br /&gt;";
       echo "Copyright: " . $imgmeta['image_meta']['copyright']."&lt;br /&gt;";
       echo "Credit: " . $imgmeta['image_meta']['credit']."&lt;br /&gt;";
       echo "Title: " . $imgmeta['image_meta']['title']."&lt;br /&gt;";
       echo "Caption: " . $imgmeta['image_meta']['caption']."&lt;br /&gt;";
       echo "Camera: " . $imgmeta['image_meta']['camera']."&lt;br /&gt;";
       echo "Focal Length: " . $imgmeta['image_meta']['focal_length']."mm&lt;br /&gt;";
       echo "Aperture: f/" . $imgmeta['image_meta']['aperture']."&lt;br /&gt;";
       echo "ISO: " . $imgmeta['image_meta']['iso']."&lt;br /&gt;";
       echo "Shutter Speed: " . $pshutter . "&lt;br /&gt;"
   ?&gt;
&lt;/div&gt;

&lt;?php if ( !empty($post-&gt;post_excerpt) ) the_excerpt(); ?&gt;&lt;br /&gt;
</pre>
<br />Next, look for the PHP code that present title URL (the code that call <span class="fpath">the_title()</span> function) with these codes so that the parent post URL is used when rendering image gallery:<br />
<pre>
&lt;a href="&lt;?php echo get_permalink($post-&gt;post_parent); ?&gt;" rev="attachment"&gt;&lt;?php echo get_the_title($post-&gt;post_parent); ?&gt; &lt;/a&gt;
</pre>
<br />Once these are done, your WordPress theme is not only ready to render image gallery but also to show EXIF  / IPTC information of the digital images.<br />

<ul class="related_post"><li><a href="http://www.walkernews.net/2009/06/25/add-shutter-speed-aperture-exif-or-iptc-data-to-wordpress-gallery/" title="Add Shutter Speed, Aperture, EXIF, Or IPTC Data To WordPress Gallery">Add Shutter Speed, Aperture, EXIF, Or IPTC Data To WordPress Gallery</a></li><li><a href="http://www.walkernews.net/2009/07/02/how-to-display-wordpress-exifs-shutter-speed-as-fraction/" title="How To Display WordPress EXIF&#8217;s Shutter Speed As Fraction?">How To Display WordPress EXIF&#8217;s Shutter Speed As Fraction?</a></li><li><a href="http://www.walkernews.net/2009/04/17/how-to-create-image-template-file-for-the-classic-wordpress-theme/" title="How To Create Image Template File For The Classic WordPress Theme?">How To Create Image Template File For The Classic WordPress Theme?</a></li><li><a href="http://www.walkernews.net/2009/03/17/how-to-create-image-template-file-for-wordpress-theme-to-display-photo-gallery/" title="How To Create image.php Template File For WordPress Theme To Display Photo Gallery?">How To Create image.php Template File For WordPress Theme To Display Photo Gallery?</a></li><li><a href="http://www.walkernews.net/2008/09/09/how-to-change-wordpress-image-caption-text-style-to-superscripts/" title="How To Change WordPress Image Caption Text Style To Superscripts?">How To Change WordPress Image Caption Text Style To Superscripts?</a></li><li><a href="http://www.walkernews.net/2008/09/07/how-to-insert-multiple-images-in-wordpress-26-without-using-shortcode/" title="How To Insert Multiple Images In WordPress 2.6 Without Using Shortcode?">How To Insert Multiple Images In WordPress 2.6 Without Using Shortcode?</a></li><li><a href="http://www.walkernews.net/2009/07/18/how-to-embed-swf-in-html-code-or-wordpress-post/" title="How To Embed SWF In HTML Code Or WordPress Post?">How To Embed SWF In HTML Code Or WordPress Post?</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.walkernews.net/2009/04/13/turn-on-wordpress-feature-to-display-photo-exif-data-and-iptc-information/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>How To Change WordPress Image Caption Text Style To Superscripts?</title>
		<link>http://www.walkernews.net/2008/09/09/how-to-change-wordpress-image-caption-text-style-to-superscripts/</link>
		<comments>http://www.walkernews.net/2008/09/09/how-to-change-wordpress-image-caption-text-style-to-superscripts/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 16:36:03 +0000</pubDate>
		<dc:creator>Walker</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Guide]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[MOD]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Weblog]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.walkernews.net/?p=1091</guid>
		<description><![CDATA[How could you force WordPress 2.6 to display an image caption text as superscripts style rather than the sharing the common post body text style?]]></description>
			<content:encoded><![CDATA[WordPress 2.5+ rewrite the image/file uploader interface to include some most wanted features, e.g. <a href="http://www.walkernews.net/2008/09/07/how-to-insert-multiple-images-in-wordpress-26-without-using-shortcode/" title="How to insert multiple images in WordPress 2.5+ without using the shortcode?" rel="bookmark">multiple images per single upload</a>, WordPress Gallery Shortcode, image caption text, image size and alignment, etc.<br />
<span id="more-1091"></span><br />
<strong>Question:</strong> How could you force WordPress image caption text to appear as superscripts text style, rather than sharing the common post body text style?<br />
<!--wgadh-->What is that superscripts text style? <br />
<br />Superscripts text style is usually 75% smaller than its original size and appears at upper position of the same text line, e.g. the blue colour text in Walker<sup><span style="color:#00F;font-weight:bold;">News</span></sup> or 7<sup><span style="color:#00F;font-weight:bold;">th</span></sup>.<br />
<br />Why rendering WordPress image caption text in superscripts style? <br />
<br />Image caption text is deemed as &#8220;alternative text&#8221; of an image, i.e. text that describes the image (so that search engine knows what is the image about. That&#8217;s why you should write little text for the image alt=&#8221;" attribute!<br />
<br />If the article itself is enough to tell story of the image, I think it&#8217;s better to &#8220;hide them&#8221; or just display the caption text in superscripts style for better reading experience or presentation.<br />
<br /><span class="subhead">How to get WordPress 2.6.1 to display image caption text in superscripts style?</span><br />
<ol>
<li>Edit <code>wp-includes/media.php</code> file<br />
&nbsp;</li>
<li>Look for this <code>function img_caption_shortcode($attr, $content = null)</code><br />
&nbsp;</li>
<li>Change this line
<pre>. $content . '&lt;p class="wp-caption-text"&gt;' . $caption . '&lt;/p&gt;&lt;/div&gt;';</pre>
<br />to become<br />
<pre>. $content . '&lt;br /&gt;&lt;sup&gt;' . $caption . '&lt;/sup&gt;&lt;/div&gt;';</pre>
</li>
</ol>
<br />There are at least 3 media.php files in 3 different directories, and this WordPress mod is using the <code>wp-includes/media.php</code>.<br />
<br />If you can&#8217;t find the mentioned function, make sure you&#8217;re editing the right media.php file. Otherwise, this trick is only tested in WordPress 2.6.1 (and might not working in other version?). Good luck.<br />

<ul class="related_post"><li><a href="http://www.walkernews.net/2008/09/07/how-to-insert-multiple-images-in-wordpress-26-without-using-shortcode/" title="How To Insert Multiple Images In WordPress 2.6 Without Using Shortcode?">How To Insert Multiple Images In WordPress 2.6 Without Using Shortcode?</a></li><li><a href="http://www.walkernews.net/2008/09/11/wordpress-adds-wp-caption-text-to-css-file-for-image-caption-styling/" title="WordPress: Adds wp-caption-text To CSS File For Image Caption Styling">WordPress: Adds wp-caption-text To CSS File For Image Caption Styling</a></li><li><a href="http://www.walkernews.net/2009/04/17/how-to-create-image-template-file-for-the-classic-wordpress-theme/" title="How To Create Image Template File For The Classic WordPress Theme?">How To Create Image Template File For The Classic WordPress Theme?</a></li><li><a href="http://www.walkernews.net/2008/06/30/how-to-edit-and-rewrite-post-slug-or-permalink-in-wordpress-25/" title="How To Edit And Rewrite Post Slug / Permalink In WordPress 2.5?">How To Edit And Rewrite Post Slug / Permalink In WordPress 2.5?</a></li><li><a href="http://www.walkernews.net/2009/07/18/how-to-embed-swf-in-html-code-or-wordpress-post/" title="How To Embed SWF In HTML Code Or WordPress Post?">How To Embed SWF In HTML Code Or WordPress Post?</a></li><li><a href="http://www.walkernews.net/2009/07/02/how-to-display-wordpress-exifs-shutter-speed-as-fraction/" title="How To Display WordPress EXIF&#8217;s Shutter Speed As Fraction?">How To Display WordPress EXIF&#8217;s Shutter Speed As Fraction?</a></li><li><a href="http://www.walkernews.net/2009/06/25/add-shutter-speed-aperture-exif-or-iptc-data-to-wordpress-gallery/" title="Add Shutter Speed, Aperture, EXIF, Or IPTC Data To WordPress Gallery">Add Shutter Speed, Aperture, EXIF, Or IPTC Data To WordPress Gallery</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.walkernews.net/2008/09/09/how-to-change-wordpress-image-caption-text-style-to-superscripts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How To Insert Multiple Images In WordPress 2.6 Without Using Shortcode?</title>
		<link>http://www.walkernews.net/2008/09/07/how-to-insert-multiple-images-in-wordpress-26-without-using-shortcode/</link>
		<comments>http://www.walkernews.net/2008/09/07/how-to-insert-multiple-images-in-wordpress-26-without-using-shortcode/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 15:45:19 +0000</pubDate>
		<dc:creator>Walker</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Guide]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MOD]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Shortcode]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[Weblog]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.walkernews.net/?p=1072</guid>
		<description><![CDATA[How could you insert multiple images or pictures into editor if you don't like the gallery shortcode?]]></description>
			<content:encoded><![CDATA[Starting from WordPress 2.5, uploading multiple images or files is as easier as those who are using <a href="http://www.walkernews.net/2007/06/25/how-to-hide-new-blogger-navigation-bar/" title="How to hide New Blogger Navigation bar?" rel="bookmark">New Blogger</a> platform provided by Google Inc. <strong>Question</strong>: Other than using shortcode, is there other ways to do so?<br />
<span id="more-1072"></span><br />
<span class="subhead">Intro: WordPress 2.5+ could upload multiple files in one go</span><br />
<br />Unlike <a href="http://www.walkernews.net/2007/03/10/license-to-tweak-adsense-code-for-new-blogger/" title="How to embed Adsense code in New Blogger html template? How to display Adsense in between post title and post body in New Blogger?" rel="bookmark">New Blogger</a> image uploader, the WordPress 2.5+ &#8220;select files to upload&#8221; dialog box works exactly a standard Windows file selection dialog box &#8211; press <a href="http://www.walkernews.net/2007/11/18/useful-ctrl-hotkey-in-windows-vista-and-xp/" title="Remember some of the useful CTRL shortcut key in Windows OS." rel="bookmark">CTRL+A</a> to select all images files; CTRL+Mouse-click to select multiple files; highlight first picture file and press SHIFT key while selecting the last picture file to select all files in between, inclusively.<br />
<br /><!--wgadh-->The WordPress 2.5+ image file uploader allow any number of images per upload in one go. I.e. you&#8217;re not limited to a maximum 5 images per single upload, as in New Blogger. <br />
<br /><strong>It&#8217;s cool, isn&#8217;t it?</strong> Not only that. With WordPress 2.5+, you could also use &#8220;<a href="http://codex.wordpress.org/Using_the_gallery_shortcode" title="The WordPress Gallery Shortcode option and syntax reference." target="_blank">WordPress Gallery Shortcode</a>&#8221; to insert multiple images to the post editor!<br />
<br />As the name suggest, the WordPress Gallery Shortcode is like <a href="http://www.walkernews.net/2007/12/07/use-alias-to-create-linux-command-shortcut/" title="How to use Linux alias command to shorten some of the frequently used Linux commands?" rel="bookmark">Linux alias command</a> but it&#8217;s pre-defined in <a href="http://www.walkernews.net/2007/10/30/highlight-author-comment-and-pingback-in-wordpress/" title="How to highlight author comments and pingbacks in WordPress theme files?" rel="bookmark">WordPress</a> core files (i.e. general user couldn&#8217;t redefine the shortcode in the plain/default WordPress admin pages).<br />
<br />However, some <a href="http://www.walkernews.net/2008/08/17/windows-media-player-how-to-embed-wmv-file-in-html-code/" title="How to embed WMV video files in WordPress or HTML code?" rel="bookmark">WordPress</a> fans is not really keen on the image shortcode for some reasons, e.g. it can&#8217;t define which image of the gallery to display or not to display, the sequence of displaying each image in the gallery, etc.<br />
<br /><span class="subhead">How to insert multiple images in WordPress 2.6.1?</span><br />
<br />I am using WordPress version 2.6.1 for this topic, but the original trick I&#8217;m referring to was suggested by <strong>beardedknight</strong> in <a href="http://wordpress.org/support/topic/166977" title="How to insert multiple images in WordPress 2.5" rel="nofollow" target="_blank">WordPress forum for WordPress 2.5</a> (so, it supports to work fine for version 2.5+).<br />
<ol>
<li>Edit the <code>wp-admin/includes/media.php</code> file (read carefully the path specified here, it&#8217;s not wp-includes/media.php or elsewhere &#8211; there are at least 3 media.php files in WordPress 2.6.1. installation directory):
<pre>function media_send_to_editor($html) {
        ?&gt;
&lt;script type="text/javascript"&gt;
/* &lt;![CDATA[ */
var win = window.dialogArguments || opener || parent || top;
win.send_to_editor('&lt;?php echo addslashes($html); ?&gt;');
/* ]]&gt; */
&lt;/script&gt;
        &lt;?php
        <span style="color:#00F;font-weight:bold;">//</span>exit;
        <span style="color:#00F;font-weight:bold;">return;</span>
}</pre>
<br />As shown here, look for the <code>media_send_to_editor($html)</code> function and make little changes, as those highlighted in &#8220;blue colour&#8221; PHP code:<br />
<ul>
<li>remark the original <code>exit;</code> line</li>
<li>add one single PHP code <code>return;</code><br />
&nbsp;</li>
</ul>
</li>
<li>Edit <code>wp-admin/js/media-upload.js</code>:
<pre>function send_to_editor(h) {
        if ( typeof tinyMCE != 'undefined' &#038;&#038; ( ed = tinyMCE.activeEditor ) &#038;&#038; !ed.isHidden() ) {
                ed.focus();
                if (tinymce.isIE)
                      ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark);

                if ( h.indexOf('[caption') != -1 )
                        h = ed.plugins.wpeditimage._do_shcode(h);

                ed.execCommand('mceInsertContent', false, h);
        } else
                edInsertContent(edCanvas, h);

        <span style="color:#00F;font-weight:bold;">//tb_remove();</span>
}</pre>
<br />As shown here, look for the <code>send_to_editor(h)</code> function and remark the original <code>tb_remove();</code> function call (the &#8220;blue colour&#8221; <a href="http://www.walkernews.net/2007/07/16/simple-javascript-extract-login-form-password/" title="Beware that a simple JavaScript code could used to extract the real password behind in the asterisk characters in a login form!" rel="bookmark">JavaScript code</a>).</li>
</ol>
<br />If you&#8217;re not comfortable with this simple PHP code modification (PHP mod), then just stick to the default behaviour or look for some good WordPress gallery plugin. Good luck.<br />

<ul class="related_post"><li><a href="http://www.walkernews.net/2008/09/09/how-to-change-wordpress-image-caption-text-style-to-superscripts/" title="How To Change WordPress Image Caption Text Style To Superscripts?">How To Change WordPress Image Caption Text Style To Superscripts?</a></li><li><a href="http://www.walkernews.net/2008/06/30/how-to-edit-and-rewrite-post-slug-or-permalink-in-wordpress-25/" title="How To Edit And Rewrite Post Slug / Permalink In WordPress 2.5?">How To Edit And Rewrite Post Slug / Permalink In WordPress 2.5?</a></li><li><a href="http://www.walkernews.net/2009/04/17/how-to-create-image-template-file-for-the-classic-wordpress-theme/" title="How To Create Image Template File For The Classic WordPress Theme?">How To Create Image Template File For The Classic WordPress Theme?</a></li><li><a href="http://www.walkernews.net/2008/09/11/wordpress-adds-wp-caption-text-to-css-file-for-image-caption-styling/" title="WordPress: Adds wp-caption-text To CSS File For Image Caption Styling">WordPress: Adds wp-caption-text To CSS File For Image Caption Styling</a></li><li><a href="http://www.walkernews.net/2008/04/21/update-wp_title-to-display-blog-name-on-the-right/" title="Update WP_TITLE To Display Blog Name On The Right">Update WP_TITLE To Display Blog Name On The Right</a></li><li><a href="http://www.walkernews.net/2009/07/02/how-to-display-wordpress-exifs-shutter-speed-as-fraction/" title="How To Display WordPress EXIF&#8217;s Shutter Speed As Fraction?">How To Display WordPress EXIF&#8217;s Shutter Speed As Fraction?</a></li><li><a href="http://www.walkernews.net/2009/06/25/add-shutter-speed-aperture-exif-or-iptc-data-to-wordpress-gallery/" title="Add Shutter Speed, Aperture, EXIF, Or IPTC Data To WordPress Gallery">Add Shutter Speed, Aperture, EXIF, Or IPTC Data To WordPress Gallery</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.walkernews.net/2008/09/07/how-to-insert-multiple-images-in-wordpress-26-without-using-shortcode/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Update WP_TITLE To Display Blog Name On The Right</title>
		<link>http://www.walkernews.net/2008/04/21/update-wp_title-to-display-blog-name-on-the-right/</link>
		<comments>http://www.walkernews.net/2008/04/21/update-wp_title-to-display-blog-name-on-the-right/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 15:13:33 +0000</pubDate>
		<dc:creator>Walker</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[General-Template]]></category>
		<category><![CDATA[Guide]]></category>
		<category><![CDATA[Howto]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[Trick]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Weblog]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[WordPress 2.5]]></category>
		<category><![CDATA[WP_TITLE]]></category>

		<guid isPermaLink="false">http://www.walkernews.net/?p=709</guid>
		<description><![CDATA[WordPress 2.5 has updated the WP_TITLE where user can now decide the blog name to appear on the left or right.]]></description>
			<content:encoded><![CDATA[For those who have upgraded <a href="http://www.walkernews.net/tag/wordpress/" title="All posts related to WordPress in WalkerNews.net" rel="bookmark">WordPress powered blogs</a> to <a href="http://www.walkernews.net/2007/06/19/enable-full-text-feed-in-wordpress-2/" title="Is your WordPress 2.5 enabled full-text Feed?" rel="bookmark">WordPress 2.5</a> and having the blog name appears on the right hand of post title, now is the time to update WordPress theme files that using WP_TITLE template tag.<br />
<span id="more-709"></span><br />
On most <a href="http://www.walkernews.net/2007/10/29/wordpress-theme-with-tag-and-gravatar/" title="Do you like the WordPress theme for WalkerNews.net?" rel="bookmark">WordPress themes</a>, the header.php is usually the only PHP files that calls WP_TITLE function.<br />

According to <a href="http://codex.wordpress.org/Template_Tags/wp_title" title="WordPress Codex : WP_TITLE" target="_blank">WordPress Codex</a>, WordPress 2.5 introduces a new function parameter (i.e. <em>seplocation</em>) to WP_TITLE:<br />
<pre>function wp_title($sep = '-', $display = true, $seplocation = '') {
............
............
............
       // Determines position of the separator
        if ( 'right' == $seplocation )
                $title = $title . $prefix;
        else
                $title = $prefix . $title;
...........
...........</pre>
<br />The <em>seplocation</em> allows WordPress theme designer to fix the blog name to appears on either left (default) or right, in addition to the character (i.e. <em>separator</em>) used to separate the blog name and post title.<br />
<br />Before there is <em>seplocation</em> parameter, I used to modify <strong>wp-includes/general-template.php</strong> (one of the WordPress core files) to fix &#8220;<a href="http://www.walkernews.net/" title="WalkerNews.net - Home" rel="bookmark">Walker News</a>&#8221; on the right hand of each post titles.<br />
<br />Having said that, now everyone who prefers post title comes first then followed by blog name can remove plugin installed for this purpose or modification made to general-template.php file.<br />
<blockquote>The WordPress powered blog is easier to maintain, as the modular concept breaks it down into three components:<br />
<ul>
<li>core files (the engine of WordPress powered blogs),</li>
<li>plugins (the extensions build on top of WordPress core engine to facilitate features and creativities enrichment)</li>
<li>themes (the fashion or costume of WordPress powered blogs)</li>
</ul>
<br />By keeping the WordPress core files intact, most general users could have less (or none) hassles to perform subsequent WordPress version upgrades.</blockquote>
<br />Thus, fix the blog name appearance location in theme files (header.php) keeps the next WordPress version upgrade easier and less worries.<br />
<br /><strong>How to display blog name on the right hand of post title in WordPress powered blog?</strong><br />
<br />Open the header.php file of WordPress theme, search for the wp_title() function call and put in the three parameters value that corresponding to separator character, display blog name (Boolean flag) and blog name appearance location.<br />
<br />For example, to display blog name on the right of post title and using dash character as separator, update the wp_title call in header.php theme file as this:<br />
<pre>&lt;title&gt;&lt;?php wp_title(<span style="color:#F00;font-weight:bold;">'-',true,'right'</span>); ?>&lt;?php bloginfo('name'); ?&gt;&lt;/title&gt;</pre>
<br />After saving the changes, press <a href="http://www.walkernews.net/2007/11/18/useful-ctrl-hotkey-in-windows-vista-and-xp/" title="Some of the useful CTRL related hotkeys for Windows system." rel="bookmark">CTRL+F5</a> to force browser refresh the cached content and verify the effect.<br />

<ul class="related_post"><li><a href="http://www.walkernews.net/2008/09/07/how-to-insert-multiple-images-in-wordpress-26-without-using-shortcode/" title="How To Insert Multiple Images In WordPress 2.6 Without Using Shortcode?">How To Insert Multiple Images In WordPress 2.6 Without Using Shortcode?</a></li><li><a href="http://www.walkernews.net/2008/06/30/how-to-edit-and-rewrite-post-slug-or-permalink-in-wordpress-25/" title="How To Edit And Rewrite Post Slug / Permalink In WordPress 2.5?">How To Edit And Rewrite Post Slug / Permalink In WordPress 2.5?</a></li><li><a href="http://www.walkernews.net/2009/04/17/how-to-create-image-template-file-for-the-classic-wordpress-theme/" title="How To Create Image Template File For The Classic WordPress Theme?">How To Create Image Template File For The Classic WordPress Theme?</a></li><li><a href="http://www.walkernews.net/2008/09/09/how-to-change-wordpress-image-caption-text-style-to-superscripts/" title="How To Change WordPress Image Caption Text Style To Superscripts?">How To Change WordPress Image Caption Text Style To Superscripts?</a></li><li><a href="http://www.walkernews.net/2008/08/19/favicon-how-to-create-a-website-icon-for-a-blog/" title="Favicon: How To Create A Website Icon For A Blog?">Favicon: How To Create A Website Icon For A Blog?</a></li><li><a href="http://www.walkernews.net/2008/08/17/windows-media-player-how-to-embed-wmv-file-in-html-code/" title="Windows Media Player: How To Embed WMV File In HTML Code?">Windows Media Player: How To Embed WMV File In HTML Code?</a></li><li><a href="http://www.walkernews.net/2008/09/11/wordpress-adds-wp-caption-text-to-css-file-for-image-caption-styling/" title="WordPress: Adds wp-caption-text To CSS File For Image Caption Styling">WordPress: Adds wp-caption-text To CSS File For Image Caption Styling</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.walkernews.net/2008/04/21/update-wp_title-to-display-blog-name-on-the-right/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

