<?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>birghtyoursite &#187; Wordpress</title>
	<atom:link href="http://www.brightyoursite.com/blog/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brightyoursite.com/blog</link>
	<description>Bright your site</description>
	<lastBuildDate>Mon, 19 Dec 2011 09:39:57 +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>wordpress  cs-cart  e-commerce solutions</title>
		<link>http://www.brightyoursite.com/blog/2010/04/26/wordpress-cs-cart-e-commerce-solutions/</link>
		<comments>http://www.brightyoursite.com/blog/2010/04/26/wordpress-cs-cart-e-commerce-solutions/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 14:50:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[magento]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[e-commerce]]></category>

		<guid isPermaLink="false">http://www.brightyoursite.com/blog/?p=377</guid>
		<description><![CDATA[wordpress is a very popular cms and easy to use, i saw most of the people use wp-ecomence for the wordpress e-commerce solutions.so this article will told u how to add cs-cart cart to the wordpress pages How the cs-cart cart work Install cs-cart on your server, when you add a product it will use [...]]]></description>
			<content:encoded><![CDATA[<p>wordpress is a very popular cms and easy to use, i saw most of the people use wp-ecomence for the wordpress e-commerce solutions.so this article will told u how to add cs-cart cart to the wordpress pages</p>
<p><span id="more-377"></span></p>
<h3>How the cs-cart cart work</h3>
<p>
Install  cs-cart on your server, when you add a product it will use ajax to post the data to the server then get back the new cart information and update the cart, so as we know this, we can easy to use same ajax function to add the cs-cart cart in the wordpress pages by ajax call.
</p>
<p>
First, we need rip the css of the cart (under the main navigation)  to the wordpress , you may need adjust the css so it can looks well in your wordpress blog, then you need add the understand the cs-cart ajax function and write your own ajax function in the wordpress blog,at last test it, all ok , that&#8217;s it!!!
</p>
<p>
see a live sample there :<a href='http://www.ebusinesshosting.ca/ ' target='_blank'>http://www.ebusinesshosting.ca/ </a>, and this is the cs-cart store <a href='http://www.ebusinesshosting.ca/store/' target='_blank'>http://www.ebusinesshosting.ca/store/</a>I will try to make it work as plugin.<br />
To be continued</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightyoursite.com/blog/2010/04/26/wordpress-cs-cart-e-commerce-solutions/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>add theme options for your wordpress theme</title>
		<link>http://www.brightyoursite.com/blog/2010/02/10/add-theme-options-for-your-wordpress-theme/</link>
		<comments>http://www.brightyoursite.com/blog/2010/02/10/add-theme-options-for-your-wordpress-theme/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 13:33:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[wordpress plugin]]></category>

		<guid isPermaLink="false">http://www.brightyoursite.com/blog/?p=236</guid>
		<description><![CDATA[What&#8217;s this can do ? Are you want to add featured posts , easy to manage the ads on your wordpress site or show a special category posts on your home page ? Add theme options for your wordpress theme ,you will know it&#8217;s so easy !!! Prepare First , we should know two important [...]]]></description>
			<content:encoded><![CDATA[<h3>What&#8217;s this can do ?</h3>
<p>
Are you want to add featured posts ,  easy to manage the ads on your wordpress site  or show a  special category posts on your home page ? Add  theme options for your wordpress theme ,you will know  it&#8217;s so easy !!!
</p>
<p><span id="more-236"></span></p>
<h3>Prepare</h3>
<p>
First , we  should know two important wordpress tags : <b>add_theme_page</b> , <b>add_action </b> and two wordpress api : <b>update_option</b> , <b>delete_option</b>
</p>
<p>
<b>add_theme_page</b> : add_theme_page( page_title, menu_title, capability, handle, [function]); </p>
<dl>
<dt>page_title</dt>
<dd>Set the page title of the options page </dd>
<dt>menu_title</dt>
<dd>The anchor text of the menu .</dd>
<dt>capability</dt>
<dd>The minimum <a title="Roles and Capabilities" href="http://codex.wordpress.org//Roles_and_Capabilities">capability</a> required to display and use this menu page. Go to wordpress <a title="Roles and Capabilities" href="http://codex.wordpress.org//Roles_and_Capabilities">capability</a> page for more details .
</dd>
<dt>handle/file</dt>
<dd>If the function parameter is omitted, this should be the PHP file that handles the display of the menu page content. Otherwise, and more commonly, it will be a unique &#8220;handle&#8221; for the page. e.g. &#8220;my-awesome-plugin-settings&#8221;</dd>
<dt>function</dt>
<dd>The function that displays the options  page content for the menu page.</dd>
</dl>
<p><b>add_action </b>: add_action( $tag, $function_to_add, $priority, $accepted_args );<br/> </p>
<dl>
<dt>$tag</dt>
<dd>(required) The name of the action you wish to hook onto ,check <a title="Plugin API/Action Reference" href="http://codex.wordpress.org//Plugin_API/Action_Reference">Plugin API/Action Reference</a> for the action list .</dd>
<dt>$function_to_add</dt>
<dd>(required) The name of the function you wish to be called .</dd>
<dt>$priority</dt>
<dd>(optional) Default: 10 this define the function execute  order , lower number first . eg. if a function set priority to 5 that&#8217;s means this function run earlier than which priority is 10 </dd>
<dt>$accepted_args</dt>
<dd>(optional) Default: 1 This define the arguments your function takes.</dd>
</dl>
<p> <b>update_option</b> : update_option( $option_name, $newvalue ); <br />
this use to store the option value .<br />
<b>delete_option</b> : delete_option($name); <br />
  delete the name of the option .<br />
<b>get_option</b> :get_option( $name, $default ) <br />
get the option value .<br />
<br />
Reference : <a href='http://codex.wordpress.org/Function_Reference/update_option'>Function Reference/update option</a> </p>
<h3>Add to the theme</h3>
<p>
From the above knowledge , we can easy to add theme options for our wordpress site now . First , let&#8217;s  do a &#8216;hello world&#8217; demo . add footer links  manage option  for the last <a title='free wordpress theme' href='http://www.brightyoursite.com/blog/2010/01/11/your-first-normal-wordpress-template/'> free wordpress theme </a> ,you may notice the footer links home ,contact &#8230;. those are hand-coded in the theme . so now we need add it to the theme options in order to make it editable via admin panel .
</p>
<p>Save following codes in the functions.php in the wordpress theme .</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> </span>
<span style="color: #009900;">function bright_addThemePage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #009900;">   $<span style="color: #000066;">ThemeName</span>=get_current_theme<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">    if <span style="color: #66cc66;">&#40;</span> $_GET<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'page'</span><span style="color: #66cc66;">&#93;</span> == basename<span style="color: #66cc66;">&#40;</span>__FILE__<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>	</span>
<span style="color: #009900;">	    // save settings</span>
<span style="color: #009900;">		if <span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'save'</span> == $_REQUEST<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'action'</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> 		</span>
<span style="color: #009900;">			check_admin_referer<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'save-theme-properties'</span> <span style="color: #66cc66;">&#41;</span>;  </span>
<span style="color: #009900;">			update_option<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'bright_foot'</span>, stripslashes<span style="color: #66cc66;">&#40;</span>$_REQUEST<span style="color: #66cc66;">&#91;</span> <span style="color: #ff0000;">'bright_foot'</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;	 </span>
<span style="color: #009900;">			// goto theme edit page</span>
<span style="color: #009900;">			header<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Location: themes.php?page=functions.php&amp;saved=true&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">			die;</span>
<span style="color: #009900;">  		// reset settings</span>
<span style="color: #009900;">		<span style="color: #66cc66;">&#125;</span> else if<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'reset'</span> == $_REQUEST<span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'action'</span><span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> </span>
<span style="color: #009900;">			delete_option<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'bright_foot'</span><span style="color: #66cc66;">&#41;</span>;		 </span>
<span style="color: #009900;">			// goto theme edit page</span>
<span style="color: #009900;">			header<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Location: themes.php?page=functions.php&amp;reset=true&quot;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">			die;</span>
<span style="color: #009900;">		<span style="color: #66cc66;">&#125;</span></span>
<span style="color: #009900;">	<span style="color: #66cc66;">&#125;</span></span>
<span style="color: #009900;">	add_theme_page<span style="color: #66cc66;">&#40;</span> $ThemeName . <span style="color: #ff0000;">' Theme Options'</span>, $ThemeName . <span style="color: #ff0000;">' Options'</span>, <span style="color: #ff0000;">'edit_themes'</span>, basename<span style="color: #66cc66;">&#40;</span>__FILE__<span style="color: #66cc66;">&#41;</span>, <span style="color: #ff0000;">'bright_themePage'</span> <span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;"><span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #009900;">function bright_themePage<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> </span>
<span style="color: #009900;"><span style="color: #66cc66;">&#123;</span></span>
<span style="color: #009900;">       $<span style="color: #000066;">ThemeName</span>=get_current_theme<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; </span>
<span style="color: #009900;">	if <span style="color: #66cc66;">&#40;</span> $_REQUEST<span style="color: #66cc66;">&#91;</span> <span style="color: #ff0000;">'saved'</span> <span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span> echo <span style="color: #ff0000;">'&lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;&lt;strong&gt;</span></span>Settings saved.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/strong<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>';
	if ( $_REQUEST[ 'reset' ] ) echo '<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;message&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;updated fade&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;strong<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Settings reset.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/strong<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>';
?&gt;
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;wrap&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> 
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h2</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;border-bottom:none;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;?php</span> echo $ThemeName; <span style="color: #000000; font-weight: bold;">?&gt;</span></span> Theme Configuration<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h2<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;form</span> <span style="color: #000066;">method</span>=<span style="color: #ff0000;">&quot;post&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> 
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> if <span style="color: #66cc66;">&#40;</span> function_exists<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'wp_nonce_field'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> wp_nonce_field<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'save-theme-properties'</span> <span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></span> 	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;width:575px;float:left;padding-bottom:30px;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h3<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Footer Links Management<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h3<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Manage footer links here.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;table</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">cellspacing</span>=<span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #000066;">cellpadding</span>=<span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;editform form-table&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> 
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;tr<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;th<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>  footer links <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/th<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;td</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">'width:80%'</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;textarea</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;bright_foot&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;bright_foot&quot;</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;width: 100%; height: 10em;&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;code&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;?php</span> echo get_settings<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;bright_foot&quot;</span><span style="color: #66cc66;">&#41;</span> ; <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/textarea<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/td<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/tr<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/table<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>		 
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;hidden&quot;</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;action&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;save&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span> 
				 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">align</span>=<span style="color: #ff0000;">&quot;right&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;input</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;save&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;Save Settings&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;br</span> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;clear:both;&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>	
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>	</span>
<span style="color: #009900;"><span style="color: #66cc66;">&#125;</span>//end of themepage function</span>
<span style="color: #009900;">  add_action<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">'admin_menu'</span>, <span style="color: #ff0000;">'bright_addThemePage'</span> <span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">  <span style="color: #000000; font-weight: bold;">?&gt;</span></span></pre></div></div>

<p> Now , we need change the footer.php</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;footer&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
   <span style="color: #009900;">&lt;?=get_option<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;bright_foot&quot;</span> <span style="color: #66cc66;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> <span style="color: #ddbb00;">&amp;copy;</span> 2009 www.brightyoursite.com All Rights Reserved.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>  
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_footer<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Take a notice with  the <b> delete_option( &#8216;bright_foot&#8217;) </b> , <b> update_option( &#8216;bright_foot&#8217;, stripslashes($_REQUEST[ 'bright_foot'] )) </b> , <b>get_option( &#8220;bright_foot&#8221; )</b> <b>&#8216;bright_foot&#8217;</b> that&#8217;s the key of option , it must the same . <b>$_REQUEST[ 'bright_foot'] &lt;textarea name=&#8221;bright_foot&#8221;&gt; </b> also the same .<br />
</p>
<h3>More applications</h3>
<p>
From the hello world demo, we can easy to add more options and change it to manage  advertisement , we also can use this to add specific category to home page as featured posts , for instance :</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;featured&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span></span>
<span style="color: #009900;">wp_reset_query<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">$count = get_option<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'theme_featured_count'</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">query_posts<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'showposts='</span> . $count . <span style="color: #ff0000;">'&amp;cat='</span> . get_cat_ID<span style="color: #66cc66;">&#40;</span>get_option<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'featured'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">if <span style="color: #66cc66;">&#40;</span>have_posts<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> : while <span style="color: #66cc66;">&#40;</span>have_posts<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> : the_post<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; </span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;post&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;featured-body&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> 
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;featured-text&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;h1<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;&lt;?php the_permalink() ?&gt;</span></span>&quot; class=&quot;featured-title&quot;&gt;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;?php</span> excerpt<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'30'</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #808080; font-style: italic;">&lt;!-- END Post --&gt;</span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> endwhile; endif; wp_reset_query<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #808080; font-style: italic;">&lt;!-- END featured --&gt;</span></pre></div></div>

<p>put those in your index.php also <b> add two more options in the function.php theme_featured_count</b> and  featured</b> . You also can customize it do add a slider images.
</p>
<h3>Download</h3>
<p>
<a href='http://www.brightyoursite.com/demo/wordpress/ThemeOptions.zip'>Theme option hello world demo </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightyoursite.com/blog/2010/02/10/add-theme-options-for-your-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Your first normal wordpress template</title>
		<link>http://www.brightyoursite.com/blog/2010/01/11/your-first-normal-wordpress-template/</link>
		<comments>http://www.brightyoursite.com/blog/2010/01/11/your-first-normal-wordpress-template/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 15:28:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[css xhtml]]></category>
		<category><![CDATA[SEO Friendly]]></category>
		<category><![CDATA[w3c validation]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[2 columns layout]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[templates]]></category>

		<guid isPermaLink="false">http://www.brightyoursite.com/?p=9</guid>
		<description><![CDATA[Introduce Now,let&#8217;s make all together (w3c valid 2 columns xhtml ,ul li css none-js SEO friendly sub-menu),we get a full wordpress home page html template&#8211;Click HERE to view.It looks nice simple &#38; usefull, right ？let&#8217;s start to convert it to wordpress theme. First,We should know some basic wordpress theme Knowledge: What&#8217;s a basic theme include [...]]]></description>
			<content:encoded><![CDATA[<h3>Introduce</h3>
<p>
Now,let&#8217;s make all together (w3c valid 2 columns xhtml ,ul li css none-js SEO friendly sub-menu),we get a full wordpress home page html template&#8211;Click <a target='_blank' href='http://www.brightyoursite.com/demo/2-columns-layout/wordpress-html-template.html' title='wordpress html template'>HERE</a> to view.It looks nice  simple &amp; usefull, right ？let&#8217;s start to convert it to wordpress theme.
</p>
<p><span id="more-9"></span></p>
<p>
First,We should know some basic wordpress theme Knowledge:<br />
<strong>What&#8217;s a basic theme include ?</strong><br/></p>
<ul>
<li>css style (required,style.css,style the page also put your personal info. like theme name , author &#8230;)</li>
<li>index.php (required,WordPress Theme start with this file if without the home.php)</li>
<li>a screenshot (optionally,screenshot.png)</li>
<li>single.php (optionally,this file to generate the  structure for a single post,if no such a file the wordpress will use index.php to generate the structure )</li>
<li>page.php (optionally,this file to generate the  structure for a single page,similar as single.php)</li>
</ul>
<p>so we know a very minimum wordpress theme should include (index.php,style.css) .but usually in order to keep the site in a more good structure and can maxmum reuse , flexible .The page&#8217;s structure is  separated to<br />
several parts:</p>
<ul>
<li> <tt>header.php</tt>
</li>
<li> <tt>sidebar.php</tt>
</li>
<li> <tt>footer.php</tt>
</li>
<li> <tt>comments.php</tt>
</li>
<li> <tt>comments-popup.php</tt>
</li>
</ul>
<p>reference those in the template php file is very easy.For instance,header.php :</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> get_headerer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>the comment, use the  comments_template()  template tag.<br />
the sidebar, use the get_sidebar() template tag.<br />
the footer, use the get_footer() template tag.<br/><br />
Also can use</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span>TEMPLATEPATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/script.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>to reference any php file in the  template folder.
</p>
<h3>Start coding wordpress theme now</h3>
<p>
First ,we need declare the theme in style.css .For instance</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*
Theme Name: red theme
Theme URI: http://www.brightyoursite.com/blog/2010/01/11/your-first-normal-wordpress-template/
Description:Your first wordpress theme
Version: 1.6
Author: alex 
Author URI:  http://www.brightyoursite.com
Tags: red, fixed width, two columns, widgets 
*/</span></pre></div></div>

<p>you can see the define theme name , url version aurhor &#8230;. there .<br />
Next , do the  page segmentation  and create the header.php , footer.php , sidebar.php and index.php .<br />
to make it easier we can copy the those files from the wordpress default theme . we just need copy our html codes and do some adjustment. for instace change the menu to wordpress page list ：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">  &lt;div id=&quot;menus&quot;&gt;
  &lt;ul&gt;
 <span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_list_pages<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;title_li=&amp;depth=2&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
 &lt;/ul&gt;
  &lt;/div&gt;</pre></div></div>

<p>the main posts loop:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> if <span style="color: #66cc66;">&#40;</span>have_posts<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #000000; font-weight: bold;">?&gt;</span></span> 
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> while <span style="color: #66cc66;">&#40;</span>have_posts<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> : the_post<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000000; font-weight: bold;">&lt;?php</span> post_class<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></span> id=&quot;post-<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span></span>&quot;&gt;
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;item_head&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;item_header_text&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;h1<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;&lt;?php the_permalink() ?&gt;</span></span>&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title_attribute<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span></span>&quot;&gt;<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/a</span><span style="color: #000000; font-weight: bold;">&lt;/h1</span><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>					
	 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
	 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;item_description&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Read the rest of this entry &amp;raquo;'</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;tags&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;?php</span> the_tags<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Tags: '</span>, <span style="color: #ff0000;">', '</span>, <span style="color: #ff0000;">'&lt;br /&gt;</span></span>');  ?&gt; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>  
	 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
	 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> endwhile; <span style="color: #000000; font-weight: bold;">?&gt;</span></span> 
	 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;navigation&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;alignleft&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;?php</span> next_posts_link<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'&amp;laquo; Older Entries'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;div</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;alignright&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;?php</span> previous_posts_link<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Newer Entries &amp;raquo;'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/div<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
	  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> else : <span style="color: #000000; font-weight: bold;">?&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h2</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;center&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Not Found<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h2<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;center&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Sorry, but you are looking for something that isn't here.<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> get_search_form<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #000000; font-weight: bold;">?&gt;</span></span> 
         <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> endif; <span style="color: #000000; font-weight: bold;">?&gt;</span></span></pre></div></div>

</p>
<h3>Online demo and free wordpress theme download</h3>
<p>
 <a target='_blank' title="red theme has been previewed 1773 times." href="http://www.brightyoursite.com/blog//?themedemo=redtheme">Preview red theme (1773)</a><br />
<br />
<a href='http://www.brightyoursite.com/demo/free-wordpress-theme/redtheme.zip'>Download there</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightyoursite.com/blog/2010/01/11/your-first-normal-wordpress-template/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Make a wordpress template step by step</title>
		<link>http://www.brightyoursite.com/blog/2009/11/20/make-a-wordpress-template-step-by-step/</link>
		<comments>http://www.brightyoursite.com/blog/2009/11/20/make-a-wordpress-template-step-by-step/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 15:16:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[css xhtml]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[w3c valid]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://www.brightyoursite.com/?p=3</guid>
		<description><![CDATA[User need have basic css xhtml and php knowledge.just follow the steps , you will be wordpress theme expert . How to code a w3c valid 2 columns xhtml layout–step 1 How to code a w3c valid 2 columns xhtml layout–step 2 ul li css none-js SEO friendly sub-menu Your first normal wordpress template add [...]]]></description>
			<content:encoded><![CDATA[<p>User need have basic css xhtml and php knowledge.just follow the steps , you will be wordpress theme expert .</p>
<ol>
<li><a href="http://www.brightyoursite.com/blog/2009/11/20/how-to-code-a-w3c-valid-2-columns-xhtml-layout/">How to code a w3c valid 2 columns xhtml layout–step 1</a></li>
<li><a href="http://www.brightyoursite.com/blog/2009/12/11/how-to-code-a-w3c-valid-2-columns-xhtml-layout-step-2/">How to code a w3c valid 2 columns xhtml layout–step 2</a></li>
<li><a href="http://www.brightyoursite.com/blog/2010/01/10/ul-li-css-seo-friendly-sub-menu/">ul li css none-js SEO friendly sub-menu</a></li>
<li><a href="http://www.brightyoursite.com/blog/2010/01/11/your-first-normal-wordpress-template/">Your first normal wordpress template</a></li>
<li><a href='http://www.brightyoursite.com/blog/2010/02/10/add-theme-options-for-your-wordpress-theme/'>add theme options for your wordpress theme</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.brightyoursite.com/blog/2009/11/20/make-a-wordpress-template-step-by-step/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

