<?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>jek2kdotcom &#187; WordPress</title>
	<atom:link href="http://www.jek2k.com/wp/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jek2k.com/wp</link>
	<description>still awake at night?</description>
	<lastBuildDate>Tue, 12 Jan 2010 14:52:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Pretty Permalinks on IIS</title>
		<link>http://www.jek2k.com/wp/2009/09/21/pretty-permalinks-on-iis/</link>
		<comments>http://www.jek2k.com/wp/2009/09/21/pretty-permalinks-on-iis/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 17:57:20 +0000</pubDate>
		<dc:creator>Nicolò</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.jek2k.com/wp/?p=314</guid>
		<description><![CDATA[Today I needed to optimise a WordPress-driven website for SEO reasons. First thing to do was to enable pretty permalinks, but the website was hosted on a Windows server using IIS 6.0. The best I could obtain out-of-the-box is a permalink structure like this one:
http://www.my-domain.com/index.php/2009/09/21/my-pretty-permalink/
This is better than appending post IDs in  the querystring, but [...]]]></description>
			<content:encoded><![CDATA[<p>Today I needed to optimise a WordPress-driven website for SEO reasons. First thing to do was to enable pretty permalinks, but the website was hosted on a Windows server using IIS 6.0. The best I could obtain out-of-the-box is a permalink structure like this one:<em><br />
http://www.my-domain.com/index.php/2009/09/21/my-pretty-permalink/</em></p>
<p>This is better than appending post IDs in  the querystring, but is still far from perfect, as it includes the &#8216;index.php&#8217; string in the URL.</p>
<p>I googled around for possible solutions and workarounds and found <a href="http://www.ikailo.com/94/url-modrewrite-workaround-iis-60/" target="_blank">this useful article</a>. This worked pretty good, but unfortunately didn&#8217;t cater to existing permalinks. In other words, using permalinks like the one above resulted in 404 errors.</p>
<p>I modified the PHP code slightly to add support for existing permalinks (with &#8216;index.php&#8217; in them), so the blog can use pretty permalinks, but old posts linked elsewhere with ugly permalinks work too.</p>
<p><span id="more-314"></span></p>
<p><strong>Source code:</strong></p>
<pre class="brush: php;">
&lt;?php
// This is the default file for the site. Usually index.php
$default = 'index.php';

// The name of this file.
// Set this value for the URL in Custom Error Properties of your website in IIS.
// Goto: IIS Manager &gt; Websites &gt; [Site Name] &gt; Properties &gt; Custom Errors &gt;
// 404 &amp; 404;2 &amp; 404;3 &gt; URL (Requires a '/' prefix in IIS).
$thisfile = '404-handler.php';

$_SERVER['ORIG_PATH_TRANSLATED'] = str_replace($thisfile, $default, $_SERVER['ORIG_PATH_TRANSLATED']);
$_SERVER['SCRIPT_FILENAME'] = str_replace($thisfile, $default, $_SERVER['SCRIPT_FILENAME']);
$_SERVER['ORIG_PATH_INFO'] = str_replace($thisfile, $default, $_SERVER['ORIG_PATH_INFO']);
$_SERVER['SCRIPT_NAME'] = str_replace($thisfile, $default, $_SERVER['SCRIPT_NAME']);
$_SERVER['PHP_SELF'] = str_replace($thisfile, $default, $_SERVER['PHP_SELF']);
$_SERVER['PATH_INFO'] = false;

$qs =&amp; $_SERVER['QUERY_STRING'];
$ru =&amp; $_SERVER['REQUEST_URI'];

// Fix for existing permalinks  (eg. http://www.my-domain.com/index.php/2009/09/21/my-pretty-permalink/)
if(strpos($ru,'/'.$default.'/',0)) $ru = str_replace('/'.$default.'/','',$_SERVER['REQUEST_URI']);

$pos = strrpos($qs, '://');
$pos = strpos($qs, '/', $pos + 4);
$_SERVER['URL'] = $ru = substr($qs, $pos);
$qs = trim(stristr($ru, '?'), '?');

// Required for Wordpress 2.8+
$_SERVER['HTTP_X_ORIGINAL_URL'] = $ru;

// Fix GET vars
foreach ( $_GET as $var =&gt; $val ) {
 if ( substr($var, 0, 3) == '404') {
 if ( strstr($var, &quot;?&quot;) ) {
 $newvar = substr($var, strpos($var, '?') + 1);
 $_GET[$newvar] = $val;
 }
 unset($_GET[$var]);
 }
 break;
}
include($default);
?&gt;
</pre>
<p>While I know this is just a workaround, this seems to have solved my problem and works pretty good so far.<br />
If anyone knows of better solutions, comments are welcome!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jek2k.com/wp/2009/09/21/pretty-permalinks-on-iis/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Some WordPress optimization tips</title>
		<link>http://www.jek2k.com/wp/2009/02/27/some-wordpress-optimization-tips/</link>
		<comments>http://www.jek2k.com/wp/2009/02/27/some-wordpress-optimization-tips/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 11:08:09 +0000</pubDate>
		<dc:creator>Nicolò</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.jek2k.com/wp/?p=262</guid>
		<description><![CDATA[I&#8217;ve recently had to move my company&#8217;s WordPress-based site to a new server. This gave me the chance to do some little tweaks to a 2-year-old site. I focused on optimizing WordPress, to improve site&#8217;s performance while decreasing CPU and server load. Since I was able to reduce the load time of my company&#8217;s site [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently had to move my company&#8217;s WordPress-based site to a new server. This gave me the chance to do some little tweaks to a 2-year-old site. I focused on optimizing WordPress, to improve site&#8217;s performance while decreasing CPU and server load. Since I was able to reduce the load time of my company&#8217;s site significantly (I used <a href="http://developer.yahoo.com/yslow/">YSlow</a> to monitor performances), I thought to share the steps I followed, as I feel this might be helpful.</p>
<p><strong>1. Install WP Super Cache plugin</strong></p>
<p>You can <a href="http://wordpress.org/extend/plugins/wp-super-cache/">download the plugin here</a> &#8211; it&#8217;s pretty easy to setup.<br />
The plugin itself does 80% of the work and helps a lot speeding up load times.</p>
<p><strong>2. Add some .htaccess rules to force caching of static elements, such as css, javascripts and images.</strong><br />
I had the chance to attend to <a href="http://www.fullo.net/blog/archives/2008/05/08/piccoli-suggerimenti-per-rendere-wordpress-piu-performante/">Fullo&#8217;s speech about WP optimization</a> at last year&#8217;s WordCamp Italy, when he shared some really useful tips that I finally put into practice. He has posted the slides to his blog, with code snippets.<span id="more-262"></span></p>
<pre class="brush: php;">

&lt;IfModule mod_expires.c&gt;
ExpiresActive On
ExpiresDefault &quot;access plus 1 seconds&quot;
ExpiresByType text/html &quot;access plus 1 seconds&quot;
ExpiresByType image/gif &quot;access plus 2592000 seconds&quot;
ExpiresByType image/jpeg &quot;access plus 2592000 seconds&quot;
ExpiresByType image/png &quot;access plus 2592000 seconds&quot;
ExpiresByType text/css &quot;access plus 604800 seconds&quot;
ExpiresByType text/javascript &quot;access plus 216000 seconds&quot;
ExpiresByType application/x-javascript &quot;access plus 216000 seconds&quot;
&lt;/IfModule&gt;

&lt;IfModule mod_headers.c&gt;
&lt;FilesMatch &quot;\\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$&quot;&gt;
Header set Cache-Control &quot;max-age=2592000, public&quot;
&lt;/FilesMatch&gt;
&lt;FilesMatch &quot;\\.(css)$&quot;&gt;
Header set Cache-Control &quot;max-age=604800, public&quot;
&lt;/FilesMatch&gt;
&lt;FilesMatch &quot;\\.(js)$&quot;&gt;
Header set Cache-Control &quot;max-age=216000, public&quot;
&lt;/FilesMatch&gt;
&lt;/IfModule&gt;
</pre>
<p><strong>3. Add some .htaccess rules to enable compression of Html pages</strong></p>
<p>This trick was suggested by my friend <a href="http://www.luscarpa.eu">Luca</a>, who also sent me the following code:</p>
<pre class="brush: php;">

# compress all text &amp;amp;amp; html:
AddOutputFilterByType DEFLATE text/html text/plain text/xml

# Or, compress certain file types by extension:
&lt;Files *.css&gt;
SetOutputFilter DEFLATE
&lt;/Files&gt;
&lt;Files *.js&gt;
SetOutputFilter DEFLATE
&lt;/Files&gt;
</pre>
<p><strong>4. Finally, add a robots.txt file to prevent </strong><strong>unnecessary </strong><strong>bot traffic</strong></p>
<p>This was also suggested by <a href="http://www.fullo.net/blog/archives/2008/05/08/piccoli-suggerimenti-per-rendere-wordpress-piu-performante/">Fullo</a>&#8217;s priceless slides:</p>
<pre class="brush: php;">

User-agent: *
Disallow: /cgi-bin
Disallow: /wp-admin
Disallow: /wp-includes
Disallow: /wp-content

User-agent: Mediapartners-Google
Allow: /

User-agent: Adsbot-Google
Allow: /

User-agent: Googlebot-Image
Allow: /

User-agent: Googlebot-Mobile
Allow: /

User-agent: ia_archiver-web.archive.org
Disallow: /
</pre>
<p>Before leaving you, here are some other useful articles I&#8217;ve found while googling around:</p>
<ul>
<li><a href="http://codex.wordpress.org/WordPress_Optimization">WordPress Codex › WordPress Optimization</a></li>
<li><a href="http://www.prelovac.com/vladimir/wordpress-optimization-guide">WordPress Optimization Bible</a></li>
<li><a href="http://www.connectedinternet.co.uk/2006/06/18/guide-to-optimizing-wordpress-servers/">Optimizing WordPress Servers</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.jek2k.com/wp/2009/02/27/some-wordpress-optimization-tips/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Display subscriber count for FeedBurner feeds hosted by Google</title>
		<link>http://www.jek2k.com/wp/2009/01/30/display-subscriber-count-for-feedburner-feeds-hosted-by-google/</link>
		<comments>http://www.jek2k.com/wp/2009/01/30/display-subscriber-count-for-feedburner-feeds-hosted-by-google/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 09:00:46 +0000</pubDate>
		<dc:creator>Nicolò</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.jek2k.com/wp/?p=230</guid>
		<description><![CDATA[If you&#8217;re using FeedBurner to manage and publicize your RSS feeds, you might already know WordPress plugins like FeedCount, that help you get the number of your feed&#8217;s subscribers &#8211; btw, I&#8217;m assuming you too can&#8217;t stand the ugly FeedBurner default widget.
While this used to work as a charm, you also might have heard FeedBurner [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re using FeedBurner to manage and publicize your RSS feeds, you might already know WordPress plugins like <a href="http://www.mapelli.info/feed/feed-count-12">FeedCount</a>, that help you get the number of your feed&#8217;s subscribers &#8211; btw, I&#8217;m assuming you too can&#8217;t stand the ugly FeedBurner default widget.</p>
<p>While this used to work as a charm, you also might have heard FeedBurner has been aquired by Google and it&#8217;s moving feed to Google&#8217;s server. Unfortunately the above plugin stops working for feeds hosted by Google.</p>
<p>My friend <a href="http://pestaola.gr">Stefanos (aka Titanas)</a> recently sent me this piece of code, that easily solves this issue.<br />
It will display the number of your subscribers, <a href="http://playground.gnvpartners.net/ex/feed_count/">like this</a>. </p>
<pre class="brush: php;">
&lt;?php
function get_subscriptors($feedburneruri) {
         $url=&quot;https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=&quot;.$feedburneruri;
         $ch = curl_init();
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
         curl_setopt($ch, CURLOPT_URL, $url);
         $data = curl_exec($ch); curl_close($ch);
         $xml = new SimpleXMLElement($data);
         return $xml-&gt;feed-&gt;entry['circulation'];
}
?&gt;
Jek2k.com has &lt;?php echo get_subscriptors('jek2kdotcom'); ?&gt; subscribers.
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.jek2k.com/wp/2009/01/30/display-subscriber-count-for-feedburner-feeds-hosted-by-google/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Being hacked</title>
		<link>http://www.jek2k.com/wp/2009/01/26/being-hacked/</link>
		<comments>http://www.jek2k.com/wp/2009/01/26/being-hacked/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 11:33:14 +0000</pubDate>
		<dc:creator>Nicolò</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.jek2k.com/wp/?p=190</guid>
		<description><![CDATA[Yesterday a friend of mine emailed me about my site showing odd numbers in the footer.
After contacting my hosting provider and checking my WordPress files, it turned out that my site had been hacked, exploiting a WordPress breach.
My index.php file had been modified, adding the following malicious PHP code:

function security_update($buffer)
{
  $update = '18446744073709551615';
  [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday a friend of mine emailed me about <a href="http://www.gnvpartners.com/">my site</a> showing odd numbers in the footer.</p>
<p style="text-align: left;">After contacting my hosting provider and checking my WordPress files, it turned out that my site had been hacked, exploiting a WordPress breach.<br />
My index.php file had been modified, adding the following malicious PHP code:</p>
<pre class="brush: php;">
function security_update($buffer)
{
  $update = '18446744073709551615';
     if (stristr($buffer, '&lt;/html') !== FALSE)
     {
          return eregi_replace('&lt;/html', $update.'&lt;html', $buffer);
     }
          else
     {
          return $buffer.$update;
     }
}
</pre>
<p style="text-align: left;">This code simply output the string &#8220;18446744073709551615&#8243; in the site&#8217;s footer &#8211; I didn&#8217;t even notice it.<br />
Removing this code from index.php fixed the problem. Fortunately this didn&#8217;t cause no harm to the site&#8217;s visitors or to the site itself.</p>
<p style="text-align: left;">I&#8217;ve googled around for some more info and found <a href="http://wordpress.org/support/topic/232657">this forum post</a>, reporting the same issue. The odd thing is this issue is reported to affect WordPress &lt; 2.6.5, while I &#8216;m using WordPress 2.7 on my site, which is supposed to fix this security vulnerability.</p>
<p style="text-align: left;">If you have experienced a similar issue and need help, or if you can share more detailed information, please leave a comment to this post.<br />
<a href="http://ocaoimh.ie/2008/06/08/did-your-wordpress-site-get-hacked/"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jek2k.com/wp/2009/01/26/being-hacked/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WP Tiger Style Administration</title>
		<link>http://www.jek2k.com/wp/2006/12/30/wp-tiger-style-administration/</link>
		<comments>http://www.jek2k.com/wp/2006/12/30/wp-tiger-style-administration/#comments</comments>
		<pubDate>Sat, 30 Dec 2006 18:56:53 +0000</pubDate>
		<dc:creator>Nicolò</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.jek2k.com/wp/index.php/2006/12/30/wp-tiger-style-administration/</guid>
		<description><![CDATA[
I recently installed the brand new 3.0 version of the known WP Tiger Administration plugin.
This useful plugin by Ordered List converts the defaut WordPress administration panel style into a Tiger-like style, by changing only the CSS stylesheet, with no changes to the WordPress core.
In the past I tried the 2.0 version of this plugin, but [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><img id="image125" src="http://www.jek2k.com/wp//wp/wp-content/uploads/2006/12/wp_tiger.jpg" alt="wp_tiger.jpg" /></p>
<p>I recently installed the brand new 3.0 version of the known <a href="http://orderedlist.com/wordpress-plugins/wp-tiger-administration/">WP Tiger Administration plugin</a>.<br />
This useful plugin by <a href="http://orderedlist.com/">Ordered List</a> converts the defaut WordPress administration panel style into a Tiger-like style, by changing only the CSS stylesheet, with no changes to the WordPress core.</p>
<p>In the past I tried the 2.0 version of this plugin, but I wasn&#8217;t really impressed.<br />
This new version is much better and has a cleaner look.<br />
I also found it very easy to switch from the WordPress default tabbed view to this new 3 columns Tiger-style view. I even find this more intuitive and more ordered.</p>
<p>I suggest giving this plugin a try.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jek2k.com/wp/2006/12/30/wp-tiger-style-administration/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Getting spammed</title>
		<link>http://www.jek2k.com/wp/2006/12/04/getting-spammed/</link>
		<comments>http://www.jek2k.com/wp/2006/12/04/getting-spammed/#comments</comments>
		<pubDate>Mon, 04 Dec 2006 19:18:03 +0000</pubDate>
		<dc:creator>Nicolò</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.jek2k.com/wp/index.php/2006/12/04/getting-spammed/</guid>
		<description><![CDATA[In the last few weeks this blog started getting tons of comment spam. The more visibility I got, the more spam I received. That&#8217;s the equation.
Some days ago, I decided to go for the famous Askimet, as manually moderating and deleting spam comments was starting to take me too much time.
Since I installed it, in [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.jek2k.com/wp//wp/wp-content/uploads/2006/12/askimet.thumbnail.jpg" alt="askimet.jpg" style="float:left; margin:0 20px 10px 0;" />In the last few weeks this blog started getting tons of comment spam. The more visibility I got, the more spam I received. That&#8217;s the equation.</p>
<p>Some days ago, I decided to go for the famous <a href="http://akismet.com/">Askimet</a>, as manually moderating and deleting spam comments was starting to take me too much time.</p>
<p>Since I installed it, in a short time, Askimet identified 51 comments as spam and queued them for deletion. It just missed to catch one spam comment. Nice job!</p>
<p>By the way, I noticed comment spam is starting to affect also some of my clients&#8217; websites, not only those WordPress- or CMS-based, but even old websites and CGI-based forms and guestbooks. This will cause (and is already causing) me lots of extra work to implement ways of blocking spam, since there is not always an easy and effecient way as Askimet. And personally I don&#8217;t like to use <a href="http://en.wikipedia.org/wiki/CAPTCHA">CAPTCHAs</a>, as I think they lower the usability, accessibility and friendlyness level of a website. Moreover CAPTCHAs just look too ugly.</p>
<p>This is really a bad problem to solve.<br />
Everyday I read of new solutions as well as of new methods to crack the newly invented solutions, leaving me a bit confused on this point.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jek2k.com/wp/2006/12/04/getting-spammed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New projects</title>
		<link>http://www.jek2k.com/wp/2006/11/17/new-projects/</link>
		<comments>http://www.jek2k.com/wp/2006/11/17/new-projects/#comments</comments>
		<pubDate>Fri, 17 Nov 2006 18:46:23 +0000</pubDate>
		<dc:creator>Nicolò</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.jek2k.com/wp/index.php/2006/11/17/new-projects/</guid>
		<description><![CDATA[
Ta-da! The redesign of PhotoMatt goes live. Yes, that PhotoMatt.
I had the honor to design the new graphic theme of Matt Mullenweg&#8217;s personal website. I still have problems believing it&#8230; it is kind of a dream.
However, the website is still under constrution, as Matt and I we&#8217;re still working on designing (me) and coding (Matt) [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><img src="http://www.jek2k.com/wp/wp/wp-content/uploads/2006/11/photomatt.jpg" alt="photomatt.jpg" /></p>
<p>Ta-da! The redesign of <a href="http://photomatt.net">PhotoMatt</a> goes live. Yes, <strong>that</strong> PhotoMatt.<br />
I had the honor to design the new graphic theme of Matt Mullenweg&#8217;s personal website. I still have problems believing it&#8230; it is kind of a dream.</p>
<p>However, the website is still under constrution, as Matt and I we&#8217;re still working on designing (me) and coding (Matt) secondary pages and making small changes here and there.</p>
<p>Here are a couple of articles and reviews:<br />
- <a href="http://photomatt.net/2006/11/13/new-blog-design/">New Blog Design</a> on PhotoMatt<br />
- <a href="http://lorelle.wordpress.com/2006/11/14/matt-mullenweg-gets-new-clothes/">Matt Mullenweg gets new clothes</a> on Lorelle on Wordpress<br />
- <a href="http://www.disordine.com/2006/11/14/un-riminese-per-photomatt/">Un riminese per Photomatt</a> su Disordine.com<br />
- a <a href="http://ifelse.co.uk/archives/2006/11/12/photomatts-redesign/">quick review on If&#8230;Else</a><br />
- PhotoMatt on <a href="http://www.cssremix.com/showcase/photo-matt">Css Remix</a>, on <a href="http://cssmania.com/galleries/2006/11/13/photo-matt.php">Css Mania</a> and <a href="http://www.cssbloom.com/2006/11/13/photo-matt/">Css Bloom </a>.</p>
<p>Whoa!</p>
<p>&nbsp;</p>
<p style="text-align:center;"><img src="http://www.jek2k.com/wp/wp/wp-content/uploads/2006/11/mp.jpg" alt="mp.jpg" /></p>
<p>Also the new skin of <a href="http://www.mintpages.net">MintPages</a> went live in the last few days. MintPages is a private community for designers and developers <a href="http://www.jek2k.com/wp/index.php/2006/08/16/mintpages/">I&#8217;m a proud member of</a>.<br />
I designed the new skin for the forums and this is another great honor for me.</p>
<p>Here is an <a href="http://www.devlounge.net/sidenotes/mintpages-goes-final">article that appeared on DevLounge</a> to celebrate the launch of the new MintPages.</p>
<p>&nbsp;</p>
<p>As you can see I also added the small icons at the bottom, in the Portfolio section.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jek2k.com/wp/2006/11/17/new-projects/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress: displaying content outside the Loop</title>
		<link>http://www.jek2k.com/wp/2006/10/30/wordpress-displaying-content-outside-the-loop/</link>
		<comments>http://www.jek2k.com/wp/2006/10/30/wordpress-displaying-content-outside-the-loop/#comments</comments>
		<pubDate>Mon, 30 Oct 2006 11:59:45 +0000</pubDate>
		<dc:creator>Nicolò</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.jek2k.com/wp/index.php/2006/10/30/wordpress-displaying-content-outside-the-loop/</guid>
		<description><![CDATA[I assume everyone out there know what WordPress is and what it does.
The Loop is the process that occurs when WordPress reads the database and outputs your posts or pages to the destination Html page.
A more detailed explanation can be found here.
Inside the Loop you can use Template Tags (see this page) to modify the [...]]]></description>
			<content:encoded><![CDATA[<p>I assume everyone out there know what WordPress is and what it does.</p>
<p><strong>The Loop</strong> is the process that occurs when WordPress reads the database and outputs your posts or pages to the destination Html page.<br />
A more detailed explanation can be found <a href="http://codex.wordpress.org/The_Loop">here</a>.</p>
<p>Inside the Loop you can use <strong>Template Tags</strong> (<a href="http://codex.wordpress.org/Template_Tags">see this page</a>) to modify the output information and choose what elements of the post should be displayed (see <a href="http://codex.wordpress.org/Template_Tags#Post_tags">Post Tags</a>).</p>
<p>This is the very basic concept behind WordPress templates.</p>
<p>With WordPress you have also the ability to make <strong>custom queries</strong> to the database to extract your specific content.<br />
In this case, you will need the following sintax:<br />
<pre><pre>
&lt;?php query_posts(&#039;category_name=news&amp;showposts=5&#039;); ?&gt;
&lt;?php if (have_posts()) : ?&gt;
&lt;?php while (have_posts()) : the_post(); ?&gt;

&nbsp;&nbsp;&nbsp;&nbsp; &lt;div class=&quot;news&quot;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h4&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h4&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php the_excerpt(); ?&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp; &lt;/div&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;?php endwhile; ?&gt;
&lt;?php endif; ?&gt;
</pre></pre></p>
<p>The code above works perfectly when you are inside the Loop, <strong>but what if you are outside of it?</strong><br />
Or if you want to include contents from two different loops, for example for making an Asides section?<br />
Then the <strong>query_posts()</strong> function will not be of any help.</p>
<p>You will have to make a totally new custom query, using a different sintax.<br />
This is needed in order to not overwrite the data retrieved by the main Loop query.</p>
<p>It will look like this:<br />
<pre><pre>
&lt;?php $my_query = new WP_Query(&#039;pagename=another-static-page&#039;); ?&gt;
&lt;?php while ($my_query-&gt;have_posts()) : $my_query-&gt;the_post(); ?&gt;
&lt;?php $do_not_duplicate = $post-&gt;ID; ?&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h1&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php the_content(); ?&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;?php endwhile; ?&gt;
</pre></pre></p>
<p>The first line:<br />
<pre><pre>
&lt;?php $my_query = new WP_Query(&#039;pagename=another-static-page&#039;); ?&gt;
</pre></pre><br />
makes the new query and storing the retrieved data inside the <strong>$my_query</strong> variable.<br />
That&#8217;s the reason why we have that strange sintax <strong>$my_query->have_posts()</strong> later on.<br />
This ensures we are browsing data only inside our new variable.</p>
<p>This line:<br />
<pre><pre>
&lt;?php $do_not_duplicate = $post-&gt;ID; ?&gt;
</pre></pre><br />
makes sure we&#8217;re not duplicating posts, so the same post won&#8217;t appear in both queries.</p>
<p>As you can see, then we can output the information with the same good old sintax:<br />
<pre><pre>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php the_content(); ?&gt;
</pre></pre></p>
<p>This way of retrieving and displaying custom information from your WordPress database comes very handy when creating advanced themes or when using WP as a CMS platform and you want to have full control on what is displayed. </p>
<p>As always, the best place to find exhaustive information about Wordpress tweaks is the <a href="http://codex.wordpress.org">Codex website.</a></p>
<p class="note">This tutorial is provided as is. Please do not email me questions or support requests about the scripts contained in this page. Use the comments below instead. Thank you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jek2k.com/wp/2006/10/30/wordpress-displaying-content-outside-the-loop/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hemingway + Lightbox</title>
		<link>http://www.jek2k.com/wp/2006/06/28/hemingway-lightbox/</link>
		<comments>http://www.jek2k.com/wp/2006/06/28/hemingway-lightbox/#comments</comments>
		<pubDate>Wed, 28 Jun 2006 16:34:55 +0000</pubDate>
		<dc:creator>Nicolò</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.jek2k.com/wp/index.php/2006/06/28/hemingway-lightbox/</guid>
		<description><![CDATA[A few days ago I got an email from milo317 from Germany, asking me how  to integrate Lightbox and the Hemingway theme for WordPress, as I did on this website.
That&#8217;s exactly what I&#8217;m going to do in this post. 
For those of you out there who still don&#8217;t know Lightbox, this is a powerful [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago I got an email from milo317 from Germany, asking me how  to integrate Lightbox and the Hemingway theme for WordPress, as I did on this website.<br />
That&#8217;s exactly what I&#8217;m going to do in this post. </p>
<p>For those of you out there who still don&#8217;t know Lightbox, this is a powerful and very functional Javascript utility to display your images. Clean, light-weight, but yet very effective.<br />
  The only fault of Lightbox is that its Css stylesheet doesn&#8217;t validate, because of some proprietary rules for Explorer and Mozilla. However, if you&#8217;re not obsessed about standards or addicted to validation, I believe you will find Lightbox very useful and be using it in many of your projects. <br />
You can get the 2.0 release on <a href="http://www.huddletogether.com/projects/lightbox2/" target="_blank">huddletogether.com</a>.</p>
<p>Hemingway is a quite a popular WordPress theme. This site is also based on the Hemingway theme, obviously spiced up and changed to meet my needs.<br />
  You can download Hemingway from <a href="http://warpspire.com/hemingway" target="_blank">warpspire.com/hemingway</a>.</p>
<p>So, now let&#8217;s see hot to make them work together.<br />
Please note that this tutorial assumes that you have WordPress installed in the <strong>/wordpress/</strong> folder on your server. If you installed it in another directory, keep in mind that you have to change folder and file paths to match your specific configuration.
</p>
<p>First, you need to install the Hemingway theme.<br />
All you need to do is following the instructions included in the package. </p>
<p>Quick recap:<br />
  <strong>1.</strong> unzip the package,<br />
  <strong>2.</strong> upload the <strong>hemingway</strong> folder to your server with an FTP client,<br />
  <strong>3.</strong> put it in the <strong>/wordpress/wp-content/themes/</strong> folder,<br />
<strong>4.</strong> go to your WP admin panel,<br />
<strong>5.</strong> in the <strong>Presentation</strong> section, select and activate the Hemingwat theme,<br />
<strong>6.</strong> go back to your blog, take a look around and congrat yourself: you made it!</p>
<p>If these few instrucions don&#8217;t solve your problem, please don&#8217;t email: I&#8217; m  a WP and Hemingway user just like you. You can get quality support at <a href="http://discuss.warpspire.com/" target="_blank">discuss.warpspire.com</a>.</p>
<p>Next step is getting Lighbox to work with Hemingway.<br />
And this is a little more complicated. </p>
<p>Let&#8217;s go step by step:<br />
  <strong>1.</strong> unzip the package,<br />
  <strong>2.</strong> upload the <strong>js</strong> folder to you server with an FTP client,<br />
  <strong>3.</strong> put it inside your <strong>/wordpress/wp-content/themes/hemingway/</strong> folder,</p>
<p><strong>4.</strong> in the Lightbox package you have an <strong>images</strong> folder.<br />
  Upload the content of this folder to the already existing <strong>/wordpress/wp-content/themes/hemingway/images/</strong> folder.<br />
  This will add the required Lightbox images to the Hemingway standard installation. </p>
<p><strong>5.</strong> Same thing with the <strong>css</strong> folder. <br />
Pick the <strong>lightbox.css</strong> file inside it and upload it to your <strong>/wordpress/wp-content/themes/hemingway/styles/</strong> folder.<br />
Using this folder structure, you don&#8217;t need to change anything in the Lightbox stylesheet.</p>
<p>Unfortunately, you will still need to change a couple of lines in the main <strong>lightbox.js</strong> file. <br />
    <strong>6.</strong> open the <strong>lightbox.js</strong> file with a text editor or with Dreamweaver,<br />
      <strong>7.</strong> at lines 62 and 63 you need to change</p>
<p><pre><pre>var fileLoadingImage = &quot;images/loading.gif&quot;;
var fileBottomNavCloseImage = &quot;images/closelabel.gif&quot;;</pre></pre></p>
<p>to this </p>
<p><pre><pre>var fileLoadingImage = &quot;/wordpress/wp-content/themes/hemingway/images/loading.gif&quot;;
var fileBottomNavCloseImage = &quot;/wordpress/wp-content/themes/hemingway/images/closelabel.gif&quot;;</pre></pre></p>
<p>This will adapt Lightbox to the Hemingway folder structure.</p>
<p>Now we need to integrate Lightbox,<br />
      <strong>8.</strong> in the <strong>/wordpress/wp-content/themes/hemingway/</strong> locate the <strong>header.php</strong> file ,<br />
      <strong>9.</strong> open it in a text editor or in Dreamweaver,<br />
    <strong>10.</strong> in the <strong>head</strong> of the document, add these lines:</p>
<p><pre><pre>&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php bloginfo(&#039;stylesheet_directory&#039;); ?&gt;/js/prototype.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php bloginfo(&#039;stylesheet_directory&#039;); ?&gt;/js/scriptaculous.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php bloginfo(&#039;stylesheet_directory&#039;); ?&gt;/js/lightbox.js&quot;&gt;&lt;/script&gt;</pre></pre><br />
This will include the required JS scripts in every WordPress generated page.</p>
<p><strong>11.</strong> always in the <strong>head</strong> of the <strong>header.php</strong> file add this line:<br />
<pre><pre>
&lt;link rel=&quot;stylesheet&quot; href=&quot;&lt;?php bloginfo(&#039;stylesheet_directory&#039;); ?&gt;/styles/lightbox.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt; 
</pre></pre><br />
This will add the required Css stylesheet for Lightbox in your WordPress content.</p>
<p>Now, let&#8217;s try it!<br />
<strong>12.</strong> open your WP admin panel and write a new post,<br />
<strong>13.</strong> insert a link to an uploaded image, using this sintax:<br />
<pre><pre>
&lt;a href=&quot;images/image-1.jpg&quot; rel=&quot;lightbox&quot; title=&quot;my caption&quot;&gt;image #1&lt;/a&gt;
</pre></pre></p>
<p>Obviously you need to change this line of code to match your image path.</p>
<p><strong>14.</strong> Go to the newly posted artcicle and test the link. Is it working?<br />
If yes, then you made it!<br />
If it&#8217;s not working, either you messed up something or my tutorial is wrong.<br />
Remember to run the test with a modern browser, don&#8217;t even try to do it with IE or older browsers!</p>
<p>Please refer to <a href="http://www.huddletogether.com/projects/lightbox2/#support" target="_blank">this site</a> to get Lightbox-specific help.<br />
For Hemingway and Lightbox integration issues, you can comment this post, email me or simply analyze and copy the source code of my WordPress pages!</p>
<p>Hope you will find this helpful. Bye. </p>
<p class="note">This tutorial is provided as is. Please do not email me questions or support requests about the scripts contained in this page. Use the comments below instead. Thank you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jek2k.com/wp/2006/06/28/hemingway-lightbox/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
