<?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>Eire Studio Blog &#187; Tips &amp; Tricks</title>
	<atom:link href="http://www.eirestudio.net/blog/topics/tips-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.eirestudio.net/blog</link>
	<description>Web Design Blog by Eire Studio</description>
	<lastBuildDate>Wed, 21 Dec 2011 21:52:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2-alpha</generator>
		<item>
		<title>Adding a custom meta box in WordPress</title>
		<link>http://www.eirestudio.net/blog/adding-a-custom-meta-box-in-wordpress/</link>
		<comments>http://www.eirestudio.net/blog/adding-a-custom-meta-box-in-wordpress/#comments</comments>
		<pubDate>Wed, 04 May 2011 21:42:39 +0000</pubDate>
		<dc:creator>Keith</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.eirestudio.net/blog/?p=318</guid>
		<description><![CDATA[In this little tutorial, we will be creating a simple meta box in WordPress that will be displayed when we are writing a new post. The meta box we will create is very basic and will only print some text but this will get you comfortable with using them. First off, open up your functions.php [...]]]></description>
			<content:encoded><![CDATA[<p>In this little tutorial, we will be creating a simple meta box in WordPress that will be displayed when we are writing a new post. The meta box we will create is very basic and will only print some text but this will get you comfortable with using them.</p>
<p>First off, open up your functions.php file and add the following code.</p>
<pre>add_action('add_meta_boxes', 'eirestudio_create_meta_box');
function eirestudio_create_meta_box()
{
   add_meta_box('eirestudio_meta_wrapper', 'My Super Meta Box', 'eirestudio_display_meta_box', 'post', 'side' ,'default', '');
}

function eirestudio_display_meta_box()
{
   echo 'Eire Studio welcomes you!';
}</pre>
<h3>Heres how it works</h3>
<p>The <em>add_action</em> function attaches a custom function (which we have to create) to an action; the action we are using in this tutorial is the <em>add_meta_boxes </em>action.  <strong>The <em>add_action</em> function accepts 4 parameters:</strong></p>
<ul>
<li><code><strong> tag </strong>(required) - </code>The name of the action you wish to hook onto. <a href="http://codex.wordpress.org/Plugin_API/Action_Reference">A list of available actions are here</a>.</li>
<li><code><strong>function_to_add</strong> (required) - </code>This is name of your function you want to be used.</li>
<li><code><strong>priority</strong> - </code>This determines when your function is called in relation to other functions. The default setting is 10.</li>
<li><code><strong>accepted_args</strong> - </code>How many arguments your function takes.</li>
</ul>
<p>The <em>eirestudio_create_meta_box</em> function is a function we will use to create the meta box by using the add_meta_box action.  The <em>add_meta_box</em> action defines the meta box such as the heading, where it will be shown on the page etc.  <strong>The <em>add_meta_box</em> action accepts 7 parameters: </strong></p>
<ul>
<li><strong>id </strong>(required) = The CSS id that your meta box will be wrapped in.</li>
<li><strong>title </strong>(required) = The heading of your meta box.</li>
<li><strong>callback </strong>(required) = The function name to be called to actually show the meta box.</li>
<li><strong>page </strong>(required) = What screen will this meta box be shown on. Post, page, custom post type or link.</li>
<li><strong>context </strong>= Which part of the screen will the meta box be shown.
<ul>
<li>normal</li>
<li>advanced</li>
<li>side</li>
</ul>
</li>
<li><strong>priority </strong>= The priority in which your meta box should be shown. <tt>high</tt>, <tt>core</tt>, <tt>default</tt> or <tt>low. </tt></li>
<li><strong>callback_args</strong> = Arguments to pass into your callback function.</li>
</ul>
<p>Then we simply create the <em>eirestudio_display_meta_box</em> function and pop in some content <img src='http://www.eirestudio.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img class="alignnone size-full wp-image-337" title="custom_meta_box" src="http://www.eirestudio.net/blog/wp-content/uploads/2011/05/custom_meta_box.png" alt="" width="302" height="76" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.eirestudio.net/blog/adding-a-custom-meta-box-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress to WPMU Conversion</title>
		<link>http://www.eirestudio.net/blog/wordpress-to-wpmu-conversion/</link>
		<comments>http://www.eirestudio.net/blog/wordpress-to-wpmu-conversion/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 04:47:24 +0000</pubDate>
		<dc:creator>Keith</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>

		<guid isPermaLink="false">http://www.eirestudio.net/blog/?p=175</guid>
		<description><![CDATA[So I just finished installing and converting this site to WPMU, mainly to test it out and delve deeper into wordpress. The migration from the old site to the new, went remarkably smooth and the site was only down for about 5 minutes which I class as a big success (Also, I&#8217;m sure my method [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-177" title="wordpress-mu-logo" src="http://www.eirestudio.net/blog/wp-content/uploads/2010/02/wordpress-mu-logo.png" alt="" width="144" height="144" />So I just finished installing and converting this site to <a title="http://mu.wordpress.org/" href="http://mu.wordpress.org/">WPMU</a>, mainly to test it out and delve deeper into wordpress.</p>
<p>The migration from the old site to the new, went remarkably smooth and the site was only down for about 5 minutes which I class as a big success (Also, I&#8217;m sure my method is not the most elegant). Because of the fact that WordPress and WMPU share 99% of the same codebase, the conversion was painless.</p>
<p>I am going to briefly explain how I did it.</p>
<p><strong>Step 1 &#8211; Backup<br />
</strong></p>
<p>Backup, Backup, Backup!</p>
<p>Using ftp, everything was backed up, as in the complete installation and all sub directories of the existing wordpress installation. Then I dumped the entire mysql database for the site. Now if we bodge it up, it doesn&#8217;t really matter, we have the most important thing, our data.</p>
<p><strong>Step 2 &#8211; Download<br />
</strong></p>
<p><a title="http://mu.wordpress.org/download/" href="http://mu.wordpress.org/download/">Download WPMU</a> and overwrite all existing wordpress files and folders. Now delete the .htaccess and wp-config.php files. Pop over into the browser and refresh your site. You should now see an install screen. (Note: my site is for personal use and gets only a few visitors, so If your site is big and gets alot of traffic, put up a blank index.php file to protect yourself against malicious users.) Fill in your database details as per your original wordrpess installation and log in. You should now have a working install of WMPU.</p>
<p><strong>Step 3 &#8211; Migrate</strong></p>
<p>So, we now have a spanky new WPMU install, pretty cool huh? Our next step is to migrate all of our old content into WMPU. While having a peek through PHPmyadmin, I see some new tables created by WMPU: wp_1_ etc. Keep a note of the these.</p>
<p>Now I select  the main tables which are below and export only these tables. Also, select the &#8216;Add DROP TABLE&#8217; checkbox.</p>
<ul>
<li>wp_comments</li>
<li>wp_commentmeta</li>
<li>wp_links</li>
<li>wp_postmeta</li>
<li>wp_posts</li>
<li>wp_terms</li>
<li>wp_term_relationships</li>
<li>wp_term_taxonomy</li>
</ul>
<p>With the sql file, I open this in a text editor and begin to replace the old table names with the new ones.</p>
<p>For example. When fixing the wp_posts table for use with WPMU, I simply do a find and replace like so:</p>
<p>Find wp_posts Replace wp_1_posts and do this for all of the 8 tables above.</p>
<p><strong>Step 4 &#8211; Patch</strong></p>
<p>WordPress MU adds a &#8216;/blog&#8217; to your posts and removes the www from the url by default. If you have some content indexed in Google and don&#8217;t want to lose any traffic, there are 2 optional steps left.<a href="http://www.thinkinginwordpress.com/2009/09/remove-blog-slug-from-the-default-blog-of-wpmu-subdirectory-installation/"></a></p>
<p><a href="http://www.thinkinginwordpress.com/2009/09/remove-blog-slug-from-the-default-blog-of-wpmu-subdirectory-installation/">Download and activate this plugin</a>.</p>
<p>And add this to your .htaccess file to convert www traffic to the new non www url.</p>
<pre>RewriteCond %{HTTP_HOST} !^example\.com$
RewriteRule (.*) http://example.com/$1 [R=301,L]
</pre>
<p>Now, you are done and have a WordPress Mu installation, congrats!</p>
<p><strong>Conclusion</strong></p>
<p>As mentioned at the start of this post, this is most likely not the most elegant solution but It worked absolutely fine for me and should work for you too. Also, in regards to the media files, you can replace these permalinks in mysql and point them to the new files/ folder, but as this is a small site, I&#8217;m fine with my images pointing to my old wp_content folder.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eirestudio.net/blog/wordpress-to-wpmu-conversion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

