<?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>websitedesignby.com &#187; Wordpress</title>
	<atom:link href="http://www.websitedesignby.com/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.websitedesignby.com</link>
	<description>Web Site Design and Programming - Naples, Florida</description>
	<lastBuildDate>Mon, 06 Sep 2010 11:27:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Wordpress Website Development Work Flow: wp-config.php</title>
		<link>http://www.websitedesignby.com/programming/wordpress-website-development-work-flow-wp-config-php/</link>
		<comments>http://www.websitedesignby.com/programming/wordpress-website-development-work-flow-wp-config-php/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 12:59:00 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.websitedesignby.com/?p=642</guid>
		<description><![CDATA[When I am working on a website I have a local development version that I program and test locally. When an update is implemented, it is tested locally before it is copied to the live server. Wordpress sites are treated no differently. Here is how you can make the wp-config.php portable to work in your [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.websitedesignby.com/wp-content/uploads/local_live_sign1.jpg" alt="" title="local_live_sign" width="300" height="257" class="alignnone size-full wp-image-667" align="right" style="padding:10px;" />When I am working on a website I have a local development version that I program and test locally. When an update is implemented, it is tested locally before it is copied to the live server. Wordpress sites are treated no differently. Here is how you can make the wp-config.php portable to work in your live and local environment. Simply replace the variables below with the actual information for your web site and you will be have a wp-config.php that can happily thrive in both environments. </p>
<p>I defined an additional constant &#8216;LIVE&#8217; that I can refer to elsewhere in my code to determine if I am on the live server or not.</p>
<p><strong>wp-config.php</strong></p>
<div class="code">
<?php<br />
<span class="highlight"><br />
if($_SERVER['HTTP_HOST']==&#8217;livedomain.com&#8217; || $_SERVER['HTTP_HOST']==&#8217;www.livedomain.com&#8217;){</p>
<div class="indent">
	define(&#8216;DB_NAME&#8217;, &#8216;db_name_live&#8217;);    // The name of the database<br />
	define(&#8216;DB_USER&#8217;, &#8216;mysql_username_live&#8217;);     // Your MySQL username<br />
	define(&#8216;DB_PASSWORD&#8217;, &#8216;mysql_password_live&#8217;); // &#8230;and password<br />
	define(&#8216;DB_HOST&#8217;, &#8216;localhost&#8217;);    // db host<br />
	define(&#8216;DB_CHARSET&#8217;, &#8216;utf8&#8242;);<br />
	define(&#8216;DB_COLLATE&#8217;, &#8221;);<br />
	define(&#8216;AUTH_KEY&#8217;, &#8216;put your unique phrase here&#8217;);<br />
	define(&#8216;SECURE_AUTH_KEY&#8217;, &#8216;put your unique phrase here&#8217;);<br />
	define(&#8216;LOGGED_IN_KEY&#8217;, &#8216;put your unique phrase here&#8217;);<br />
	define(&#8216;LIVE&#8217;, true);
</div>
<p>}else{</p>
<div class="indent">
	define(&#8216;DB_NAME&#8217;, &#8216;name_of_db_local&#8217;);    // The name of the database<br />
	define(&#8216;DB_USER&#8217;, &#8216;mysql_username_local&#8217;);     // Your MySQL username<br />
	define(&#8216;DB_PASSWORD&#8217;, &#8216;mysql_password_local&#8217;); // &#8230;and password<br />
	define(&#8216;DB_HOST&#8217;, &#8216;localhost&#8217;);    // db host<br />
	define(&#8216;DB_CHARSET&#8217;, &#8216;utf8&#8242;);<br />
	define(&#8216;DB_COLLATE&#8217;, &#8221;);<br />
	define(&#8216;AUTH_KEY&#8217;, &#8216;put your unique phrase here&#8217;);<br />
	define(&#8216;SECURE_AUTH_KEY&#8217;, &#8216;put your unique phrase here&#8217;);<br />
	define(&#8216;LOGGED_IN_KEY&#8217;, &#8216;put your unique phrase here&#8217;);<br />
	define(&#8216;LIVE&#8217;, false);
</div>
<p>}<br />
</span><br />
// You can have multiple installations in one database if you give each a unique prefix<br />
$table_prefix  = &#8216;wp_&#8217;;   // Only numbers, letters, and underscores please!</p>
<p>// Change this to localize WordPress.  A corresponding MO file for the<br />
// chosen language must be installed to wp-content/languages.<br />
// For example, install de.mo to wp-content/languages and set WPLANG to &#8216;de&#8217;<br />
// to enable German language support.<br />
define (&#8216;WPLANG&#8217;, &#8221;);</p>
<p>/* That&#8217;s all, stop editing! Happy blogging. */</p>
<p>if ( !defined(&#8216;ABSPATH&#8217;) )<br />
	define(&#8216;ABSPATH&#8217;, dirname(__FILE__) . &#8216;/&#8217;);<br />
require_once(ABSPATH . &#8216;wp-settings.php&#8217;);<br />
?></p>
</div>
<h3>MySQL Queries</h3>
<p>Another thing to be conscious of when moving between a live and local server environment with Wordpress are couple of records in the wp_options table of the database. The <em>siteurl</em> and <em>liveurl</em> records will be different in your local environment and live environment. If you copy your database from one to the other, just run the appropriate query below (with the <em>liveurl</em> and <em>localurl</em> variables changed to your actual data) depending on if you are copying from local to live or live to local.</p>
<h3>Live to Local Query</h3>
<p>Run query on local database.</p>
<div class="code">
UPDATE wp_options SET option_value=&#8217;http://localurl.com&#8217; WHERE option_name=&#8217;siteurl&#8217; ;</p>
<p>UPDATE wp_options SET option_value=&#8217;http://localurl.com&#8217; WHERE option_name=&#8217;home&#8217;
</p></div>
<h3>Local to Live Query</h3>
<p>Run query on live database.</p>
<div class="code">
UPDATE wp_options SET option_value=&#8217;<em>http://liveurl.com</em>&#8216; WHERE option_name=&#8217;siteurl&#8217; ;</p>
<p>UPDATE wp_options SET option_value=&#8217;http://liveurl.com&#8217; WHERE option_name=&#8217;home&#8217;
</p></div>
<p>If you have any questions or suggestions, your comments are welcome below.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Wordpress+Website+Development+Work+Flow%3A+wp-config.php+http://5xr5x.th8.us" title="Post to Twitter"><img class="nothumb" src="http://www.websitedesignby.com/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Wordpress+Website+Development+Work+Flow%3A+wp-config.php+http://5xr5x.th8.us" title="Post to Twitter">Tweet This Post</a></p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.websitedesignby.com%2Fprogramming%2Fwordpress-website-development-work-flow-wp-config-php%2F&amp;linkname=Wordpress%20Website%20Development%20Work%20Flow%3A%20wp-config.php"><img src="http://www.websitedesignby.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.websitedesignby.com/programming/wordpress-website-development-work-flow-wp-config-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Wordpress FB Connect</title>
		<link>http://www.websitedesignby.com/programming/wordpress-fb-connect/</link>
		<comments>http://www.websitedesignby.com/programming/wordpress-fb-connect/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 22:12:50 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[APIs]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.websitedesignby.com/?p=222</guid>
		<description><![CDATA[You can now log in to post comments on my blog using FaceBook via WP-FacebookConnect.
 Tweet This Post]]></description>
			<content:encoded><![CDATA[<p>You can now log in to post comments on my blog using FaceBook via <a href="http://wiki.developers.facebook.com/index.php/WP-FBConnect" target="_blank">WP-FacebookConnect</a>.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Wordpress+FB+Connect+http://e2977.th8.us" title="Post to Twitter"><img class="nothumb" src="http://www.websitedesignby.com/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Wordpress+FB+Connect+http://e2977.th8.us" title="Post to Twitter">Tweet This Post</a></p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.websitedesignby.com%2Fprogramming%2Fwordpress-fb-connect%2F&amp;linkname=Wordpress%20FB%20Connect"><img src="http://www.websitedesignby.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.websitedesignby.com/programming/wordpress-fb-connect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress</title>
		<link>http://www.websitedesignby.com/uncategorized/wordpress/</link>
		<comments>http://www.websitedesignby.com/uncategorized/wordpress/#comments</comments>
		<pubDate>Sun, 22 Mar 2009 00:34:23 +0000</pubDate>
		<dc:creator>Ross</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://websitedesignby.com/?p=54</guid>
		<description><![CDATA[This site is currently running on word press blogging tool and publishing platform. I installed the Cleanmachine theme but that will likely change soon and often as I experiment with differnt looks and functionality. You might be wondering why I didn&#8217;t design my own site. Currently I am interested in learning about existing technology and [...]]]></description>
			<content:encoded><![CDATA[<p>This site is currently running on<a href="http://wordpress.org/" target="_blank"> word press</a> blogging tool and publishing platform. I installed the Cleanmachine theme but that will likely change soon and often as I experiment with differnt looks and functionality. You might be wondering why I didn&#8217;t design my own site. Currently I am interested in learning about existing technology and how to increase efficiency for myself and clients. I am more intersted in learning how to use and integrate existing systems than to build new ones from scratch. The wheel has been invented.</p>
<p>Inevitably I will end up having to build new systems, but my experiences using existing ones will improve my skill at developing new ones.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=WordPress+http://mzr5a.th8.us" title="Post to Twitter"><img class="nothumb" src="http://www.websitedesignby.com/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=WordPress+http://mzr5a.th8.us" title="Post to Twitter">Tweet This Post</a></p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.websitedesignby.com%2Funcategorized%2Fwordpress%2F&amp;linkname=WordPress"><img src="http://www.websitedesignby.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.websitedesignby.com/uncategorized/wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
