<?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; description</title>
	<atom:link href="http://bavotasan.com/tag/description/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>Using get_theme_data() when Developing a Custom Theme for WordPress</title>
		<link>http://bavotasan.com/2010/get_theme_data-developing-custom-theme-wordpress/</link>
		<comments>http://bavotasan.com/2010/get_theme_data-developing-custom-theme-wordpress/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 18:39:45 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[author]]></category>
		<category><![CDATA[com]]></category>
		<category><![CDATA[Css File]]></category>
		<category><![CDATA[description]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[ie 7]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[magazine]]></category>
		<category><![CDATA[menu system]]></category>
		<category><![CDATA[online]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[Style]]></category>
		<category><![CDATA[style css]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=2224</guid>
		<description><![CDATA[If you are building a custom theme that you would like to add to the WordPress directory or start to sell online somewhere, a great function that can help you out is get_theme_data(). What exactly does it do? It gathers all the theme information that you were supposed to add to the style.css file so [...]]]></description>
			<content:encoded><![CDATA[<p>If you are building a custom theme that you would like to add to the WordPress directory or start to sell online somewhere, a great function that can help you out is <code>get_theme_data()</code>. What exactly does it do? It gathers all the theme information that you were supposed to add to the <code>style.css</code> file so you can use it throughout your theme.<br />
<span id="more-2224"></span><br />
If you download a copy of Magazine  Basic, you can see it in action in the <code>functions.php</code> file, right at the top. To make sure it is working, though, you have to have your style.css file setup correctly. The top of that file should look something 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;"><span style="color: #808080; font-style: italic;">/*
Theme Name: Magazine Basic
Theme URI: http://themes.bavotasan.com/our-themes/basic-themes/magazine-basic
Description: Built for WordPress 3.0. A magazine style theme with a fully customizable layout. Theme options include site width, 1 or 2 widgetized sidebars, header logo, multiple front page grid layouts, new WP 3.0 menu system, Google Analytics, pagination, drop-down menus and tons more. Also includes dynamic SEO keywords and site descriptions. Tested in Firefox 3.6, IE 7 &amp; 8 and Safari 4. Fully optimized for search engine ranking. Translation ready. 100% valid xHTML. Designed by &lt;a href=&quot;http://themes.bavotasan.com/&quot;&gt;Themes by bavotasan.com&lt;/a&gt;.
Version: 2.6.7
Author: c.bavota
Author URI: http://themes.bavotasan.com/
Tags: right-sidebar,left-sidebar,fixed-width,three-columns,two-columns,white,custom-header,theme-options
&nbsp;
	The CSS, XHTML and design is released under GPL:
	http://www.opensource.org/licenses/gpl-license.php
&nbsp;
*/</span></pre></div></td></tr></table></div>

<p>This is all information that you can now use with <code>get_theme_data()</code>. I use it in Magazine Basic like so:</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;">$bavotasan_theme_data</span> <span style="color: #339933;">=</span> get_theme_data<span style="color: #009900;">&#40;</span>TEMPLATEPATH<span style="color: #339933;">.</span><span style="color: #0000ff;">'/style.css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<p>With that in my <code>functions.php</code> file, I can use the array of data that it provides like so:</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;">$bavotasan_theme_data</span> <span style="color: #339933;">=</span> get_theme_data<span style="color: #009900;">&#40;</span>TEMPLATEPATH<span style="color: #339933;">.</span><span style="color: #0000ff;">'/style.css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'THEME_NAME'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$bavotasan_theme_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Name'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'THEME_AUTHOR'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$bavotasan_theme_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Author'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'THEME_HOMEPAGE'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$bavotasan_theme_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'URI'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'THEME_VERSION'</span><span style="color: #339933;">,</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$bavotasan_theme_data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Version'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<p>If you are not familiar with the define() function, check out <a href="http://bavotasan.com/tutorials/define-constant-php/">Defining a Constant with PHP</a>.</p>
<p>Now you can use those four constants throughout your theme. Here are some examples that I use:</p>
<p>In <code>footer.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;">&lt;span class=&quot;red&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> THEME_NAME<span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt; <span style="color: #000000; font-weight: bold;">&lt;?php</span> _e<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;theme designed by&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;magazine-basic&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> &lt;a href=&quot;http://themes.bavotasan.com&quot;&gt;&lt;span class=&quot;red&quot;&gt;Themes by bavotasan.com&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;</pre></div></td></tr></table></div>

<p>In <code>functions.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: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;p&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;'</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Version'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;magazine-basic&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">':&lt;/strong&gt; '</span><span style="color: #339933;">.</span>THEME_VERSION<span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/li&gt;&lt;li&gt;&lt;strong&gt;'</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Author'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;magazine-basic&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">':&lt;/strong&gt; &lt;a href=&quot;http://bavotasan.com/&quot;&gt;'</span><span style="color: #339933;">.</span>THEME_AUTHOR<span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;'</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Built by'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;magazine-basic&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">':&lt;/strong&gt; &lt;a href=&quot;http://themes.bavotasan.com/&quot;&gt;Themes by bavotasan.com&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;'</span><span style="color: #339933;">.</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Theme home page'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;magazine-basic&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">':&lt;/strong&gt; &lt;a href=&quot;'</span><span style="color: #339933;">.</span>THEME_HOMEPAGE<span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">.</span>THEME_NAME<span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/p&gt;'</span><span style="color: #339933;">;</span></pre></div></td></tr></table></div>

<p>You can also get the description and the tags. Check out the <a href="http://codex.wordpress.org/Function_Reference/get_theme_data">Codex</a> for a little more info.</p>
]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2010/get_theme_data-developing-custom-theme-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Royale Flash Free Header</title>
		<link>http://bavotasan.com/2008/the-royale-flash-free-header/</link>
		<comments>http://bavotasan.com/2008/the-royale-flash-free-header/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 03:00:47 +0000</pubDate>
		<dc:creator>c.bavota</dc:creator>
				<category><![CDATA[Downloads]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[Change]]></category>
		<category><![CDATA[description]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[info]]></category>
		<category><![CDATA[option]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[Slides]]></category>
		<category><![CDATA[Slideshow]]></category>
		<category><![CDATA[timer]]></category>
		<category><![CDATA[versatile]]></category>

		<guid isPermaLink="false">http://bavotasan.com/?p=27</guid>
		<description><![CDATA[Flash is a pretty wickedly versatile application for building cool elements for websites. I built a header (or I guess it can really be used anywhere) in Flash that retrieves all of its information from two XML files. It is possible to make it a slideshow or just use it as is. It best suits [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://bavotasan.com/wp-content/uploads/2008/10/royale.jpg" alt="The Royale Flash Free Header" class="aligncenter" width="570px" /></p>
<p>Flash is a pretty wickedly versatile application for building cool elements for websites. I built a header (or I guess it can really be used anywhere) in Flash that retrieves all of its information from two XML files. It is possible to make it a slideshow or just use it as is. It best suits sites that want to feature certain items on their main page, or really anywhere on their site. The sample I created promotes five CD releases.<br />
<span id="more-27"></span><br />
Features:</p>
<ul>
<li>Converts to a slideshow with one option change in the data.xml file</li>
<li>Slideshow timer control</li>
<li>Retrieves all information from the info.xml file</li>
<li>Customize background images</li>
<li>Compatible with all browsers</li>
<li>Professional looking</li>
</ul>
<p>Here are the data options:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;data<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;item<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;slideshow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/slideshow<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> //do you want it to be a slideshow, 0 = NO, 1 = YES
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;seconds<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>8000<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/seconds<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> //if it is a slideshow, how many milliseconds before the slides switch
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/item<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/data<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Here is what the info.xml files looks like:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;info<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;item<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;image<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>images/image1.jpg<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/image<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> //must be 156px by 156px to fit properly
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;back<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>images/back1.jpg<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/back<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> // background images must be 960px by 250px
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Bob Dylan – Tell Tale Signs<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>This is where you put the description of the item.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://www.amazon.com/<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/item<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/info<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://bavotasan.com/2008/the-royale-flash-free-header/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

