<?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; link</title>
	<atom:link href="http://bavotasan.com/tag/link/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>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>Creating a Scrolling Back to Top Button with jQuery</title>
		<link>http://bavotasan.com/2010/scrolling-back-to-top-button-jquery/</link>
		<comments>http://bavotasan.com/2010/scrolling-back-to-top-button-jquery/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 20:55:39 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[anchor]]></category>
		<category><![CDATA[animate]]></category>
		<category><![CDATA[body]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[Click]]></category>
		<category><![CDATA[Creating]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[hundred times]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[Lt]]></category>
		<category><![CDATA[name]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[span]]></category>
		<category><![CDATA[tag]]></category>
		<category><![CDATA[version]]></category>
		<category><![CDATA[way]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=2234</guid>
		<description><![CDATA[If you take a look way, way, way down at the bottom of this page, you will see a Back to Top button that scrolls the whole page until it reaches to top. It is a pretty simple effect to add to your site and looks a hundred-times cooler than just using your typical anchor [...]]]></description>
			<content:encoded><![CDATA[<p>If you take a look way, way, way down at the bottom of this page, you will see a Back to Top button that scrolls the whole page until it reaches to top. It is a pretty simple effect to add to your site and looks a hundred-times cooler than just using your typical anchor name and link. Getting it all to work takes nothing more than a few lines of <a href="http://jquery.com/">jQuery</a> version 1.4.2.<br />
<span id="more-2234"></span><br />
First, we need to create our button/link. I am just going to use an anchor tag and some text:</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: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;javascript:void(0)&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;backtotop&quot;</span><span style="color: #339933;">&gt;</span>Back to Top<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>Next we need to add some <a href="http://jquery.com/">jQuery</a> between the <code>&lt;head&gt;</code> 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;"><span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">'text/javascript'</span> src<span style="color: #339933;">=</span><span style="color: #3366CC;">'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>script type<span style="color: #339933;">=</span><span style="color: #3366CC;">'text/javascript'</span><span style="color: #339933;">&gt;</span>
jQuery<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.backtotop'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</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;">'html, body'</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>scrollTop<span style="color: #339933;">:</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'slow'</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>Remember, you can change the speed by replacing <code>slow</code> with a numerical value. You can also add some easing effects by including the <a href="http://jqueryui.com/">jQuery UI</a>. Read more about easing effects <a href="http://jqueryui.com/demos/effect/#easing">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2010/scrolling-back-to-top-button-jquery/feed/</wfw:commentRss>
		<slash:comments>6</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>The New Google Font API</title>
		<link>http://bavotasan.com/2010/google-font-api/</link>
		<comments>http://bavotasan.com/2010/google-font-api/#comments</comments>
		<pubDate>Mon, 24 May 2010 15:55:04 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[body]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Css File]]></category>
		<category><![CDATA[Directory]]></category>
		<category><![CDATA[face kits]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[Fonts]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[head tags]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[List]]></category>
		<category><![CDATA[look]]></category>
		<category><![CDATA[New]]></category>
		<category><![CDATA[serif]]></category>
		<category><![CDATA[site]]></category>
		<category><![CDATA[Stylesheet]]></category>
		<category><![CDATA[use]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=2074</guid>
		<description><![CDATA[Using the standard Web safe fonts is quickly becoming a thing of the past thanks to modern alternatives like @font-face kits and the new Google Font API. Taking a quick look through the Getting Started guide shows just how simple it is to apply the API to your Web site. All you have to do [...]]]></description>
			<content:encoded><![CDATA[<p>Using the standard Web safe fonts is quickly becoming a thing of the past thanks to modern alternatives like @font-face kits and the new <a href="http://code.google.com/apis/webfonts/">Google Font API</a>.  Taking a quick look through the <a href="http://code.google.com/apis/webfonts/docs/getting_started.html">Getting Started</a> guide shows just how simple it is to apply the API to your Web site. All you have to do is add a link between your site&#8217;s head tags to the CSS file hosted on Google, and then you can call the chosen font throughout your stylesheet.<br />
<span id="more-2074"></span><br />
Here is an example of the link:</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: #339933;">&lt;</span>link rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;stylesheet&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/css&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;http://fonts.googleapis.com/css?family=Tangerine&quot;</span><span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>Then you can use the font like this:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;">&lt;style<span style="color: #00AA00;">&gt;</span>
      body <span style="color: #00AA00;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">'Tangerine'</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">serif</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">48px</span><span style="color: #00AA00;">;</span>
      <span style="color: #00AA00;">&#125;</span>
&lt;/style<span style="color: #00AA00;">&gt;</span></pre></div></td></tr></table></div>

<p>Check out a list of available font in the <a href="http://code.google.com/webfonts">font directory</a>. They are all licensed for commercial and non-commercial use.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2010/google-font-api/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WordPress 3.0: Checking out the New Menu System</title>
		<link>http://bavotasan.com/2010/wordpress-3-checking-out-the-new-menu-system/</link>
		<comments>http://bavotasan.com/2010/wordpress-3-checking-out-the-new-menu-system/#comments</comments>
		<pubDate>Fri, 21 May 2010 16:43:20 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Default Theme]]></category>
		<category><![CDATA[discussion]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[home]]></category>
		<category><![CDATA[idea]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[Location]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[menu system]]></category>
		<category><![CDATA[New Features]]></category>
		<category><![CDATA[order]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[panel]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[php tags]]></category>
		<category><![CDATA[Second Image]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=2027</guid>
		<description><![CDATA[The release of WordPress 3.0 is almost here, so I thought it would be a good idea to start an in-depth discussion on some of the new features. One that I am really looking forward to, and that has been getting a lot of buzz, is the new menu system. Inspired by a similar system [...]]]></description>
			<content:encoded><![CDATA[<p>The release of WordPress 3.0 is almost here, so I thought it would be a good idea to start an in-depth discussion on some of the new features. One that I am really looking forward to, and that has been getting a lot of buzz, is the new menu system. Inspired by a similar system created by WooThemes, WP 3.0 allows the user to create multiple menus that can include any category, page or link they choose. <span id="more-2027"></span>I have been testing the latest build (3.0-beta2-14769) and so far, the menu system interface is looking pretty good.</p>
<p>Here are a couple of screen shots to show you what it looks like:<br />
<div id="attachment_2028" class="wp-caption aligncenter" style="width: 560px"><img src="http://bavotasan.com/wp-content/uploads/2010/05/menu1.jpg" alt="" title="menu1" width="550" class="size-full wp-image-2028" /><p class="wp-caption-text">WordPress 3.0's new menu system.</p></div> <div id="attachment_2029" class="wp-caption aligncenter" style="width: 560px"><img src="http://bavotasan.com/wp-content/uploads/2010/05/menu2.jpg" alt="" title="menu2" width="550" class="size-full wp-image-2029" /><p class="wp-caption-text">This is what you will see once you have created a menu.</p></div></p>
<p>Taking a look behind the scenes of TwentyTen, the new default theme for WP 3.0, gives a little insight as to how it all works and what needs to be in place to make sure that the theme you are using will take advantage of this new feature. </p>
<p>First, you need to include the following in your <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;">add_theme_support<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'nav-menus'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<p>Make sure it is placed within the PHP tags. That is all you really need to activate the menu system. A link to the Menus admin page will appear in the Appearance panel. If you really want your theme to stand out, you can even register menu locations so that the user can assign menus to specific areas of your theme templates. This is similar to the sidebar functionality.</p>

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

<p>This will register a menu with the ID &#8220;main&#8221; and the description &#8220;Main Navigation Menu&#8221;. Including this snippet will make a new panel appear on the Menus admin page (see the second image above). Now users can select which of their menus will appear in that registered location.</p>
<p>Next comes the function to actually display these menus in your theme. This is how TwentyTen uses the function in <code>header.php</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;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_nav_menu<span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'sort_column'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'menu_order'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'container_class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'menu-header'</span> <span style="color: #009900;">&#41;</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>The above code displays the first menu you created, ordered how you have set it, within a div container with the classname &#8220;menu-header&#8221;. </p>
<p>Here is a list of all the arguments that the function can take (so far):</p>
<ul>
<li>menu &#8211; The menu that is desired.  Accepts (matching in order) id, slug, name. Defaults to blank.</li>
<li>menu_class &#8211; CSS class to use for the ul container of the menu list. Defaults to &#8216;menu&#8217;.</li>
<li>container &#8211; Whether to wrap the ul, and what to wrap it with. Defaults to &#8216;div&#8217;.</li>
<li>container_class &#8211; the class that is applied to the container. Defaults to blank.</li>
<li>fallback_cb &#8211; If the menu doesn&#8217;t exists, a callback function will fire. Defaults to &#8216;wp_page_menu&#8217;.</li>
<li>before &#8211; Text before the link text.</li>
<li>after &#8211; Text after the link text.</li>
<li>link_before &#8211; Text before the link.</li>
<li>link_after &#8211; Text after the link.</li>
<li>echo &#8211; Whether to echo the menu or return it. Defaults to echo.</li>
<li>depth &#8211; how many levels of the hierarchy are to be included.  0 means all.  Defaults to 0.</li>
<li>walker &#8211; allows a custom walker to be specified.</li>
<li>context &#8211; the context the menu is used in.</li>
<li>theme_location &#8211; the location in the theme to be used.  Must be registered with register_nav_menu() in order to be selectable by the user.</li>
</ul>
<p>You need to use the <code>theme_location</code> argument to call a registered menu:</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> wp_nav_menu<span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'theme_location'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'main'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'sort_column'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'menu_order'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'fallback_cb'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'display_home'</span> <span style="color: #009900;">&#41;</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>I have also added the <code>fallback_cb</code> argument to show how to control the default callback if no menu is created. If you don&#8217;t include a callback it will default to <code>wp_page_menu()</code> which will just list your pages. I have assigned a function called <code>display_home()</code> as my callback.</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> display_home<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;div class=&quot;navigation&quot;&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;'</span><span style="color: #339933;">.</span>get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'url'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;'</span><span style="color: #339933;">;</span>
	wp_list_categories<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title_li=&amp;depth=1&amp;number=5'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;/ul&gt;&lt;/div&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></td></tr></table></div>

<p>By default, that will display a home link and 5 categories.</p>
<p>There still seem to be a few bugs in the new menu system, but that is to be expected in a beta version. All in all, it is a great addition to WordPress, and theme developers should rejoice that they can now easily offer more control to their users by taking advantage of one of the many core features that will be included in WP 3.0.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2010/wordpress-3-checking-out-the-new-menu-system/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Force WordPress to use the Latest Version of jQuery</title>
		<link>http://bavotasan.com/2010/force-wordpress-use-latest-version-jquery/</link>
		<comments>http://bavotasan.com/2010/force-wordpress-use-latest-version-jquery/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 15:20:43 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[action]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[Change]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[head]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[New Features]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[piece]]></category>
		<category><![CDATA[Place]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[version]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=1875</guid>
		<description><![CDATA[If you&#8217;re using WordPress 2.9.x, then the latest version of jQuery included is 1.3.2. What if you want to take advantage of new features in version 1.4, like delaying an animation queue or binding multiple event handlers? You can easily add a link in your header to the latest version, but that might end up [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re using WordPress 2.9.x, then the latest version of <a href="http://jquery.com/">jQuery</a> included is 1.3.2. What if you want to take advantage of new features in version 1.4, like delaying an animation queue or binding multiple event handlers? You can easily add a link in your header to the latest version, but that might end up conflicting with some plugins or themes.<br />
<span id="more-1875"></span><br />
The best approach would be to use the following piece of code to let WordPress know that you want to load the current version instead.</p>
<p>Place this into 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: #000000; font-weight: bold;">function</span> current_jquery<span style="color: #009900;">&#40;</span><span style="color: #000088;">$version</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_scripts</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">version_compare</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$version</span><span style="color: #339933;">,</span> <span style="color: #000088;">$wp_scripts</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">registered</span><span style="color: #009900;">&#91;</span>jquery<span style="color: #009900;">&#93;</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">ver</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>is_admin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                wp_deregister_script<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'jquery'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
                wp_register_script<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'jquery'</span><span style="color: #339933;">,</span>
                        <span style="color: #0000ff;">'http://ajax.googleapis.com/ajax/libs/jquery/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$version</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/jquery.min.js'</span><span style="color: #339933;">,</span>
                        <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #000088;">$version</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span> current_jquery<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'1.4.2'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// change number to latest version</span></pre></div></td></tr></table></div>

<p>If jQuery is updated, all you have to do is change the version number when calling the function.</p>
<p><strong>Reference</strong>: <a href="http://binarybonsai.com/2010/02/14/how-to-load-the-latest-jquery-in-wordpress/">Binary Bonsai</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2010/force-wordpress-use-latest-version-jquery/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Easy Overlay Modal Window jQuery Plugin</title>
		<link>http://bavotasan.com/2010/easy-overlay-modal-window-jquery-plugin/</link>
		<comments>http://bavotasan.com/2010/easy-overlay-modal-window-jquery-plugin/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 17:04:24 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Downloads]]></category>
		<category><![CDATA[body]]></category>
		<category><![CDATA[ccc]]></category>
		<category><![CDATA[Click]]></category>
		<category><![CDATA[face kits]]></category>
		<category><![CDATA[fff]]></category>
		<category><![CDATA[fn]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[height]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[magazine]]></category>
		<category><![CDATA[Padding]]></category>
		<category><![CDATA[panel]]></category>
		<category><![CDATA[position]]></category>
		<category><![CDATA[px]]></category>
		<category><![CDATA[text decoration]]></category>
		<category><![CDATA[var]]></category>
		<category><![CDATA[visibility]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=1729</guid>
		<description><![CDATA[I developed the following jQuery plugin for the Design options admin panel of Magazine Premium. All it needed to do is display an example of all of the @font-face kits that are available with the theme. It is pretty simple and just fades in a centered modal window containing an image when you click on [...]]]></description>
			<content:encoded><![CDATA[<p>I developed the following jQuery plugin for the Design options admin panel of <a href="http://themes.bavotasan.com/our-themes/premium-themes/magazine-premium">Magazine Premium</a>. All it needed to do is display an example of all of the @font-face kits that are available with the theme. It is pretty simple and just fades in a centered modal window containing an image when you click on a link.<br />
<span id="more-1729"></span><br />
There are just a few things you need to put in place in order to get it working. First, there is the plugin iteself.</p>
<p>Here is the jQuery code:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><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: #660066;">fn</span>.<span style="color: #660066;">easyOverlay</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>	
    $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#easyOverlay&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#easyOverlay&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">remove</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;body&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">append</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;p id='easyOverlay'&gt;&lt;a href='javascript:void(0)' class='closeit'&gt;X&lt;/a&gt;&lt;/p&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;img src='&quot;</span><span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">rel</span> <span style="color: #339933;">+</span><span style="color: #3366CC;">&quot;' alt='' /&gt;&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">appendTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#easyOverlay'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">load</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> wide <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span>window<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: #009966; font-style: italic;">/ 2) - ($(this).width() /</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> high <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">height</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009966; font-style: italic;">/ 2) - ($(this).height() /</span> <span style="color: #CC0000;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>			
	<span style="color: #003366; font-weight: bold;">var</span> scrollTop <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">scrollTop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#easyOverlay&quot;</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>
          top<span style="color: #339933;">:</span> high <span style="color: #339933;">+</span> scrollTop <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;px&quot;</span><span style="color: #339933;">,</span>
          left<span style="color: #339933;">:</span> wide <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;px&quot;</span><span style="color: #339933;">,</span>
		  display<span style="color: #339933;">:</span> <span style="color: #3366CC;">'none'</span><span style="color: #339933;">,</span>
          visibility<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;visible&quot;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</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: #009900;">&#40;</span><span style="color: #3366CC;">&quot;a.closeit&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">live</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;click&quot;</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>
      $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#easyOverlay&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeOut</span><span style="color: #009900;">&#40;</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: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#41;</span></pre></div></td></tr></table></div>

<p>Here is the CSS you need:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#easyOverlay</span><span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</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: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#333</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">visibility</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</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;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1000</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#easyOverlay</span> <span style="color: #6666ff;">.closeit</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#333</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;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">2000</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></td></tr></table></div>

<p>You can easily change some of the design CSS elements but a few thins need to stay in place to make it work. Don&#8217;t change the following styles:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#easyOverlay</span><span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">visibility</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">1000</span><span style="color: #00AA00;">;</span>
  <span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#easyOverlay</span> <span style="color: #6666ff;">.closeit</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">0px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">z-index</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">2000</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
  <span style="color: #00AA00;">&#125;</span></pre></div></td></tr></table></div>

<p>Now comes the HTML markup:</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: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;javascript:void(0)&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;screenshot&quot;</span> rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;link-to-your-image.jpg&quot;</span><span style="color: #339933;">&gt;</span>Name of Image<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span></pre></div></td></tr></table></div>

<p>To call the plugin all you need to do is this:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;">$<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>
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.screenshot&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">easyOverlay</span><span style="color: #009900;">&#40;</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></pre></div></td></tr></table></div>

<p>There aren&#8217;t any options so all you pretty much get is a centered modal window that fades in when you click the link, and fades out when you click the X.</p>
<p>Test it out below:</p>
<p><a href="javascript:void(0)" class="screenshot" rel="http://bavotasan.com/wp-content/uploads/2010/07/adler.jpg">Adler</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="javascript:void(0)" class="screenshot" rel="http://bavotasan.com/wp-content/uploads/2010/07/chunkfive.jpg">Chunkfive</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="javascript:void(0)" class="screenshot" rel="http://bavotasan.com/wp-content/uploads/2010/07/galatia.jpg">Galatia</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="javascript:void(0)" class="screenshot" rel="http://bavotasan.com/wp-content/uploads/2010/07/riesling.jpg">Riesling</a></p>
<p><small>All the images used were provided by <a href="http://www.fontsquirrel.com/">Font Squirrel</a>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2010/easy-overlay-modal-window-jquery-plugin/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Magazine Premium is Ready and I Want to Give Away 5 Copies</title>
		<link>http://bavotasan.com/2010/magazine-premium-is-almost-ready-and-i-want-to-give-away-5-free-copies/</link>
		<comments>http://bavotasan.com/2010/magazine-premium-is-almost-ready-and-i-want-to-give-away-5-free-copies/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 18:08:08 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[css editor]]></category>
		<category><![CDATA[custom css]]></category>
		<category><![CDATA[discussion]]></category>
		<category><![CDATA[face kits]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[home]]></category>
		<category><![CDATA[idea]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[magazine]]></category>
		<category><![CDATA[mailing]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[panel]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[Slideshow]]></category>
		<category><![CDATA[someone]]></category>
		<category><![CDATA[Widget]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=1634</guid>
		<description><![CDATA[I&#8217;m almost finished Magazine Premium and I thought it would be a good idea to open up a discussion to see what features people would like to see available. Now don&#8217;t go crazy, and please don&#8217;t repeat the same requests. I&#8217;ll take the top 5 best requests (that aren&#8217;t a part of the theme already) [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-1636" title="magprem_themesby" src="http://bavotasan.com/wp-content/uploads/2010/01/magprem_themesby.jpg" alt="" width="300" height="225" />I&#8217;m almost finished Magazine Premium and I thought it would be a good idea to open up a discussion to see what features people would like to see available. Now don&#8217;t go crazy, and please don&#8217;t repeat the same requests. I&#8217;ll take the top 5 best requests (that aren&#8217;t a part of the theme already) and I&#8217;ll add them to Magazine Premium. I&#8217;ll also give a free copy to those who suggested the top 5.<br />
<span id="more-1634"></span><br />
Add your suggestions in the comments below. If someone already suggested a feature you wanted, don&#8217;t fret, just think of something else you might want to see in Magazine Premium.</p>
<p>Here is a quick list of features that I have already added:</p>
<ul>
<li>widgetized footer bar</li>
<li>custom footer text</li>
<li>optional &#8220;Powered by WordPress&#8221; link</li>
<li>checkboxes for cats and pages to include in nav menu</li>
<li>optional secondary nav menu</li>
<li>optional search bar or home link in main nav menu</li>
<li>4 front page section with selectable category feed</li>
<li>variable site and sidebar width</li>
<li>featured slideshow with selectable category feed</li>
<li>optional images for each front page section</li>
<li>font selection</li>
<li>color selection</li>
<li>sidebar ads widget</li>
<li>sidebar tabs widget (recent comments, popular posts and subscribe)</li>
<li>simple mailing list/subscribe to our mailing list function</li>
<li>custom CSS editor</li>
<li>full width page template (no sidebars)</li>
<li>new single page options panel with Ajax save function (no more page reloading to save)</li>
<li>drop-down login panel</li>
</ul>
<p>Those are all of the features I can think of right now.</p>
<p>Here is a sneak peak of the new options panel:</p>
<p><a class="highslide" href="http://bavotasan.com/wp-content/uploads/2010/01/magpremadmin.jpg"><img class="aligncenter size-medium wp-image-1633" title="magpremadmin" src="http://bavotasan.com/wp-content/uploads/2010/01/magpremadmin-570x300.jpg" alt="" width="570" height="300" /></a></p>
<p>Here is sample of the new design layout:</p>
<p><a class="highslide" href="http://bavotasan.com/wp-content/uploads/2010/01/magprem.jpg"><img class="aligncenter size-medium wp-image-1635" title="magprem" src="http://bavotasan.com/wp-content/uploads/2010/01/magprem-302x600.jpg" alt="" width="302" height="600" /></a>It still has a little ways to go so don&#8217;t be too judgmental.</p>
<hr />
<p style="font-size: 18px;">
<strong>WINNER #1</strong>: Matt &#8211; a more elaborate author page<br />
<strong>WINNER #2</strong>: tinym &#8211; presets and @font-face kits<br />
<strong>WINNER #3</strong>: Marcus &#8211; more control of the Read More link<br />
<strong>WINNER #4</strong>: Boris &#8211; choose the post&#8217;s thumbnail image<br />
<strong>WINNER #5</strong>: Scott &#8211; easily add links to the nav and sub-nav menus</p>
<hr />
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2010/magazine-premium-is-almost-ready-and-i-want-to-give-away-5-free-copies/feed/</wfw:commentRss>
		<slash:comments>48</slash:comments>
		</item>
		<item>
		<title>Creating a jQuery Plugin to Increase Font Size</title>
		<link>http://bavotasan.com/2010/creating-a-jquery-plugin-to-increase-font-size/</link>
		<comments>http://bavotasan.com/2010/creating-a-jquery-plugin-to-increase-font-size/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 22:32:47 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[animate]]></category>
		<category><![CDATA[call]]></category>
		<category><![CDATA[Click]]></category>
		<category><![CDATA[Creating]]></category>
		<category><![CDATA[div]]></category>
		<category><![CDATA[fn]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[idea]]></category>
		<category><![CDATA[javascript libraries]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[Paragraph]]></category>
		<category><![CDATA[Plugin Code]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[wrapper]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=1613</guid>
		<description><![CDATA[I have been spending a bit of time lately figuring out how to create my own plugins for jQuery. It doesn&#8217;t take much to accomplish and I thought it would be a good idea to put together a small tutorial to show everyone just how easy it can be. For this example, I will create [...]]]></description>
			<content:encoded><![CDATA[<p>I have been spending a bit of time lately figuring out how to create my own plugins for jQuery. It doesn&#8217;t take much to accomplish and I thought it would be a good idea to put together a small tutorial to show everyone just how easy it can be. For this example, I will create a plugin to increase the font size of a selected div when a link is clicked.<br />
<span id="more-1613"></span><br />
To start, we are going to create a wrapper function which will allow us to use <code>$</code> without conflicting with other JavaScript libraries:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><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: #006600; font-style: italic;">// our plugin goes here</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<p>Next we need to let jQuery know we are creating a new plugin by using <code>$.fn</code>. Let&#8217;s call our function <code>increaseFontsize</code> and give it a few variable, such as size, speed, easing and callback, so it works just like other jQuery functions.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><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: #660066;">fn</span>.<span style="color: #660066;">increaseFontsize</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>size<span style="color: #339933;">,</span> speed<span style="color: #339933;">,</span> easing<span style="color: #339933;">,</span> callback<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// the guts of our plugin goes here</span>
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<p>Once you have done that, you can create the code that will make our plugin do what we want it to, which is increase the font size of a selected div.</p>
<p>The final plugin code looks like this:</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;"><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: #660066;">fn</span>.<span style="color: #660066;">increaseFontsize</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>size<span style="color: #339933;">,</span> speed<span style="color: #339933;">,</span> easing<span style="color: #339933;">,</span> callback<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">animate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>fontSize<span style="color: #339933;">:</span> size<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> speed<span style="color: #339933;">,</span> easing<span style="color: #339933;">,</span> callback<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<p>Now we can use our plugin just like any other jQuery function.</p>

<div class="wp_syntax"><table border='0' cellpadding='0' cellspacing='0'><tr><td><div class="code"><pre class="javascript" style="font-family:monospace;">jQuery<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;">'a.increase'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</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;">'div.paragraph'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">increaseFontsize</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">16</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'fast'</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></pre></div></td></tr></table></div>

<p>Try it out below to see it work.</p>
<p><script type="text/javascript">
(function($) {
  $.fn.increaseFontsize = function(size, speed, easing, callback) {
    return this.animate({fontSize: size}, speed, easing, callback);
  };
})(jQuery);
jQuery(function() {
  jQuery('a.increase').click(function() {
    jQuery('div.paragraph').increaseFontsize(16, 800);	
  });
});
jQuery(function() {
  jQuery('a.decrease').click(function() {
    jQuery('div.paragraph').increaseFontsize(14, 800);	
  });
});
</script></p>
<p><a href="javascript: void(0)" class="increase">Increase Font Size</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="javascript: void(0)" class="decrease">Decrease Font Size</a></p>
<div class="paragraph">Fusce eget diam purus, quis mattis dui. Proin volutpat velit at mi viverra id condimentum erat rhoncus. Aliquam eu nibh nisi. In hac habitasse platea dictumst. Nulla vel neque nulla, at lobortis nisl. Donec et erat orci. Mauris non semper libero. Curabitur euismod semper mi, at ornare ante sagittis eu. Nunc massa lacus, auctor facilisis tincidunt eu, euismod et massa. Nunc sit amet purus purus, non porttitor quam. In pulvinar erat sed libero vestibulum cursus. Nunc lobortis semper pellentesque. Nullam ut ligula non eros congue vestibulum.
</div>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2010/creating-a-jquery-plugin-to-increase-font-size/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

