<?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>Beautiful Wordpress Themes</title>
	<atom:link href="http://beautifulwordpressthemes.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://beautifulwordpressthemes.com</link>
	<description>Find and promote WP themes</description>
	<lastBuildDate>Sun, 08 May 2011 23:54:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Free Theme: Sortable</title>
		<link>http://beautifulwordpressthemes.com/free-theme-sortable/</link>
		<comments>http://beautifulwordpressthemes.com/free-theme-sortable/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 21:19:23 +0000</pubDate>
		<dc:creator>Dieter</dc:creator>
				<category><![CDATA[Free Wordpress Themes]]></category>
		<category><![CDATA[Free]]></category>
		<category><![CDATA[magazine]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://beautifulwordpressthemes.com/?p=166</guid>
		<description><![CDATA[Sortable has moved to http://gnuthemes.org/2011/05/08/sortable-1-1/]]></description>
			<content:encoded><![CDATA[<p>Sortable has moved to <a title="Gnuthemes" href="http://gnuthemes.org/2011/05/08/sortable-1-1/">http://gnuthemes.org/2011/05/08/sortable-1-1/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://beautifulwordpressthemes.com/free-theme-sortable/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Free Theme: Polar</title>
		<link>http://beautifulwordpressthemes.com/free-theme-polar/</link>
		<comments>http://beautifulwordpressthemes.com/free-theme-polar/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 22:53:07 +0000</pubDate>
		<dc:creator>Dieter</dc:creator>
				<category><![CDATA[Free Wordpress Themes]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[clean]]></category>
		<category><![CDATA[Free]]></category>

		<guid isPermaLink="false">http://beautifulwordpressthemes.com/?p=146</guid>
		<description><![CDATA[Polar is a clean and simple business theme with bright and beautiful colors. Great for small business sites, portfolios and blogs Custom Frontpage Nice Jquery Slider Automatic Thumbnails Supports WP3 Menus Multilevel Menu Nested Comments PSD Included View Live Demo DownloadDownloaded 384 times]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-medium wp-image-148" title="polar_scr" src="http://beautifulwordpressthemes.com/wp-content/uploads/2011/01/polar_scr-594x396.jpg" alt="" width="594" height="396" /></p>
<p>Polar is a clean and simple business  theme with bright and beautiful colors. Great for small business sites,  portfolios and blogs</p>
<ul>
<li>Custom Frontpage</li>
<li>Nice Jquery Slider</li>
<li>Automatic Thumbnails</li>
<li>Supports WP3 Menus</li>
<li>Multilevel Menu</li>
<li>Nested Comments</li>
<li>PSD Included</li>
</ul>
<p>View <a title="Theme Demo" href="../demo/polar/"><strong>Live Demo</strong></a></p>
<p><a href='#' onclick='javascript:window.open("/feed/?download=1","Window1","menubar=no,width=400,height=200,toolbar=no, left="+((screen.width/2)-200)+", top="+((screen.height/2)-100));return false;' style="background:url('http://beautifulwordpressthemes.com/wp-content/plugins/download-manager/d24.png') no-repeat;padding:3px 12px 12px 28px;font:bold 10pt verdana;">Download</a><br><small style='margin-left:30px;'>Downloaded 384 times</small></p>
]]></content:encoded>
			<wfw:commentRss>http://beautifulwordpressthemes.com/free-theme-polar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to add Google Analytics to WordPress without plugins</title>
		<link>http://beautifulwordpressthemes.com/google-analytics-to-wordpress-without-plugins/</link>
		<comments>http://beautifulwordpressthemes.com/google-analytics-to-wordpress-without-plugins/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 15:19:32 +0000</pubDate>
		<dc:creator>Dieter</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://beautifulwordpressthemes.com/?p=114</guid>
		<description><![CDATA[Adding Google Analytics to your WordPress site without using a plugin is really simple. All you need to do is to open footer.php which you find in your themes folder (wp-content&#8211;&#62;themes&#8211;&#62;Mytheme).  just above &#60;/body&#62; paste your Google Analytics code and upload the file to your server again.]]></description>
			<content:encoded><![CDATA[<p>Adding Google Analytics to your WordPress site without using a plugin is really simple. All you need to do is to open footer.php which you find in your themes folder (wp-content&#8211;&gt;themes&#8211;&gt;Mytheme).  just above &lt;/body&gt; paste your Google Analytics code and upload the file to your server again.</p>
]]></content:encoded>
			<wfw:commentRss>http://beautifulwordpressthemes.com/google-analytics-to-wordpress-without-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up e-commerce themes with WordPress</title>
		<link>http://beautifulwordpressthemes.com/setting-up-e-commerce-themes-with-wordpress/</link>
		<comments>http://beautifulwordpressthemes.com/setting-up-e-commerce-themes-with-wordpress/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 00:06:08 +0000</pubDate>
		<dc:creator>Dieter</dc:creator>
				<category><![CDATA[Wordpress Tutorials]]></category>

		<guid isPermaLink="false">http://beautifulwordpressthemes.com/?p=111</guid>
		<description><![CDATA[This is a quick start guide on how to set you WordPress Themes like Pro Cart E-commerce, Classic Clothing and Glass Shop INSTALLATION Upload and activate the wp-ecommerce plugin first, then upload the theme you want to use. (I use Pro Cart (Formerly known as Media Cart) in this example): MediaCart goes in the standard [...]]]></description>
			<content:encoded><![CDATA[<p>This is a quick start guide on how to set you WordPress Themes like <a title="WP-ecommerce Theme" href="http://beautifulwordpressthemes.com/e-commerce-themes/pro-cart-e-commerce/">Pro Cart E-commerce</a>, <a title="WP-ecommerce Theme" href="http://beautifulwordpressthemes.com/e-commerce-themes/classic-clothing-e-commerce/">Classic Clothing</a> and Glass Shop</p>
<p><strong>INSTALLATION</strong></p>
<p>Upload and activate the wp-ecommerce plugin first, then upload the theme you want to use. (I use <a title="Pro Cart E-commerce" href="http://beautifulwordpressthemes.com/e-commerce-themes/pro-cart-e-commerce/">Pro Cart</a> (Formerly known as Media Cart) in this example):</p>
<p>MediaCart goes in the standard themes folder (wp-content/themes).</p>
<p>MediaCart_listview and MediaCart_gridview <strong>MUST</strong> be uploaded to wp-content&#8211;&gt;uploads&#8211;&gt;wpsc&#8211;&gt;themes</p>
<p>1. Go to products&#8211;&gt;Settings&#8211;&gt;Presentation. Select the theme &#8220;Media Cart Grid View&#8221; OR &#8220;Media Cart List View&#8221;</p>
<p>2. Set &#8220;Default Product Thumbnail Size&#8221; to 200&#215;200, Set &#8220;Default Product Group Thumbnail Size&#8221; to 96&#215;96</p>
<p>Set &#8220;Single Product Image Size&#8221; to 200&#215;200.</p>
<p>3. Set Pagination to 4,6,8 or 12 if you are using Media Cart Grid View theme (this is because there are 4 products on a row).</p>
<p><strong>HOW TO SET UP YOUR SITE</strong></p>
<p>*** Default setup with your latest blog posts on the frontpage ***</p>
<p>-No Action required, the lates posts will be on your front page and your shop is located under &#8220;Products Page&#8221;</p>
<p>*** Custom setup ***</p>
<p>1. Create a page which you call &#8220;Home&#8221; then Chose the template you would like to use (in the right sidebar).</p>
<p>Note that you should use the same settings here as in the shop settings (list view or grid view).<br />
If you want to use the &#8220;Frontpage Slider&#8221; you can use either grid view or list view.</p>
<p>2. Create a page which you call &#8220;Blog&#8221;, &#8220;News&#8221; or something like that (Do not write anything on this page)</p>
<p>3. Go to Settings&#8211;&gt;Reading and set &#8220;Home&#8221; as your front page and &#8220;Blog&#8221; as your posts page.</p>
<p>(You may insert text, photos and whatever you like on your home page but not on the blog page,<br />
try the different templates to see how it looks)</p>
<p>*** Thumbnails for blog posts ***</p>
<p>To use the automatic thumbnail function on blog posts you must upload<br />
an image in your uploader and grab the address to the image.</p>
<p>In custom fields write &#8220;thumb&#8221; in the name field and paste the image url in the value field.</p>
<p>*** Theme Options ***</p>
<p>All themes also have theme options which you will find under &#8220;Apperance&#8221; in your admin panel. All the options<br />
are self explanatory and simple to use.</p>
]]></content:encoded>
			<wfw:commentRss>http://beautifulwordpressthemes.com/setting-up-e-commerce-themes-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom Theme Options in WordPress</title>
		<link>http://beautifulwordpressthemes.com/custom-theme-options/</link>
		<comments>http://beautifulwordpressthemes.com/custom-theme-options/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 16:33:29 +0000</pubDate>
		<dc:creator>Dieter</dc:creator>
				<category><![CDATA[Wordpress Tutorials]]></category>

		<guid isPermaLink="false">http://beautifulwordpressthemes.com/?p=78</guid>
		<description><![CDATA[So you want to add a new layer of customization to your WP theme in order to appeal to more customers or just to make modifications to your theme easier with a front-end system? Well, now you&#8217;ll know how to easily set one of these up inside your theme and take your theme to a [...]]]></description>
			<content:encoded><![CDATA[<p>So you want to add a new layer of customization to your WP theme in order to appeal to more customers or just to make modifications to your theme easier with a front-end system? Well, now you&#8217;ll know how to easily set one of these up inside your theme and take your theme to a new level of usability and usefullness.</p>
<h2>Step 0: The Principle Behind It All</h2>
<p>If it helps you to understand everything we&#8217;re going to be doing in a few seconds, you can think of our &#8220;Theme Opitons&#8221; component of the theme as a plugin that gets activated along with the theme, and since WordPress is gonna use this mindset as well, we&#8217;ll have access to a majority of the same functions that plugins do.</p>
<h2>Step 1: Creating the Menu</h2>
<p>First things first, in order to create our interface to change our options, we need a place to put that interface. &#8220;Where?&#8221; Should be your next question, and the answer is &#8220;In the &#8216;Appearance&#8217; tab of the WP-Admin.&#8221; We&#8217;re going to be creating a submenu under the appearance tab that will hold all of our customizaitons interface.</p>
<p>To make the submenu appear, we need to call the function add_action() and give it the parameters &#8220;admin_menu&#8221;,&#8221;BWPT_theme_options&#8221; in that order. Once we do that, we need to write the function &#8220;BWPT_theme_options&#8221; and fill it with the function add_theme_page() and give it the parameters: &#8216;Manage Theme Options&#8217;, &#8216;Theme Options&#8217;, &#8216;edit_themes&#8217;, &#8216;BWPT_theme_options&#8217;, &#8216;BWPT_theme_options_admin&#8217;.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Custom theme options</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin_menu'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'BWPT_theme_options'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> BWPT_theme_options<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    add_theme_page<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Manage Theme Options'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Theme Options'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'edit_themes'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'BWPT_theme_options'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'BWPT_theme_options_admin'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><img class="alignnone size-full wp-image-102" title="1" src="http://beautifulwordpressthemes.com/wp-content/uploads/2010/06/1.jpg" alt="" width="600" height="300" /></p>
<h2>Step 2: Creating the defaults</h2>
<p>Before we go any further, lets create the default values for our customizations. For the tutorial, we&#8217;re going to be adding 2 options: custom background color and a custom CSS area.</p>
<p>Let&#8217;s begin by making a new function, BWPT_theme_options_admin (this is also the function we referenced in the last parameter of add_theme_page and will be the function that displays the HTML of the customization page). First thing inside of this function is gonna be an if-statement to check to see if the page viewer has rights to edit the theme (Administraitor only) and if they can&#8217;t, then kill the page load so they can&#8217;t edit any theme settings.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> BWPT_theme_options_admin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>current_user_can<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'edit_themes'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span>
        wp_die<span style="color: #009900;">&#40;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'You do not have sufficient permissions to access this page.'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Next, we&#8217;re going to create a variable called $BWPT and have it&#8217;s value be the function get_option() with the parameter &#8220;BWPT_theme_options&#8221;. Get_option will grab the corresponding data from the wp_options table in the database that we supply it in the parameter, if it doesn&#8217;t find a match, then it will return false. So we&#8217;ll use this to check to see if the customizations have already been made, and if not, then add the defaults to the database.</p>
<p>Adding options to the database is easy using the function add_option(). You just supply it with a key (a name) and a value. To save time, space, memory, and add convienence, you should always have your options inside of an array and then add the array to the options table, so you have 1 row to get and 1 row to update.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$BWPT</span> <span style="color: #339933;">=</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'BWPT_theme_options'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$BWPT</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$BWPT_defaults</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: #000088;">$BWPT_defaults</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'background-color'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'#cccccc'</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$BWPT_defaults</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'other-css'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
&nbsp;
    add_option<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;BWPT_theme_options&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$BWPT_defaults</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h2>Step 3: Adding the HTML</h2>
<p>Now that we have a page and some options, we can put in some HTML to start editing them. Basically our entire page is going to consist of a form (formatted via tables) and each input we&#8217;re going to output the options we set up last step (remember, they&#8217;ll already be at the defaults if they&#8217;re not changed so we don&#8217;t have to bother with any if/else statements). This step is really simple and requires no explination, just be sure to notice how the tables are set up and the classes applied to each element (using classes from the admin CSS will help give your options page more uniformity with the rest of the back-end).</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$BWPT_admin_html</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;
&nbsp;
&lt;div class=&quot;</span>wrap<span style="color: #0000ff;">&quot;&gt;
&nbsp;
&lt;h2&gt;Manage Theme Options&lt;/h2&gt;
&nbsp;
&nbsp;
        <span style="color: #006699; font-weight: bold;">{$updated_html}</span>
&lt;form id=&quot;</span>BWPT<span style="color: #339933;">-</span>form<span style="color: #0000ff;">&quot; method=&quot;</span>post<span style="color: #0000ff;">&quot;&gt;
&nbsp;
&lt;table class=&quot;</span>form<span style="color: #339933;">-</span>table<span style="color: #0000ff;">&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th valign=&quot;</span>top<span style="color: #0000ff;">&quot; scope=&quot;</span>row<span style="color: #0000ff;">&quot;&gt;&lt;label for=&quot;</span>background<span style="color: #339933;">-</span>color<span style="color: #0000ff;">&quot;&gt;Background Color: &lt;/label&gt;&lt;/th&gt;
&lt;td&gt;
&lt;input id=&quot;</span>background<span style="color: #339933;">-</span>color<span style="color: #0000ff;">&quot; class=&quot;</span>regular<span style="color: #339933;">-</span>text<span style="color: #0000ff;">&quot; maxlength=&quot;</span><span style="color: #cc66cc;">7</span><span style="color: #0000ff;">&quot; name=&quot;</span>background<span style="color: #339933;">-</span>color<span style="color: #0000ff;">&quot; type=&quot;</span>text<span style="color: #0000ff;">&quot; value=&quot;</span><span style="color: #009900;">&#123;</span><span style="color: #000088;">$BWPT</span><span style="color: #009900;">&#91;</span><span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>background<span style="color: #339933;">-</span>color<span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#125;</span><span style="color: #0000ff;">&quot; /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th valign=&quot;</span>top<span style="color: #0000ff;">&quot; scope=&quot;</span>row<span style="color: #0000ff;">&quot;&gt;&lt;label for=&quot;</span>other<span style="color: #339933;">-</span>css<span style="color: #0000ff;">&quot;&gt;Other CSS&lt;/label&gt;&lt;/th&gt;
&lt;td&gt;&lt;textarea id=&quot;</span>other<span style="color: #339933;">-</span>css<span style="color: #0000ff;">&quot; style=&quot;</span>width<span style="color: #339933;">:</span> <span style="color: #cc66cc;">90</span><span style="color: #339933;">%;</span><span style="color: #0000ff;">&quot; cols=&quot;</span><span style="color: #cc66cc;">45</span><span style="color: #0000ff;">&quot; rows=&quot;</span><span style="color: #cc66cc;">10</span><span style="color: #0000ff;">&quot; name=&quot;</span>other<span style="color: #339933;">-</span>css<span style="color: #0000ff;">&quot;&gt;{<span style="color: #006699; font-weight: bold;">$BWPT</span>[&quot;</span>other<span style="color: #339933;">-</span>css<span style="color: #0000ff;">&quot;]}&lt;/textarea&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&nbsp;
&nbsp;
&lt;span class=&quot;</span>submit<span style="color: #0000ff;">&quot; style=&quot;</span>border<span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&quot;&gt;
&lt;input name=&quot;</span>submit<span style="color: #0000ff;">&quot; type=&quot;</span>submit<span style="color: #0000ff;">&quot; value=&quot;</span>Save Settings<span style="color: #0000ff;">&quot; /&gt;&lt;/span&gt;
        &lt;/form&gt;&lt;/div&gt;
&nbsp;
&nbsp;
&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$BWPT_admin_html</span><span style="color: #339933;">;</span></pre></div></div>

<p><img class="alignnone size-full wp-image-103" title="2" src="http://beautifulwordpressthemes.com/wp-content/uploads/2010/07/2.jpg" alt="" width="600" height="300" /></p>
<h2>Step 4: Updating the Options</h2>
<p>We have our form setup, so let&#8217;s use it to save the changes to our theme options. You&#8217;ll notice that our form tag has an empty action attribute, that&#8217;s so the page will reload when we press submit and we don&#8217;t have to make another file to handle the update methods. To start, inside of that same admin function we&#8217;re going to add a new if-statement that checks the $_POST globals for the submit button id (&#8216;submit&#8217;), and if it is set, then we&#8217;re going to use the function update_option to update the database info (after we make it safe with the function mysql_real_escape_string()) and we&#8217;re also going to make a new variable, $update_html, and fill it with some html to let the user know that the update went through.</p>

<div class="wp_syntax"><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;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'submit'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$BWPT</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'background-color'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_real_escape_string</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'background-color'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$BWPT</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'other-css'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_real_escape_string</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'other-css'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    update_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'BWPT_theme_options'</span><span style="color: #339933;">,</span><span style="color: #000088;">$BWPT</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$url</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: #000088;">$updated_html</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;
&nbsp;
&lt;div id=&quot;</span>message<span style="color: #0000ff;">&quot; class=&quot;</span>updated below<span style="color: #339933;">-</span>h2<span style="color: #0000ff;">&quot;&gt;
&nbsp;
Header updated. &lt;a href=&quot;</span><span style="color: #009900;">&#123;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#125;</span><span style="color: #0000ff;">&quot;&gt;Visit your site&lt;/a&gt; to see how it looks.&lt;/div&gt;
&nbsp;
&nbsp;
    &quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Step 5: Using these options</p>
<p>Now that we have the options in the database, we can use them in our themes by calling get_option. In our example, we created a custom background color, and specificed some other css to include as well. There are 2 ways we could add these changes to our theme: write it into the header.php file or use the action &#8220;wp_head&#8221;. We&#8217;ll cover both ways.</p>
<p>Let&#8217;s start with the action method, we&#8217;re going to create a new function (outside the admin function) called BWPT_theme_options_client and inside the function use get_option to get the changes from the database and then we&#8217;ll echo out the css inside some style tags. In order for this to work though we need to call the add_action() function with the parameters: &#8216;wp_head&#8217;, &#8216;BWPT_theme_options_client&#8217;. This will add our new CSS where the function wp_head() is called in our theme.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'BWPT_theme_options'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">function</span> BWPT_theme_options_client<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$BWPT</span> <span style="color: #339933;">=</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'BWPT_theme_options'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$BWPT_styles</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;
&lt;!--
                body {background-color: {<span style="color: #006699; font-weight: bold;">$BWPT</span>[&quot;</span>background<span style="color: #339933;">-</span>color<span style="color: #0000ff;">&quot;]};}
                {<span style="color: #006699; font-weight: bold;">$BWPT</span>[&quot;</span>other<span style="color: #339933;">-</span>css<span style="color: #0000ff;">&quot;]}
&nbsp;
--&gt;
&nbsp;
        &quot;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$BWPT_styles</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'BWPT_theme_options_client'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The second method involves removing the function we made and pasting it&#8217;s contents wherever we want the changes to be applied (in our case, header.php).</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'BWPT_theme_options'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$BWPT</span> <span style="color: #339933;">=</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'BWPT_theme_options'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$BWPT_styles</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;
&lt;!--
            body {background-color: {<span style="color: #006699; font-weight: bold;">$BWPT</span>[&quot;</span>background<span style="color: #339933;">-</span>color<span style="color: #0000ff;">&quot;]};}
            {<span style="color: #006699; font-weight: bold;">$BWPT</span>[&quot;</span>other<span style="color: #339933;">-</span>css<span style="color: #0000ff;">&quot;]}
&nbsp;
--&gt;
&nbsp;
    &quot;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$BWPT_styles</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>h2<span style="color: #339933;">&gt;</span>the final changes<span style="color: #339933;">&lt;/</span>h2<span style="color: #339933;">&gt;</span></pre></div></div>

<p><img class="alignnone size-full wp-image-104" title="3" src="http://beautifulwordpressthemes.com/wp-content/uploads/2010/07/3.jpg" alt="" width="600" height="300" /></p>
<p>Finished!</p>
<p>That&#8217;s all there is to theme options folks! Some improvements you can make to what we built today are checks to see if a field was left blank and if it was, change it back to it&#8217;s default value. If you have any questions or concerns about the tutorial, please leave a comment!</p>
<p>Final Code With Comments</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> BWPT_theme_options_admin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// Handles everything inside the WP-Admin</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>current_user_can<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'edit_themes'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// If the user isn't an administraitor or one with the ability to make changes to the theme</span>
        wp_die<span style="color: #009900;">&#40;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'You do not have sufficient permissions to access this page.'</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;">// stop the rest of the page from loading</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000088;">$BWPT</span> <span style="color: #339933;">=</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'BWPT_theme_options'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// get the customizations from the database</span>
&nbsp;
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$BWPT</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// if the customizations don't exist yet</span>
        <span style="color: #000088;">$BWPT_defaults</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: #666666; font-style: italic;">// create an empty array</span>
        <span style="color: #000088;">$BWPT_defaults</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'background-color'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'#cccccc'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// set the default background color</span>
        <span style="color: #000088;">$BWPT_defaults</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'other-css'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// set the default custom css</span>
&nbsp;
        add_option<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;BWPT_theme_options&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$BWPT_defaults</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// add our customizations to the database</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'submit'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// If they've clicked the submit button</span>
        <span style="color: #000088;">$BWPT</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'background-color'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_real_escape_string</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'background-color'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// escape and save the new background color</span>
        <span style="color: #000088;">$BWPT</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'other-css'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_real_escape_string</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'other-css'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// escape and save the new custom css</span>
        update_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'BWPT_theme_options'</span><span style="color: #339933;">,</span><span style="color: #000088;">$BWPT</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// update the database</span>
&nbsp;
        <span style="color: #000088;">$url</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: #666666; font-style: italic;">// get the blog url from the database</span>
        <span style="color: #000088;">$updated_html</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;
&nbsp;
&lt;div id=&quot;</span>message<span style="color: #0000ff;">&quot; class=&quot;</span>updated below<span style="color: #339933;">-</span>h2<span style="color: #0000ff;">&quot;&gt;
&nbsp;
Header updated. &lt;a href=&quot;</span><span style="color: #009900;">&#123;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#125;</span><span style="color: #0000ff;">&quot;&gt;Visit your site&lt;/a&gt; to see how it looks.&lt;/div&gt;
&nbsp;
&nbsp;
        &quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// some HTML to show that the options were updated</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000088;">$BWPT_admin_html</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;
&nbsp;
&lt;div class=&quot;</span>wrap<span style="color: #0000ff;">&quot;&gt;
&nbsp;
&lt;h2&gt;Manage Theme Options&lt;/h2&gt;
&nbsp;
&nbsp;
            <span style="color: #006699; font-weight: bold;">{$updated_html}</span>
&lt;form id=&quot;</span>BWPT<span style="color: #339933;">-</span>form<span style="color: #0000ff;">&quot; method=&quot;</span>post<span style="color: #0000ff;">&quot;&gt;
&nbsp;
&lt;table class=&quot;</span>form<span style="color: #339933;">-</span>table<span style="color: #0000ff;">&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;th valign=&quot;</span>top<span style="color: #0000ff;">&quot; scope=&quot;</span>row<span style="color: #0000ff;">&quot;&gt;&lt;label for=&quot;</span>background<span style="color: #339933;">-</span>color<span style="color: #0000ff;">&quot;&gt;Background Color: &lt;/label&gt;&lt;/th&gt;
&lt;td&gt;
&lt;input id=&quot;</span>background<span style="color: #339933;">-</span>color<span style="color: #0000ff;">&quot; class=&quot;</span>regular<span style="color: #339933;">-</span>text<span style="color: #0000ff;">&quot; maxlength=&quot;</span><span style="color: #cc66cc;">7</span><span style="color: #0000ff;">&quot; name=&quot;</span>background<span style="color: #339933;">-</span>color<span style="color: #0000ff;">&quot; type=&quot;</span>text<span style="color: #0000ff;">&quot; value=&quot;</span><span style="color: #009900;">&#123;</span><span style="color: #000088;">$BWPT</span><span style="color: #009900;">&#91;</span><span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>background<span style="color: #339933;">-</span>color<span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#125;</span><span style="color: #0000ff;">&quot; /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;th valign=&quot;</span>top<span style="color: #0000ff;">&quot; scope=&quot;</span>row<span style="color: #0000ff;">&quot;&gt;&lt;label for=&quot;</span>other<span style="color: #339933;">-</span>css<span style="color: #0000ff;">&quot;&gt;Other CSS&lt;/label&gt;&lt;/th&gt;
&lt;td&gt;&lt;textarea id=&quot;</span>other<span style="color: #339933;">-</span>css<span style="color: #0000ff;">&quot; style=&quot;</span>width<span style="color: #339933;">:</span> <span style="color: #cc66cc;">90</span><span style="color: #339933;">%;</span><span style="color: #0000ff;">&quot; cols=&quot;</span><span style="color: #cc66cc;">45</span><span style="color: #0000ff;">&quot; rows=&quot;</span><span style="color: #cc66cc;">10</span><span style="color: #0000ff;">&quot; name=&quot;</span>other<span style="color: #339933;">-</span>css<span style="color: #0000ff;">&quot;&gt;{<span style="color: #006699; font-weight: bold;">$BWPT</span>[&quot;</span>other<span style="color: #339933;">-</span>css<span style="color: #0000ff;">&quot;]}&lt;/textarea&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&nbsp;
&nbsp;
&lt;span class=&quot;</span>submit<span style="color: #0000ff;">&quot; style=&quot;</span>border<span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&quot;&gt;
&lt;input name=&quot;</span>submit<span style="color: #0000ff;">&quot; type=&quot;</span>submit<span style="color: #0000ff;">&quot; value=&quot;</span>Save Settings<span style="color: #0000ff;">&quot; /&gt;&lt;/span&gt;
            &lt;/form&gt;&lt;/div&gt;
&nbsp;
&nbsp;
    &quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// all the admin area HTML</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$BWPT_admin_html</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// display the admin area HTML</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'BWPT_theme_options'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// if the customizations exist</span>
    <span style="color: #000000; font-weight: bold;">function</span> BWPT_theme_options_client<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// display function for the customizations</span>
        <span style="color: #000088;">$BWPT</span> <span style="color: #339933;">=</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'BWPT_theme_options'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// get our customizations from the database</span>
&nbsp;
        <span style="color: #000088;">$BWPT_styles</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;
&lt;!--
                body {background-color: {<span style="color: #006699; font-weight: bold;">$BWPT</span>[&quot;</span>background<span style="color: #339933;">-</span>color<span style="color: #0000ff;">&quot;]};}
                {<span style="color: #006699; font-weight: bold;">$BWPT</span>[&quot;</span>other<span style="color: #339933;">-</span>css<span style="color: #0000ff;">&quot;]}
&nbsp;
--&gt;
&nbsp;
        &quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// put our customizations into some style tags</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$BWPT_styles</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// display the style tags</span>
    <span style="color: #009900;">&#125;</span>
    add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'BWPT_theme_options_client'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// attach our display function to the wp_head function</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://beautifulwordpressthemes.com/custom-theme-options/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Enable multisite in WordPress 3</title>
		<link>http://beautifulwordpressthemes.com/enable-multisite-in-wordpress-3/</link>
		<comments>http://beautifulwordpressthemes.com/enable-multisite-in-wordpress-3/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 14:35:31 +0000</pubDate>
		<dc:creator>Dieter</dc:creator>
				<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://beautifulwordpressthemes.com/?p=69</guid>
		<description><![CDATA[In WordPress 3 you can create several different blogs from one single install. However, this is not an default option in your admin panel but it is very easy to enable it. Here is how to do it in two steps Open wp-config.php and add define(&#8216;WP_ALLOW_MULTISITE&#8217;, true); right above // ** MySQL settings (line 16-17 [...]]]></description>
			<content:encoded><![CDATA[<p>In <strong>WordPress 3</strong> you can create several different blogs from one single install. However, this is not an default option in your admin panel but it is very easy to enable it. Here is how to do it in two steps</p>
<ul>
<li>Open wp-config.php and add <strong>define(&#8216;WP_ALLOW_MULTISITE&#8217;, true); </strong>right above // ** MySQL settings (line 16-17 or so)</li>
<li>Upload the file again and go to the &#8220;Tools&#8221; tab in your admin, click on &#8220;Network&#8221; and follow the instructions</li>
</ul>
<p>That&#8217;s all</p>
]]></content:encoded>
			<wfw:commentRss>http://beautifulwordpressthemes.com/enable-multisite-in-wordpress-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

