<?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>bavotasan.com &#187; line</title>
	<atom:link href="http://bavotasan.com/tag/line/feed/" rel="self" type="application/rss+xml" />
	<link>http://bavotasan.com</link>
	<description>by c.bavota</description>
	<lastBuildDate>Tue, 07 Feb 2012 15:42:10 +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>A Simple CSS Trick to Vertically Align Text</title>
		<link>http://bavotasan.com/2010/a-simple-css-trick-to-vertically-align-text/</link>
		<comments>http://bavotasan.com/2010/a-simple-css-trick-to-vertically-align-text/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 17:33:08 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Center]]></category>
		<category><![CDATA[Containers]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[DIGGING]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[fff]]></category>
		<category><![CDATA[line]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[technique]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[trick]]></category>
		<category><![CDATA[way]]></category>
		<category><![CDATA[Width]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=2604</guid>
		<description><![CDATA[I was trying to vertically align text within a div container and it just wasn&#8217;t working for me. You would think that using vertical-align in your CSS would accomplish just that, but you would be wrong. I found a way to do it using three div containers and absolute positioning but I felt that was [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to vertically align text within a div container and it just wasn&#8217;t working for me. You would think that using <code>vertical-align</code> in your CSS would accomplish just that, but you would be wrong. I found a way to do it using three div containers and absolute positioning but I felt that was a little overkill for my purposes. </p>
<p>This was the box I was designing:</p>
<div style="width: 100px; height: 100px; background: #666; color: #fff; text-align: center; text-shadow: none;">Some Text</div>
<p>After doing a lot of digging around, I discovered that you could set the line-height of your text to be the same as the height of your div container and this is what you would get:</p>
<div style="width: 100px; height: 100px; background: #666; color: #fff; text-align: center; text-shadow: none; line-height: 100px;">Some Text</div>
<p>That did it. </p>
<p>Here is the CSS I used:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;">div<span style="color: #6666ff;">.container</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#666</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;">;</span> <span style="color: #808080; font-style: italic;">/* where the magic happens */</span>
<span style="color: #00AA00;">&#125;</span></pre></div></td></tr></table></div>

<p>The only way this technique wouldn&#8217;t work for you was if you had text on two lines, then the second line would be 100 pixels below the first. Hmm&#8230; maybe I could figure out a solution to that one as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2010/a-simple-css-trick-to-vertically-align-text/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Shorten Your Post Titles in WordPress</title>
		<link>http://bavotasan.com/2010/shorten-your-post-titles-in-wordpress/</link>
		<comments>http://bavotasan.com/2010/shorten-your-post-titles-in-wordpress/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 15:24:22 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[count]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[idea]]></category>
		<category><![CDATA[length]]></category>
		<category><![CDATA[line]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[magazine]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[php tags]]></category>
		<category><![CDATA[pop]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[reason]]></category>
		<category><![CDATA[Slideshow]]></category>
		<category><![CDATA[title]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=2542</guid>
		<description><![CDATA[This is not a function that you would need to use often, but I came across a reason to use it recently and I thought it might be a good idea to share it. All it does is limit the number of words in your title, just in case you don&#8217;t want it to wrap [...]]]></description>
			<content:encoded><![CDATA[<p>This is not a function that you would need to use often, but I came across a reason to use it recently and I thought it might be a good idea to share it. All it does is limit the number of words in your title, just in case you don&#8217;t want it to wrap onto a second line. I used it in the featured slideshow on <a href="http://themes.bavotasan.com/our-themes/premium-themes/magazine-premium/">Magazine Premium</a> since the size of the boxes is fixed.</p>
<p>Include this in your <code>functions.php</code> file between the PHP tags:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> short_title<span style="color: #009900;">&#40;</span><span style="color: #000088;">$after</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$length</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$mytitle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span> get_the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$length</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$mytitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;=</span><span style="color: #000088;">$length</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #990000;">array_pop</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$mytitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$mytitle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$mytitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span> <span style="color: #000088;">$after</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$mytitle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$mytitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$mytitle</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></td></tr></table></div>

<p>Then you can use it within the WordPress loop like this:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> short_title<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'...'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">8</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></td></tr></table></div>

<p>If you would rather count by characters instead of just words, you can add this function to your <code>functions.php</code> file instead of the one above:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> short_title<span style="color: #009900;">&#40;</span><span style="color: #000088;">$after</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #000088;">$length</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$mytitle</span> <span style="color: #339933;">=</span> get_the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$size</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$mytitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$size</span><span style="color: #339933;">&gt;</span><span style="color: #000088;">$length</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$mytitle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$mytitle</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$length</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$mytitle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span><span style="color: #000088;">$mytitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #990000;">array_pop</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$mytitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$mytitle</span> <span style="color: #339933;">=</span> <span style="color: #990000;">implode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot; &quot;</span><span style="color: #339933;">,</span><span style="color: #000088;">$mytitle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #000088;">$after</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$mytitle</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2010/shorten-your-post-titles-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>An Easy Way to Display an RSS Feed with PHP</title>
		<link>http://bavotasan.com/2010/display-rss-feed-with-php/</link>
		<comments>http://bavotasan.com/2010/display-rss-feed-with-php/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 05:48:41 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[course]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[desc]]></category>
		<category><![CDATA[description]]></category>
		<category><![CDATA[Elements]]></category>
		<category><![CDATA[Foreach]]></category>
		<category><![CDATA[idea]]></category>
		<category><![CDATA[limit]]></category>
		<category><![CDATA[line]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[loop]]></category>
		<category><![CDATA[org]]></category>
		<category><![CDATA[title]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=2530</guid>
		<description><![CDATA[RSS feeds are everywhere, and sometimes it&#8217;s a good idea to display one to keep people in the loop of important posts from your site, or sites you think might be relevant. Luckily, PHP 5 introduced the DOM extension which make it easy to work with XML documents. Now all it takes is just a [...]]]></description>
			<content:encoded><![CDATA[<p>RSS feeds are everywhere, and sometimes it&#8217;s a good idea to display one to keep people in the loop of important posts from your site, or sites you think might be relevant. Luckily, PHP 5 introduced the DOM extension which make it easy to work with XML documents. Now all it takes is just a small bit of code to fetch and display a feed.</p>
<p>The following code will first create a <code>new DOMDocument()</code> into which we will load the <a href="http://wordpress.org">WordPress.org</a> RSS feed.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$rss</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DOMDocument<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$rss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://wordpress.org/news/feed/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<p>Then we will single out certain elements and place them into an array. For this example, I will just fetch the title, description, link and published on date.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$feed</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$rss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'item'</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$node</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$item</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span> 
		<span style="color: #0000ff;">'title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'desc'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'description'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'link'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'link'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'date'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pubDate'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">,</span>
		<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">array_push</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$feed</span><span style="color: #339933;">,</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></td></tr></table></div>

<p>Finally, we set it to display 5 posts on screen with the titles linking directly to the original post.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$limit</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #000088;">$x</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$limit</span><span style="color: #339933;">;</span><span style="color: #000088;">$x</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' &amp; '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">' &amp;amp; '</span><span style="color: #339933;">,</span> <span style="color: #000088;">$feed</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$link</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$feed</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'link'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$description</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$feed</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'desc'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$date</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'l F d, Y'</span><span style="color: #339933;">,</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$feed</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'date'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$link</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; title=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$title</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$title</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;'</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;small&gt;&lt;em&gt;Posted on '</span><span style="color: #339933;">.</span><span style="color: #000088;">$date</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/em&gt;&lt;/small&gt;&lt;/p&gt;'</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;p&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$description</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/p&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></td></tr></table></div>

<p>Put it all together and this is what you get:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #000088;">$rss</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DOMDocument<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$rss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://wordpress.org/news/feed/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$feed</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$rss</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'item'</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$node</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$item</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span> <span style="color: #009900;">&#40;</span> 
			<span style="color: #0000ff;">'title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'desc'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'description'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'link'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'link'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'date'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pubDate'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">,</span>
			<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #990000;">array_push</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$feed</span><span style="color: #339933;">,</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000088;">$limit</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$x</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #000088;">$x</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$limit</span><span style="color: #339933;">;</span><span style="color: #000088;">$x</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' &amp; '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">' &amp;amp; '</span><span style="color: #339933;">,</span> <span style="color: #000088;">$feed</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'title'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$link</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$feed</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'link'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$description</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$feed</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'desc'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$date</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'l F d, Y'</span><span style="color: #339933;">,</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$feed</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$x</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'date'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$link</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; title=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$title</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$title</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;&lt;/strong&gt;&lt;br /&gt;'</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;small&gt;&lt;em&gt;Posted on '</span><span style="color: #339933;">.</span><span style="color: #000088;">$date</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/em&gt;&lt;/small&gt;&lt;/p&gt;'</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;p&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$description</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/p&gt;'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Not too complicated. All you need to change is the feed you want to load (line #3) and the number of posts to display (line #14). Of course, you could always play around with the output to get it styled exactly how you want. That is totally up to you.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2010/display-rss-feed-with-php/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>A Complete Re-Design</title>
		<link>http://bavotasan.com/2010/a-complete-re-design/</link>
		<comments>http://bavotasan.com/2010/a-complete-re-design/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 21:04:24 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[com]]></category>
		<category><![CDATA[contact]]></category>
		<category><![CDATA[direction]]></category>
		<category><![CDATA[idea]]></category>
		<category><![CDATA[line]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[need]]></category>
		<category><![CDATA[person]]></category>
		<category><![CDATA[Place]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[something]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=2486</guid>
		<description><![CDATA[Lately, I&#8217;ve been feeling bavotasan.com was looking a little too, how do you say, plain and boring. It was truly in dire need of a complete makeover but I couldn&#8217;t think of what direction to take it in. So instead of re-designing it myself, I thought it would be a good idea to enlist the [...]]]></description>
			<content:encoded><![CDATA[<p>Lately, I&#8217;ve been feeling <a href="http://bavotasan.com">bavotasan.com</a> was looking a little too, how do you say, plain and boring. It was truly in dire need of a complete makeover but I couldn&#8217;t think of what direction to take it in. So instead of re-designing it myself, I thought it would be a good idea to enlist the help of a friend of mine who just happens to be a great designer. <a href="http://www.rankmeup.com/">Jean-Marc Runner</a> and I have worked on quite a few projects together (<a href="http://www.coffreaprojets.com/">Réno Dépôt</a>,  <a href="http://www.sparklelikethestars.com/">Sparkle Like the Stars</a>, <a href="http://athome.kimvallee.com/">At Home with Kim Vallée</a>) and I couldn&#8217;t have picked a better person to give my site a modernized look. The site has been completely rebuilt from the ground up and boy, does it show. Take a look around and you&#8217;ll see what I mean.</p>
<p>If something seems out of place to you, or if you have any suggestions, please feel free to drop me a line through the contact link in the menu above or leave a comment below.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2010/a-complete-re-design/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>WordPress 3.0: Activating the Background Editor</title>
		<link>http://bavotasan.com/2010/wordpress-3-activating-background-editor/</link>
		<comments>http://bavotasan.com/2010/wordpress-3-activating-background-editor/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 21:31:39 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[admin user]]></category>
		<category><![CDATA[Background]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[line]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[panel]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Placing]]></category>
		<category><![CDATA[position]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[someone]]></category>
		<category><![CDATA[Wp]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=2193</guid>
		<description><![CDATA[Adding a color or image to your Web site&#8217;s background is not a very complicated thing to do if you are familiar with CSS. Luckily for those out there who know nothing about CSS, WordPress 3.0 introduces a simple admin user-interface that makes it extremely simple to select a color or image for your background. [...]]]></description>
			<content:encoded><![CDATA[<p>Adding a color or image to your Web site&#8217;s background is not a very complicated thing to do if you are familiar with CSS. Luckily for those out there who know nothing about CSS, WordPress 3.0 introduces a simple admin user-interface that makes it extremely simple to select a color or image for your background. There are even controls for image position, repeating and attachment.<br />
<span id="more-2193"></span><br />
<div id="attachment_2194" class="wp-caption aligncenter" style="width: 570px"><img src="http://bavotasan.com/wp-content/uploads/2010/06/background.jpg" alt="" title="Background Editor" width="560" height="420" class="size-full wp-image-2194" /><p class="wp-caption-text">The new background editor in WordPress 3.0</p></div></p>
<p>Activating the background editor only requires that you add one line of code to your theme&#8217;s <code>functions.php</code> file.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'add_custom_background'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> add_custom_background<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<p>This will add the &#8220;Background&#8221; link to your Appearance panel in the wp-admin. Placing it inside the <code>function_exists()</code> function makes it backwards compatible in case someone uses your theme with WordPress 2.9.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2010/wordpress-3-activating-background-editor/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Moving to Media Temple</title>
		<link>http://bavotasan.com/2010/movin-to-media-temple/</link>
		<comments>http://bavotasan.com/2010/movin-to-media-temple/#comments</comments>
		<pubDate>Wed, 12 May 2010 18:02:03 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Backend]]></category>
		<category><![CDATA[contact]]></category>
		<category><![CDATA[control]]></category>
		<category><![CDATA[drop]]></category>
		<category><![CDATA[everything]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[line]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=2001</guid>
		<description><![CDATA[You might experience some downtime on http://bavotasan.com and http://themes.bavotasan.com over the next little while. I have decided to migrate my sites over to Media Temple to have more control of everything on the backend. Once the migration is completed, both sites will be running better than ever. If you have any questions please drop me [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://bavotasan.com/wp-content/uploads/2010/05/media_temple.png"><img src="http://bavotasan.com/wp-content/uploads/2010/05/media_temple.png" alt="" title="media_temple" width="200" height="150" class="alignright size-full wp-image-2002" /></a>You might experience some downtime on <a href="http://bavotasan.com">http://bavotasan.com</a> and <a href="http://themes.bavotasan.com">http://themes.bavotasan.com</a> over the next little while. I have decided to migrate my sites over to <a href="http://mediatemple.net/">Media Temple</a> to have more control of everything on the backend. Once the migration is completed, both sites will be running better than ever.<br />
<span id="more-2001"></span><br />
If you have any questions please drop me a line through the <a href="http://bavotasan.com/contact/">contact form</a> here or on <a href="http://tinkerpriestmedia.com/contact/">Tinker Priest Media</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2010/movin-to-media-temple/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using jQuery to make an Expandable Code Box for WP-Syntax</title>
		<link>http://bavotasan.com/2009/using-jquery-to-make-an-expandable-code-box-for-wp-syntax/</link>
		<comments>http://bavotasan.com/2009/using-jquery-to-make-an-expandable-code-box-for-wp-syntax/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 17:43:00 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[animate]]></category>
		<category><![CDATA[background color]]></category>
		<category><![CDATA[border]]></category>
		<category><![CDATA[box]]></category>
		<category><![CDATA[Chris Coyier]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[fan]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[highlighter]]></category>
		<category><![CDATA[horizontal]]></category>
		<category><![CDATA[hover]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[line]]></category>
		<category><![CDATA[Lt]]></category>
		<category><![CDATA[minor changes]]></category>
		<category><![CDATA[overflow]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Plugin Code]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[syntax]]></category>
		<category><![CDATA[Syntax Highlighter]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[var]]></category>
		<category><![CDATA[Width]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress plugin]]></category>
		<category><![CDATA[Wp]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=1440</guid>
		<description><![CDATA[You may have noticed that I&#8217;m using a new syntax highlighter for my code snippets. I installed Ryan McGeary&#8216;s WordPress plugin WP-Syntax which uses GeSHi (Generic Syntax Highlighter), a simple highlighting class that supports multiple coding languages. It&#8217;s great but I&#8217;m not a fan of the horizontal scrollbar that appears if code extends past your [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://bavotasan.com/wp-content/uploads/2009/07/jquery.png" alt="jquery" title="jquery" width="200" height="150" class="alignright size-full wp-image-726" />You may have noticed that I&#8217;m using a new syntax highlighter for my code snippets. I installed <a href="http://ryan.mcgeary.org/">Ryan McGeary</a>&#8216;s WordPress plugin <a href="http://wordpress.org/extend/plugins/wp-syntax/">WP-Syntax</a> which uses <a href="http://qbnz.com/highlighter/">GeSHi</a> (Generic Syntax Highlighter), a simple highlighting class that supports multiple coding languages. It&#8217;s great but I&#8217;m not a fan of the horizontal scrollbar that appears if code extends past your site&#8217;s width. Instead, I decided to use <a href="http://jquery.com/">jQuery</a> to expand the box when you hover over it.<br />
<span id="more-1440"></span><br />
We need to make a few minor changes to the plugin code to get this to work. After you have downloaded, installed and activated the plugin, open up <code>wp-syntax.php</code> and go to line #113:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>113
114
115
116
117
118
119
120
121
122
123
124
125
126
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$line</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;table&gt;&lt;tr&gt;&lt;td class=<span style="color: #000099; font-weight: bold;">\&quot;</span>line_numbers<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> wp_syntax_line_numbers<span style="color: #009900;">&#40;</span><span style="color: #000088;">$code</span><span style="color: #339933;">,</span> <span style="color: #000088;">$line</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;/td&gt;&lt;td class=<span style="color: #000099; font-weight: bold;">\&quot;</span>code<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$geshi</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">parse_code</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">else</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span>code<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$geshi</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">parse_code</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>We need to add a table to the second output.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">    if <span style="color: #00AA00;">&#40;</span>$line<span style="color: #00AA00;">&#41;</span>
    <span style="color: #00AA00;">&#123;</span>
        $output .<span style="color: #00AA00;">=</span> <span style="color: #ff0000;">&quot;&lt;table&gt;&lt;tr&gt;&lt;td class=<span style="color: #000099; font-weight: bold;">\&quot;</span>line_numbers<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #00AA00;">;</span>
        $output .<span style="color: #00AA00;">=</span> wp_syntax_line_numbers<span style="color: #00AA00;">&#40;</span>$code<span style="color: #00AA00;">,</span> $line<span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
        $output .<span style="color: #00AA00;">=</span> <span style="color: #ff0000;">&quot;&lt;/td&gt;&lt;td class=<span style="color: #000099; font-weight: bold;">\&quot;</span>code<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #00AA00;">;</span>
        $output .<span style="color: #00AA00;">=</span> $geshi-<span style="color: #00AA00;">&gt;</span>parse_code<span style="color: #00AA00;">&#40;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
        $output .<span style="color: #00AA00;">=</span> <span style="color: #ff0000;">&quot;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&quot;</span><span style="color: #00AA00;">;</span>
    <span style="color: #00AA00;">&#125;</span>
    else
    <span style="color: #00AA00;">&#123;</span>
        $output .<span style="color: #00AA00;">=</span> <span style="color: #ff0000;">&quot;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&quot;</span><span style="color: #00AA00;">;</span>
        $output .<span style="color: #00AA00;">=</span> <span style="color: #ff0000;">&quot;&lt;div class=<span style="color: #000099; font-weight: bold;">\&quot;</span>code<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #00AA00;">;</span>
        $output .<span style="color: #00AA00;">=</span> $geshi-<span style="color: #00AA00;">&gt;</span>parse_code<span style="color: #00AA00;">&#40;</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>
        $output .<span style="color: #00AA00;">=</span> <span style="color: #ff0000;">&quot;&lt;/div&gt;&quot;</span><span style="color: #00AA00;">;</span>
        $output .<span style="color: #00AA00;">=</span> <span style="color: #ff0000;">&quot;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&quot;</span><span style="color: #00AA00;">;</span>
    <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>Next we need to open up <code>wp-syntax.css</code> to change a few of the styles. Change this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.wp_syntax</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#100</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#f9f9f9</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">silver</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">1.5em</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>to:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.wp_syntax</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#100</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#f9f9f9</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #993333;">silver</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">1.5em</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">590px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>I put a fixed width of 590px because I have set that as the maximum width of my single posts.</p>
<p>Now comes the <a href="http://jquery.com">jQuery</a>. Open up your theme&#8217;s <code>header.php</code> file and add the following between  your &lt;head&gt; tags.:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;">&lt;?php wp_enqueue_script(&quot;jquery&quot;); ?&gt;
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;</span>
jQuery<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.wp_syntax&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hover</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> width <span style="color: #339933;">=</span> jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;table&quot;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">width</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">var</span> pad <span style="color: #339933;">=</span> width <span style="color: #339933;">+</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>width <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">590</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		jQuery<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>
			.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
			.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
				zIndex<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;100&quot;</span><span style="color: #339933;">,</span>
				position<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;relative&quot;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>
			.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
				width<span style="color: #339933;">:</span> pad <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;px&quot;</span>
			<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			jQuery<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
				width<span style="color: #339933;">:</span> <span style="color: #CC0000;">590</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>What we are doing above is creating an effect that will only occur when you hover over the code box. It finds the width of the table and animates the expansion to the full width. When you hover out, the box returns to the fixed width of your post. Be sure that you set the two references to <em>590</em> to whatever you set your width to in the CSS.</p>
<p>Done and done!</p>
<p>To see this in action check out <a href="http://bavotasan.com/tutorials/how-to-create-a-twitter-feed-on-your-web-site/">How to Create a Twitter Feed on Your Web Site</a>.</p>
<p><strong>Resource</strong>: <a href="http://digwp.com/2009/07/making-an-expanding-code-box/">Making an Expanding Code Box by Chris Coyier</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/using-jquery-to-make-an-expandable-code-box-for-wp-syntax/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Remove the WordPress Generator</title>
		<link>http://bavotasan.com/2009/remove-the-wordpress-generator/</link>
		<comments>http://bavotasan.com/2009/remove-the-wordpress-generator/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 15:45:41 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[content]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[folder]]></category>
		<category><![CDATA[Hackers]]></category>
		<category><![CDATA[line]]></category>
		<category><![CDATA[Lt]]></category>
		<category><![CDATA[Meta]]></category>
		<category><![CDATA[name]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[version]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Wp]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=850</guid>
		<description><![CDATA[WordPress automatically places a line of text between your &#60;head&#62; tags which states the version you currently have installed. I have read that it is there for statistical reasons which is all fine and dandy, but sometimes showing off which version of WP you are using lets hackers know exactly what vulnerabilities your site has. [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress automatically places a line of text between your &lt;head&gt; tags which states the version you currently have installed. I have read that it is there for statistical reasons which is all fine and dandy, but sometimes showing off which version of WP you are using lets hackers know exactly what vulnerabilities your site has. </p>
<p>For security reasons, I suggest removing the generator, and doing so only takes one line of code.<br />
<span id="more-850"></span><br />
The WordPress generator line looks like this:</p>
<p><code>&lt;meta name="generator" content="WordPress 2.8" /&gt;</code></p>
<p>To get rid of it, open up your functions.php file. It is located in your theme&#8217;s folder. If there is no functions.php file, create one and just add the following code.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="php" style="font-family:monospace;">remove_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wp_generator'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<p>Be sure to place it between &lt;?php&gt;&lt;?&gt; tags.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/remove-the-wordpress-generator/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>How to Use the Important Declaration in CSS</title>
		<link>http://bavotasan.com/2009/how-to-use-the-important-declaration-in-css/</link>
		<comments>http://bavotasan.com/2009/how-to-use-the-important-declaration-in-css/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 17:15:43 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[line]]></category>
		<category><![CDATA[Placing]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[something]]></category>
		<category><![CDATA[Style]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[way]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=752</guid>
		<description><![CDATA[Sometimes when you are messing around with CSS, you can&#8217;t figure out why certain styles won&#8217;t stick. Most of the time, it&#8217;s because you are obviously doing something wrong, but other times you might just be missing the fact that your CSS is being overwritten somewhere else down the line. Remember, CSS stands for Cascading [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes when you are messing around with CSS, you can&#8217;t figure out why certain styles won&#8217;t stick. Most of the time, it&#8217;s because you are obviously doing something wrong, but other times you might just be missing the fact that your CSS is being overwritten somewhere else down the line. Remember, CSS stands for <strong>C</strong>ascading <strong>S</strong>tyle <strong>S</strong>heets, so styles you set further down will overwrite styles that are above.<br />
<span id="more-752"></span><br />
You have probably come across the solution several times when looking over CSS and you just might not have know that it was there.</p>
<p><strong>The <span style="color: #ff0000;">!Important</span> declaration</strong></p>
<p>Placing the <span style="color: #ff0000;">!Important</span> declaration after a style is a way to force that style to be applied even if they may be contradicted further down in your CSS.</p>
<p><strong>Examples:</strong></p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;">h1 <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ff0000</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
h1 <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></td></tr></table></div>

<p>In the above example, your H1 tags will be black.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;">h1 <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ff0000</span> &lt;span style<span style="color: #00AA00;">=</span><span style="color: #ff0000;">&quot;color: #ff0000;&quot;</span><span style="color: #00AA00;">&gt;</span>!Important&lt;/span<span style="color: #00AA00;">&gt;;</span> <span style="color: #00AA00;">&#125;</span>
h1 <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#000000</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></td></tr></table></div>

<p>By adding the <span style="color: #ff0000;">!Important</span> declaration, you force the first style to be applied even though the style below should overwrite it.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/how-to-use-the-important-declaration-in-css/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Simple Contact Form for WordPress: Redux</title>
		<link>http://bavotasan.com/2009/simple-contact-form-for-wordpress/</link>
		<comments>http://bavotasan.com/2009/simple-contact-form-for-wordpress/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 16:07:59 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Downloads]]></category>
		<category><![CDATA[Admin Panel]]></category>
		<category><![CDATA[Change]]></category>
		<category><![CDATA[contact]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[line]]></category>
		<category><![CDATA[org]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[panel]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Redux]]></category>
		<category><![CDATA[something]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[Upload]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=57</guid>
		<description><![CDATA[I have gone into this code and really cleaned it up to make it work properly with WordPress installs that are in subdirectories or wherever. I have also added a wicked little open source captcha script which I borrowed from the awesome folks at phpcaptcha.org to make the form 100 times more secure. INSTRUCTIONS: Upload [...]]]></description>
			<content:encoded><![CDATA[<p>I have gone into this code and really cleaned it up to make it work properly with WordPress installs that are in subdirectories or wherever. I have also added a wicked little open source captcha script which I borrowed from the awesome folks at <a href="http://www.phpcaptcha.org/">phpcaptcha.org</a> to make the form 100 times more secure.<br />
<span id="more-57"></span><br />
INSTRUCTIONS:</p>
<p>Upload the <code>contact.php</code> file and the <code>secureimage</code> folder to your current WordPress theme&#8217;s directory and then create a page in you admin panel. Choose &#8220;Contact&#8221; as your template and save the page as &#8220;Contact&#8221;. You need to have your permalinks set to Custom Structure or else you would need to change line 15 to something like <code>?p=123</code> (change 123 to the ID of your contact page).</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2009/simple-contact-form-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>

