<?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>CAM Web Design &#187; Wordpress</title>
	<atom:link href="http://camwebdesign.com/category/techniques/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://camwebdesign.com</link>
	<description>High quality, cost effective wed design and hosting solutions</description>
	<lastBuildDate>Mon, 14 May 2012 04:20:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Simplify the WordPress Admin sidebar navigation</title>
		<link>http://camwebdesign.com/techniques/simplify-the-wordpress-admin-sidebar-navigation/</link>
		<comments>http://camwebdesign.com/techniques/simplify-the-wordpress-admin-sidebar-navigation/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 07:35:49 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://camwebdesign.com/?p=1648</guid>
		<description><![CDATA[Want to remove some of the root WordPress Admin sidebar navigation? We have a client that was mainly interested in writing pages and managing media for those pages, they were not going to use Posts, Comments or Links in the administration area. We set them up as Editors on a WordPress Multisite installation, below is <a href="http://camwebdesign.com/techniques/simplify-the-wordpress-admin-sidebar-navigation/" class="more-link">(more...)</a>]]></description>
			<content:encoded><![CDATA[<p>Want to remove some of the root WordPress Admin sidebar navigation?  We have a client that was mainly interested in writing pages and managing media for those pages, they were not going to use Posts, Comments or Links in the administration area.  We set them up as <a href="http://codex.wordpress.org/Roles_and_Capabilities#Editor">Editors</a> on a <a href="/techniques/wordpress/wordpress-multisite-on-hostgator-reseller/">WordPress Multisite</a> installation, below is how we removed those items from appearing in the navigation.</p>
<p>First we define a new function, we used <code>remove_admin_menu_items()</code>.<span id="more-1648"></span>  In this function we define an array <code>$remove_menu_items</code> that contains the menu items we wish to remove from the admin navigation.  The function is designed to step through WordPress&#8217; multidimensional array <code>$menu</code>, getting each <code>$menu</code> item name by use of the PHP function <a href="http://php.net/manual/en/function.explode.php"><code>explode()</code></a>.  It then checks if that <code>$menu</code> item name is in our <code>$remove_menu_items</code> array using the PHP function <a href="http://php.net/manual/en/function.in-array.php"><code>in_array()</code></a>.  If the <code>$menu</code> item name does appear, then that item is removed from the multidimensional array <code>$menu</code>, by use the PHP function <a href="http://php.net/manual/en/function.unset.php"><code>unset()</code></a>.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> remove_admin_menu_items<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$remove_menu_items</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Posts'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Links'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Comments'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$menu</span><span style="color: #339933;">;</span>
  <span style="color: #990000;">end</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$menu</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">prev</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$menu</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$item</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span><span style="color: #000088;">$menu</span><span style="color: #009900;">&#91;</span><span style="color: #990000;">key</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$menu</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">NULL</span>?<span style="color: #000088;">$item</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #339933;">,</span> <span style="color: #000088;">$remove_menu_items</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$menu</span><span style="color: #009900;">&#91;</span><span style="color: #990000;">key</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$menu</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>We then initiate the <code>remove_admin_menu_items()</code> function using the <a href="http://codex.wordpress.org/Function_Reference/add_action"><code>add_action()</code></a> WordPress function as shown below.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin_menu'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'remove_admin_menu_items'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Putting it all together yields the following code to be placed in your theme&#8217;s functions.php file:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/* Clean up the admin sidebar navigation *************************************************/</span>
<span style="color: #000000; font-weight: bold;">function</span> remove_admin_menu_items<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$remove_menu_items</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Posts'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>__<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Links'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Comments'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$menu</span><span style="color: #339933;">;</span>
  <span style="color: #990000;">end</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$menu</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">prev</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$menu</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$item</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' '</span><span style="color: #339933;">,</span><span style="color: #000088;">$menu</span><span style="color: #009900;">&#91;</span><span style="color: #990000;">key</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$menu</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">in_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #009900; font-weight: bold;">NULL</span>?<span style="color: #000088;">$item</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span><span style="color: #0000ff;">&quot;&quot;</span> <span style="color: #339933;">,</span> <span style="color: #000088;">$remove_menu_items</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$menu</span><span style="color: #009900;">&#91;</span><span style="color: #990000;">key</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$menu</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</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;">'remove_admin_menu_items'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>All you&#8217;ll need to change is the array of items to remove in the <cdoe>$remove_menu_items</code> array.  In our example we removed: Posts, Links and Comments.  Other root level WordPress admin sidebar navigation items available for removal are Media, Pages, Appearance, Plugins, Users, Tools and Settings.</p>
]]></content:encoded>
			<wfw:commentRss>http://camwebdesign.com/techniques/simplify-the-wordpress-admin-sidebar-navigation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Redefine Twenty Ten header image width and height</title>
		<link>http://camwebdesign.com/techniques/redefine-twenty-ten-header-image-width-and-height/</link>
		<comments>http://camwebdesign.com/techniques/redefine-twenty-ten-header-image-width-and-height/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 05:59:24 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[Twenty Ten]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://camwebdesign.com/?p=1629</guid>
		<description><![CDATA[How do you go about redefining the WordPress Twenty Ten header image width and height? We recently used the Twenty Ten theme as a Parent Theme for a multi-site installation for a client. We wanted to retain the use of the custom header image, but wanted a different image width and height. It is accomplished <a href="http://camwebdesign.com/techniques/redefine-twenty-ten-header-image-width-and-height/" class="more-link">(more...)</a>]]></description>
			<content:encoded><![CDATA[<p>How do you go about redefining the WordPress Twenty Ten header image width and height?  We recently used the Twenty Ten theme as a Parent Theme for a multi-site installation for a client. We wanted to retain the use of the custom header image, but wanted a different image width and height.  It is accomplished with a few lines of code in the Twenty Ten <a href="http://codex.wordpress.org/Child_Themes">child theme</a>’s functions.php file.  <a href="http://camwebdesign.com/?p=1593">You are using a child theme, aren’t you?</a></p>
<p>The answer to this one is just so simple<span id="more-1629"></span> it needs nearly no explanation.  Simply redefine two varaibles <code>HEADER_IMAGE_WIDTH</code>, and <code>HEADER_IMAGE_HEIGHT</code>.  For our purposes we needed <code>800x182</code> to fit into the template.  Below is the code to be placed in your theme&#8217;s functions.php file simply add the image size to suite your needs:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/* Redefine the header image width and height ********************************************/</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'HEADER_IMAGE_WIDTH'</span><span style="color: #339933;">,</span> apply_filters<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'twentyten_header_image_width'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">800</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'HEADER_IMAGE_HEIGHT'</span><span style="color: #339933;">,</span> apply_filters<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'twentyten_header_image_height'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">182</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>UPDATE: This also works for the WordPress Twenty Eleven theme.</p>
]]></content:encoded>
			<wfw:commentRss>http://camwebdesign.com/techniques/redefine-twenty-ten-header-image-width-and-height/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Remove default WordPress Twenty Ten header images</title>
		<link>http://camwebdesign.com/techniques/remove-default-wordpresstwenty-ten-header-images/</link>
		<comments>http://camwebdesign.com/techniques/remove-default-wordpresstwenty-ten-header-images/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 05:44:30 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[Twenty Ten]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://camwebdesign.com/?p=1622</guid>
		<description><![CDATA[How do you remove those pesky default header images included in the Twenty Ten WordPress theme. We recently used the Twenty Ten theme as a Parent Theme for a multi-site installation for a client. We wanted to retain the use of the custom header image, but didn&#8217;t want the default header images to be visible. <a href="http://camwebdesign.com/techniques/remove-default-wordpresstwenty-ten-header-images/" class="more-link">(more...)</a>]]></description>
			<content:encoded><![CDATA[<p>How do you remove those pesky default header images included in the Twenty Ten WordPress theme.  We recently used the Twenty Ten theme as a Parent Theme for a multi-site installation for a client.  We wanted to retain the use of the custom header image, but didn&#8217;t want the default header images to be visible.  It is accomplished with a few lines of code in the Twenty Ten <a href="http://codex.wordpress.org/Child_Themes">child theme</a>’s functions.php file.  <a href="http://camwebdesign.com/?p=1593">You are using a child theme, aren’t you?</a></p>
<p>First define a new function, we used <code>remove_twenty_ten_headers()</code>.<span id="more-1622"></span>  We use the <a href="http://codex.wordpress.org/Function_Reference/unregister_default_headers"><code>unregister_default_headers()</code></a> WordPress function to un-register as many as we want.  In our example we removed them all.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> remove_twenty_ten_headers<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    unregister_default_headers<span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'berries'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'cherryblossom'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'concave'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'fern'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'forestfloor'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'inkwell'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'path'</span> <span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'sunset'</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>We then initiate the new <code>remove_twenty_ten_headers()</code> function using the <a href="http://codex.wordpress.org/Function_Reference/add_action"><code>add_action()</code></a> WordPress function as shown below.  We make sure to call our function after the theme setup has run to be sure our function is called after <a href="http://codex.wordpress.org/Function_Reference/register_default_headers"><code>register_default_headers()</code></a> has already added the headers we want to remove.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'after_setup_theme'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'remove_twenty_ten_headers'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">11</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Putting it all together yields the following code to be placed in your theme&#8217;s functions.php file:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/* Remove default twenty ten images ***********************************************/</span>
<span style="color: #000000; font-weight: bold;">function</span> remove_twenty_ten_headers<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    unregister_default_headers<span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'berries'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'cherryblossom'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'concave'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'fern'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'forestfloor'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'inkwell'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'path'</span> <span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'sunset'</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'after_setup_theme'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'remove_twenty_ten_headers'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">11</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>How simple is that!</p>
]]></content:encoded>
			<wfw:commentRss>http://camwebdesign.com/techniques/remove-default-wordpresstwenty-ten-header-images/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Create a WordPress Child Theme, allow updates</title>
		<link>http://camwebdesign.com/techniques/create-a-wordpress-child-theme-allow-updates/</link>
		<comments>http://camwebdesign.com/techniques/create-a-wordpress-child-theme-allow-updates/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 05:04:29 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[Twenty Ten]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://camwebdesign.com/?p=1593</guid>
		<description><![CDATA[So you&#8217;ve got a decent handle on how WordPress works, you may have even edited a few themes directly, but now those themes have updates, what do you do (better yet what should you have done)? You need to explore Child Themes. How do you actually create a child theme in WordPress you may ask? <a href="http://camwebdesign.com/techniques/create-a-wordpress-child-theme-allow-updates/" class="more-link">(more...)</a>]]></description>
			<content:encoded><![CDATA[<p>So you&#8217;ve got a decent handle on how WordPress works, you may have even edited a few themes directly, but now those themes have updates, what do you do (better yet what should you have done)?  You need to explore Child Themes.  How do you actually create a child theme in WordPress you may ask?  We will quickly explore what you need<span id="more-1593"></span> to create a Child Theme using the WordPress Twenty Ten theme as an example.  Then we will detail how to allow those updates to occur without loosing your customizations to any theme.</p>
<p>What do you need to create your Twenty Ten Child Theme (the basics):</p>
<ol>
<li>Twenty Ten installed in the <code>wp-content/themes/</code> folder.</li>
<li>A folder with your Child&#8217;s Theme name in the <code>wp-content/themes/</code> folder.</li>
<li>A <code>style.css</code> CSS file in the folder of your Child&#8217;s Theme.</li>
</ol>
<p>What could be additionally required:</p>
<ol>
<li>A <code>functions.php</code> file in the folder of your Child&#8217;s Theme, to modify or add functions.</li>
<li>Any additional file(s) you wish to modify from the Parent Theme: <code>header.php</code>, <code>footer.php</code>, etc.</li>
</ol>
<p>The magic happens in the CSS file of your Child Theme, namely the &#8220;Template&#8221; declaration line.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*
Template: twentyten
*/</span></pre></td></tr></table></div>

<p>Adding this &#8220;Template&#8221; declaration in the CSS file tells WordPress to look for and run the Twenty Ten theme as a parent to this theme.  The Child Theme will then get all the functionality of the Parent, but you&#8217;ll be able to modify the files without worry of being overwritten when the Parent Theme updates.  Putting the &#8220;Template&#8221; declaration together with some of the common WordPress Theme declarations yeilds the code below.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*
Theme Name: Your New Child Theme Name
Theme URI: http://your_web_site.com/
Description: Custom theme for your_web_site.com.
Author: You
Author URI: http://your_web_site.com/
Version: 0.1.0
Tags: all, the, tags, describing, your, new, theme
Template: twentyten
*/</span></pre></td></tr></table></div>

<p>So what should you do if you have modified a theme and updates to the theme are available?  Turn your current theme into a Child Theme.  For the sake of clarity, let&#8217;s assume you&#8217;ve modified the Twenty Ten theme.  Follow these steps below (replacing your current theme&#8217;s name where we&#8217;ve used Twenty Ten):</p>
<ol>
<li>Rename your current &#8220;Twenty Ten&#8221; theme in the <code>style.css</code> CSS file by modifying the &#8220;Theme Name&#8221; line.</li>
<li>Rename the &#8220;twentyten&#8221; folder your current theme is in.</li>
<li>Download a clean up-to-date copy of the Twenty Ten theme into your <code>wp-content/themes/</code> folder, don&#8217;t activate it.</li>
<li>Modify your newly renamed theme&#8217;s <code>style.css</code> CSS file by adding the &#8220;Template: twentyten&#8221; declaration.</li>
<li>Remove all the files you did not modify from your new Child Theme&#8217;s folder (you can usually tell by file-date-time if your using an ftp client).  Leave the original Twenty Ten ones alone from now on!</li>
<li>Re-activate your newly created Child Theme.</li>
</ol>
<p>Now you can happily let the Twenty Ten theme update eternally without loosing your modifications.</p>
]]></content:encoded>
			<wfw:commentRss>http://camwebdesign.com/techniques/create-a-wordpress-child-theme-allow-updates/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Remove Widgets from Twenty Ten WordPress theme</title>
		<link>http://camwebdesign.com/techniques/remove-widgets-from-twenty-ten-wordpress-theme/</link>
		<comments>http://camwebdesign.com/techniques/remove-widgets-from-twenty-ten-wordpress-theme/#comments</comments>
		<pubDate>Sun, 23 Jan 2011 03:50:37 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[Twenty Ten]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://camwebdesign.com/?p=1585</guid>
		<description><![CDATA[So you want to remove some of the &#8220;stock&#8221; Widget Areas from the WordPress Twenty Ten theme, how do you go about doing this? We will be using the WordPress function unregister_sidebar(). It is accomplished with a few lines of code in your Twenty Ten child theme’s functions.php file. You are using a child theme, <a href="http://camwebdesign.com/techniques/remove-widgets-from-twenty-ten-wordpress-theme/" class="more-link">(more...)</a>]]></description>
			<content:encoded><![CDATA[<p>So you want to remove some of the &#8220;stock&#8221; Widget Areas from the WordPress Twenty Ten theme, how do you go about doing this?  We will be using the WordPress function <a href="http://codex.wordpress.org/Function_Reference/unregister_sidebar"><code>unregister_sidebar()</code></a>. It is accomplished with a few lines of code in your Twenty Ten <a href="http://codex.wordpress.org/Child_Themes">child theme</a>’s functions.php file.  <a href="http://camwebdesign.com/?p=1593">You are using a child theme, aren’t you?</a></p>
<p>First define a new function, we used <code>remove_widget_area()</code>.  <span id="more-1585"></span>Inside this function we un-register the desired &#8220;stock&#8221; Widget Areas we don&#8217;t want or need.  Twenty Ten comes with the following &#8220;stock&#8221; Widget Areas: primary-widget-area, secondary-widget-area, first-footer-widget-area, second-footer-widget-area, third-footer-widget-area and fourth-footer-widget-area.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> remove_widget_area<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	unregister_sidebar<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'secondary-widget-area'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	unregister_sidebar<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'first-footer-widget-area'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	unregister_sidebar<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'second-footer-widget-area'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	unregister_sidebar<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'third-footer-widget-area'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	unregister_sidebar<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'fourth-footer-widget-area'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>We then initiate the new <code>remove_widget_area()</code> function using the <a href="http://codex.wordpress.org/Function_Reference/add_action"><code>add_action()</code></a> WordPress function as shown below.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'admin_init'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'remove_widget_area'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Putting it all together yields the following code to be placed in your theme&#8217;s functions.php file:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/* Remove &quot;extra&quot; Twenty Ten Widget Areas *******************************************************/</span>
<span style="color: #000000; font-weight: bold;">function</span> remove_widget_area<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	unregister_sidebar<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'secondary-widget-area'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	unregister_sidebar<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'first-footer-widget-area'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	unregister_sidebar<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'second-footer-widget-area'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	unregister_sidebar<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'third-footer-widget-area'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	unregister_sidebar<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'fourth-footer-widget-area'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'admin_init'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'remove_widget_area'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>It&#8217;s just that simple, now it&#8217;s your turn!</p>
]]></content:encoded>
			<wfw:commentRss>http://camwebdesign.com/techniques/remove-widgets-from-twenty-ten-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>WordPress Multisite on Hostgator (Reseller)</title>
		<link>http://camwebdesign.com/techniques/wordpress/wordpress-multisite-on-hostgator-reseller/</link>
		<comments>http://camwebdesign.com/techniques/wordpress/wordpress-multisite-on-hostgator-reseller/#comments</comments>
		<pubDate>Wed, 05 Jan 2011 15:46:02 +0000</pubDate>
		<dc:creator>Troy</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://camwebdesign.com/?p=1553</guid>
		<description><![CDATA[Utilizing the multisite capabilities of WordPress 3.0+ can have many applications and advantages. It substantially reduces the disk space required for multiple websites running WP. It also simplifies the process of keeping your WordPress installation, themes and plugins up-to-date. As we have installed a couple of these on our HostGator reseller account, we can safely <a href="http://camwebdesign.com/techniques/wordpress/wordpress-multisite-on-hostgator-reseller/" class="more-link">(more...)</a>]]></description>
			<content:encoded><![CDATA[<p>Utilizing the multisite capabilities of WordPress 3.0+ can have many applications and advantages. It substantially reduces the disk space required for multiple websites running WP.  It also simplifies the process of keeping your WordPress installation, themes and plugins up-to-date.</p>
<p>As we have installed a couple of these on our HostGator reseller account, we can safely say that the process is relatively painless.  But it helps to know in advance which steps are relevant to the HostGator environment.<span id="more-1553"></span></p>
<p>The <a href="http://codex.wordpress.org/Create_A_Network">WordPress multisite installation instructions</a> are as thorough as possible, given the different environments they must account for.</p>
<p>The only step that needs clarification in that procedure is step 2:</p>
<blockquote>
<h3>Step 2: Setting Wildcard Subdomains</h3>
<p>(If this is a Sub-directories Install, skip this step.)<br />
Sub-domain sites work with the use of wildcard subdomains. This is a two-step process:<br />
Apache must be configured to accept wildcards.<br />
Open up the httpd.conf file or the include file containing the VHOST entry for your web account.<br />
Add this line:<br />
ServerAlias *.example.com<br />
In the DNS records on your server, add a wildcard subdomain that points to the main installation. It should look like:<br />
A *.example.com<br />
[...snip...]</p></blockquote>
<p>For the first step in the &#8220;two-step process&#8221; described above, HostGator (reseller) seems to be set up to allow wildcard subdomains already (Good thing, too, since we don&#8217;t have access to httpd.conf or the VHOST file.)<br />
So on the &#8220;step two&#8221;&#8230;</p>
<p>For this step, you will need to access cPanel.<br />
In the &#8220;Domains&#8221; section, select &#8220;Subdomains&#8221;. Here you will want to create a wildcard subdomain (by creating the &#8216;*&#8217; subdomain.) A properly set up subdomain will look (something) like:<br />
<a href="http://camwebdesign.com/~/wp-content/uploads/2011/01/subdomain-cpanel.jpg"><img class="alignright size-large wp-image-1559" title="subdomain-cpanel" src="http://camwebdesign.com/~/wp-content/uploads/2011/01/subdomain-cpanel-600x51.jpg" alt="" width="600" height="51" /></a></p>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://camwebdesign.com/techniques/wordpress/wordpress-multisite-on-hostgator-reseller/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Admin Link Shortcode for Thematic Footer Text</title>
		<link>http://camwebdesign.com/techniques/admin-link-shortcode-for-thematic-footer-text/</link>
		<comments>http://camwebdesign.com/techniques/admin-link-shortcode-for-thematic-footer-text/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 12:07:03 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[Thematic]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://camwebdesign.com/?p=1252</guid>
		<description><![CDATA[Thematic comes with a variety of shortcodes that can be added to the footer text in the Thematic Options. We wanted to add the Admin link to the footer, but there is no predefined Thematic shortcode to do this. This technique shows how to create a custom Admin shortcode for Thematic. It is accomplished with <a href="http://camwebdesign.com/techniques/admin-link-shortcode-for-thematic-footer-text/" class="more-link">(more...)</a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://themeshaper.com/thematic/">Thematic</a> comes with a variety of <a href="http://en.support.wordpress.com/shortcodes/">shortcodes</a> that can be added to the footer text in the Thematic Options.  We wanted to add the Admin link to the footer, but there is no predefined Thematic shortcode to do this.  This technique shows how to create a custom Admin shortcode for Thematic.  It is accomplished with a few lines of code in your Thematic <a href="http://codex.wordpress.org/Child_Themes">child theme</a>’s functions.php file.  <a href="http://camwebdesign.com/?p=1593">You are using a child theme, aren’t you?</a></p>
<p>First define a new function, we used <code>thmfooter_admin_link()</code>.<span id="more-1252"></span>  We return the <a href="http://codex.wordpress.org/Function_Reference/wp_register"><code>wp_register()</code></a> WordPress function, to yield the Admin link.  Be sure to set the <code>wp_register() $echo</code> <a href="http://codex.wordpress.org/Function_Reference/wp_register#Parameters">parameter</a> to false, otherwise the Admin link will automatically print.  We&#8217;ll also set the <code>$before</code> and <code>$after</code> parameters as needed.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> thmfooter_admin_link<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> wp_register<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'| '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Lastly we register the shortcode, naming it &#8216;admin-link&#8217;, using the <a href="http://codex.wordpress.org/Function_Reference/add_shortcode"><code>add_shortcode()</code></a> WordPress function as shown below.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_shortcode<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin-link'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'thmfooter_admin_link'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Usage of our new shortcode is accomplished by simply adding [admin-link] in the footer text of the Thematic Options.</p>
<div id="attachment_1289" class="wp-caption alignnone" style="width: 580px"><img class="size-full wp-image-1289" title="Thematic Options" src="http://camwebdesign.com/~/wp-content/uploads/2010/08/thematic_options.jpg" alt="Thematic Options" width="570" height="320" /><p class="wp-caption-text">Thematic Options</p></div>
<p>Putting it all together, we have the following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//Add Admin shortcode to the siteinfo footer***************************************************************************</span>
<span style="color: #000000; font-weight: bold;">function</span> thmfooter_admin_link<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> wp_register<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'| '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_shortcode<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'admin-link'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'thmfooter_admin_link'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Yep, it&#8217;s just that simple.</p>
]]></content:encoded>
			<wfw:commentRss>http://camwebdesign.com/techniques/admin-link-shortcode-for-thematic-footer-text/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using HTML5 with your Thematic Child Theme</title>
		<link>http://camwebdesign.com/techniques/using-html5-with-your-thematic-child-theme/</link>
		<comments>http://camwebdesign.com/techniques/using-html5-with-your-thematic-child-theme/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 02:32:38 +0000</pubDate>
		<dc:creator>Troy</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[Thematic]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://camwebdesign.com/?p=1180</guid>
		<description><![CDATA[In the interest of keeping our websites &#8220;future-proof&#8221;, I began investigating using the HTML5 DOCTYPE. As it turns out, the switch for most WordPress themes will be trivial: Change the doctype declaration to: &#60;&#33;DOCTYPE html&#62; Remove the (now defunct) profile="..." attribute from the opening &#60;head&#62; tag. Remove the unnecessary &#60;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&#62; tag. Add <a href="http://camwebdesign.com/techniques/using-html5-with-your-thematic-child-theme/" class="more-link">(more...)</a>]]></description>
			<content:encoded><![CDATA[<p>In the interest of keeping our websites &#8220;future-proof&#8221;, I began investigating using the HTML5 DOCTYPE.</p>
<p>As it turns out, the switch for most WordPress themes will be trivial: </p>
<ol>
<li>Change the doctype declaration to: <code>&lt;&#33;DOCTYPE html&gt;</code> </li>
<li>Remove the (now defunct) <code>profile="..."</code> attribute from the opening <code>&lt;head&gt;</code> tag.</li>
<li>Remove the unnecessary <code>&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;</code> tag.</li>
<li>Add the <code>&lt;meta charset="utf-8"&gt;</code> tag.</li>
</ol>
<p>Normally, this would be easily found in the <code>header.php</code> file of your theme.  In fact, the default WordPress theme (&#8216;<a href="http://2010dev.wordpress.com/">TwentyTen</a>&#8216; as of WP3) automatically uses the HTML5 doctype declaration.</p>
<p><a href="http://themeshaper.com/thematic/">Thematic</a>, however, uses the traditional &#8220;XHTML 1.0 Transitional&#8221; doctype<span id="more-1180"></span> that WordPress has used for years.  In order to use the HTML5 doctype, you will need to override four standard Thematic functions: <code>thematic_create_doctype</code>, <code>language_attributes</code>, <code>thematic_head_profile</code> and <code>thematic_create_contenttype</code> within your <a href="http://codex.wordpress.org/Child_Themes">child theme&#8217;s</a> <code>functions.php</code> file (<a href="http://camwebdesign.com/?p=1593">you are using a child theme, aren’t you?</a>), thusly:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//replace the standard doctype declaration and html tag opening...</span>
<span style="color: #000000; font-weight: bold;">function</span> html5_create_doctype<span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;!DOCTYPE html&gt;&quot;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$content</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$content</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;html&quot;</span><span style="color: #339933;">;</span>
 <span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'thematic_create_doctype'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'html5_create_doctype'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//replace the lang attribute in the opening &lt;html&gt; tag...</span>
<span style="color: #000000; font-weight: bold;">function</span> html5_language_attributes<span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;lang=<span style="color: #000099; font-weight: bold;">\&quot;</span>en<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'language_attributes'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'html5_language_attributes'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//replace the &lt;head&gt; tag opening to remove the now defunct profile attribute and add the &lt;meta charset=&quot;utf-8&quot;&gt; tag...</span>
<span style="color: #000000; font-weight: bold;">function</span> html5_head<span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;head&gt;&quot;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$content</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$content</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;meta charset=<span style="color: #000099; font-weight: bold;">\&quot;</span>utf-8<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">;</span>
 <span style="color: #000088;">$content</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
 <span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'thematic_head_profile'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'html5_head'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//remove the now defunct &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;&gt; tag...</span>
<span style="color: #000000; font-weight: bold;">function</span> html5_create_charset<span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 <span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
 <span style="color: #b1b100;">return</span> <span style="color: #000088;">$content</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'thematic_create_contenttype'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'html5_create_charset'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://camwebdesign.com/techniques/using-html5-with-your-thematic-child-theme/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress 3.0 Menu Management</title>
		<link>http://camwebdesign.com/techniques/wordpress-3-0-menu-management/</link>
		<comments>http://camwebdesign.com/techniques/wordpress-3-0-menu-management/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 08:28:02 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://camwebdesign.com/?p=1126</guid>
		<description><![CDATA[One of the best all-around additions to WordPress 3.0 is custom Menu management. So how do you implement custom menus into your WordPress site? Simply add a few lines of code in your theme&#8217;s functions.php file, then add the menus where desired in your theme. Yes, it requires adding php code to your theme&#8217;s files, <a href="http://camwebdesign.com/techniques/wordpress-3-0-menu-management/" class="more-link">(more...)</a>]]></description>
			<content:encoded><![CDATA[<p>One of the best all-around <a href="http://codex.wordpress.org/Version_3.0#Highlights">additions to WordPress 3.0</a> is <a href="http://codex.wordpress.org/Appearance_Menus_SubPanel">custom Menu management</a>.  So how do you implement custom menus into your WordPress site?  Simply add a few lines of code in your theme&#8217;s <a href="http://codex.wordpress.org/Theme_Development#Functions_File">functions.php</a> file, then add the menus where desired in your theme.  Yes, it requires adding php code to your theme&#8217;s files, but it&#8217;s simple and easy to understand.</p>
<p>First we register the ability for your theme to use custom menus using the <a href="http://codex.wordpress.org/Function_Reference/add_theme_support"><code>add_theme_support()</code></a> WordPress function.<span id="more-1126"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_theme_support<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'menus'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Next we define the custom menus.  For this example we&#8217;ll create two menus: menu-1 and menu-2, and name them &#8220;Main Navigation&#8217; and &#8216;Footer Navigation&#8217; respectively.  We accomplish this in a new function &#8216;register_site_menus&#8217;, using the <a href="http://codex.wordpress.org/Function_Reference/register_nav_menus"><code>register_nav_menus()</code></a> WordPress function.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> register_site_menus<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	register_nav_menus<span style="color: #009900;">&#40;</span>
		<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
			<span style="color: #0000ff;">'menu-1'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Main Navigation'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'menu-2'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Footer Navigation'</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>We then initiate the new <code>register_site_menus()</code> function using the <a href="http://codex.wordpress.org/Function_Reference/add_action"><code>add_actions()</code></a> WordPress function as shown below.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'init'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'register_site_menus'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Putting it all together yields the following code to be placed in your theme&#8217;s functions.php file:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_theme_support<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'menus'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> register_site_menus<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	register_nav_menus<span style="color: #009900;">&#40;</span>
		<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
			<span style="color: #0000ff;">'menu-1'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Main Navigation'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'menu-2'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Footer Navigation'</span> <span style="color: #009900;">&#41;</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;
add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'init'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'register_site_menus'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Next we add &#8216;menu-1&#8242; our &#8216;Main Navigation&#8217; menu, using the <a href="http://codex.wordpress.org/Function_Reference/wp_nav_menu"><code>wp_nav_menu()</code></a> WordPress function where we want that menu to appear in your theme (header, sidebar, etc.).  We also chose to not have a container automatically added to our menu for this example below.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">wp_nav_menu<span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> 
	<span style="color: #0000ff;">'theme_location'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'menu-1'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'container'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span>
<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>We&#8217;ll add &#8216;menu-2&#8242; our &#8216;Footer Navigation&#8217; menu, using the same function but, we also give the menu a custom CSS id of &#8216;footer-nav&#8217;.  You can read all about the <a href="http://codex.wordpress.org/Function_Reference/wp_nav_menu#Parameters">parameters of the <code>wp_nav_menu()</code> function</a> yourself rather than bore you with the details here.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">wp_nav_menu<span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'theme_location'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'menu-2'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'container'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'menu_id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'footer-nav'</span>
<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://camwebdesign.com/techniques/wordpress-3-0-menu-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Create Custom Roles and Capabilities</title>
		<link>http://camwebdesign.com/techniques/wordpress-create-custom-roles-and-capabilities/</link>
		<comments>http://camwebdesign.com/techniques/wordpress-create-custom-roles-and-capabilities/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 01:17:08 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://camwebdesign.com/?p=1166</guid>
		<description><![CDATA[So you want to add a custom Role to your WordPress site to add more flexibility when assigning users their role, what do you do? Simply add a role, with a few lines of code in your theme&#8217;s functions.php file, using WordPress&#8217; add_role() function, as defined below. 1 add_role&#40; $role_name, $display_name, $capabilities &#41;; The example <a href="http://camwebdesign.com/techniques/wordpress-create-custom-roles-and-capabilities/" class="more-link">(more...)</a>]]></description>
			<content:encoded><![CDATA[<p>So you want to add a custom <a href="http://codex.wordpress.org/Roles_and_Capabilities">Role</a> to your WordPress site to add more flexibility when assigning users their role, what do you do? Simply add a role, with a few lines of code in your theme&#8217;s <a href="http://codex.wordpress.org/Theme_Development#Functions_File">functions.php</a> file, using WordPress&#8217; <a href="http://codex.wordpress.org/Function_Reference/add_role"><code>add_role()</code></a> function, as defined below.<span id="more-1166"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_role<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$role_name</span><span style="color: #339933;">,</span> <span style="color: #000088;">$display_name</span><span style="color: #339933;">,</span> <span style="color: #000088;">$capabilities</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>The example below adds a role of Video Manager with a custom cabability of &#8216;manage videos&#8217;.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_role<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'video_manager, '</span>Video Manager<span style="color: #0000ff;">', array( '</span>manage_videos<span style="color: #0000ff;">' ) );</span></pre></td></tr></table></div>

<h3>NOTE: Once you add this code to your functions.php file and view any page on your site to make the role addition, you can and should comment it out so that it doesn&#8217;t run on every page view.</h3>
<p>Now, how do we use this new role with the new capability you ask?  Simply use the WordPress <code>current_user_can()</code> function to check the user&#8217;s capability.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> current_user_can<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'manage_videos'</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;">// let them manage those videos!</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>This technique can be combined with our <a href="http://camwebdesign.com/techniques/wordpress-role-capability-restriction/">WordPress Role Capability Restriction technique</a> to add even more capabilities to your new custom role.  Simply create your new role then use it in the <code>get_role()</code> function call detailed in our technique.</p>
]]></content:encoded>
			<wfw:commentRss>http://camwebdesign.com/techniques/wordpress-create-custom-roles-and-capabilities/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>WordPress Role Capability Restriction</title>
		<link>http://camwebdesign.com/techniques/wordpress-role-capability-restriction/</link>
		<comments>http://camwebdesign.com/techniques/wordpress-role-capability-restriction/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 06:59:23 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://camwebdesign.com/?p=1089</guid>
		<description><![CDATA[So you want to restrict user capabilities of a role on your WordPress site from editing and deleting other user&#8217;s pages and posts, but you can&#8217;t seem to find an easy-to-use plugin that meets your needs, what do you do? Simply restrict that role, with a few lines of code in your theme&#8217;s functions.php file, <a href="http://camwebdesign.com/techniques/wordpress-role-capability-restriction/" class="more-link">(more...)</a>]]></description>
			<content:encoded><![CDATA[<p>So you want to restrict user <a href="http://codex.wordpress.org/Roles_and_Capabilities">capabilities of a role</a> on your WordPress site from editing and deleting other user&#8217;s pages and posts, but you can&#8217;t seem to find an easy-to-use plugin that meets your needs, what do you do?  Simply restrict that role, with a few lines of code in your theme&#8217;s <a href="http://codex.wordpress.org/Theme_Development#Functions_File">functions.php</a> file, using WordPress&#8217; <code>get_role()</code> and <code>remove_cap()</code> functions.  The example below is how to restrict the <a href="http://codex.wordpress.org/Roles_and_Capabilities#Author">author role</a>.<span id="more-1089"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$role</span> <span style="color: #339933;">=</span> get_role<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'author'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$role</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">remove_cap</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'edit_others_pages'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$role</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">remove_cap</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'edit_others_posts'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$role</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">remove_cap</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'delete_others_pages'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$role</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">remove_cap</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'delete_others_posts'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Pretty simple huh?  That&#8217;s what I thought when I learned how easily this can be accomplished.</p>
<p>So what&#8217;s actually going on with the code?  First, we create a variable $role populated with the author&#8217;s capabilities.  Then we remove the ability of the authors to &#8216;edit_others_pages&#8217;, and <a href="http://codex.wordpress.org/Roles_and_Capabilities#Capabilities">other capabilities</a> as desired.  This code performs a database change to the role.</p>
<h3>NOTE: Once you add this code to your functions.php file and view any page on your site to make the capability changes, you can and should comment it out so that it doesn&#8217;t run on every page view.</h3>
<p>How do you reverse this you may ask?  Simple, use WordPress&#8217; <code>add_cap()</code> function, as if WordPress would let us down.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$role</span> <span style="color: #339933;">=</span> get_role<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'author'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$role</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">add_cap</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'edit_others_pages'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$role</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">add_cap</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'edit_others_posts'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$role</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">add_cap</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'delete_others_pages'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$role</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">add_cap</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'delete_others_posts'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>This works great when you&#8217;ve <a href="http://camwebdesign.com/techniques/wordpress-create-custom-role-and-capabilities/">Created Custom Roles</a> and need to assign capabilities to those new roles.</p>
<p>Below is real-world code we&#8217;ve used on a site, and how we left it commented for future reference.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/* Begin Editor Restriction  ****************/</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/* Enable Restriction Below */</span>
<span style="color: #666666; font-style: italic;">//$role = get_role('editor');</span>
<span style="color: #666666; font-style: italic;">//$role-&gt;remove_cap('edit_others_pages');</span>
<span style="color: #666666; font-style: italic;">//$role-&gt;remove_cap('edit_others_posts');</span>
<span style="color: #666666; font-style: italic;">//$role-&gt;remove_cap('delete_others_pages');</span>
<span style="color: #666666; font-style: italic;">//$role-&gt;remove_cap('delete_others_posts');</span>
<span style="color: #666666; font-style: italic;">//$role-&gt;remove_cap('manage_links');</span>
<span style="color: #666666; font-style: italic;">//$role-&gt;remove_cap('moderate_comments');</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/* Disable Restriction Below */</span>
<span style="color: #666666; font-style: italic;">//$role = get_role('editor');</span>
<span style="color: #666666; font-style: italic;">//$role-&gt;add_cap('edit_others_pages');</span>
<span style="color: #666666; font-style: italic;">//$role-&gt;add_cap('edit_others_posts');</span>
<span style="color: #666666; font-style: italic;">//$role-&gt;add_cap('delete_others_pages');</span>
<span style="color: #666666; font-style: italic;">//$role-&gt;add_cap('delete_others_posts');</span>
<span style="color: #666666; font-style: italic;">//$role-&gt;add_cap('manage_links');</span>
<span style="color: #666666; font-style: italic;">//$role-&gt;add_cap('moderate_comments');</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/* End Editor Restriction  ***************/</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://camwebdesign.com/techniques/wordpress-role-capability-restriction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What WordPress plugins do we use?</title>
		<link>http://camwebdesign.com/techniques/what-wordpress-plugins-do-we-use/</link>
		<comments>http://camwebdesign.com/techniques/what-wordpress-plugins-do-we-use/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 21:49:26 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Techniques]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://camwebdesign.com/?p=413</guid>
		<description><![CDATA[A list of the WordPress plugins we recommend and use. Akismet &#8211; SPAM control, this plugin is the ultimate in controlling unwanted spam in your posts and pages. Akismet checks your comments against the Akismet web service to see if they look like spam or not. You need a WordPress.com API key to use it. <a href="http://camwebdesign.com/techniques/what-wordpress-plugins-do-we-use/" class="more-link">(more...)</a>]]></description>
			<content:encoded><![CDATA[<h3>A list of the WordPress plugins we recommend and use.<span id="more-413"></span></h3>
<ol>
<li><strong>Akismet</strong> &#8211; SPAM control, this plugin is the ultimate in controlling unwanted spam in your posts and pages.<br />
<blockquote><p>Akismet checks your comments against the Akismet web service to see if they look like spam or not. You need a WordPress.com API key to use it. You can review the spam it catches under &#8220;Comments.&#8221; To show off your Akismet stats just put  in your template.</p></blockquote>
<ul>
<li>By <a href="http://ma.tt/">Matt Mullenweg</a> | <a href="http://akismet.com/">Visit plugin site</a></li>
</ul>
</li>
<li><strong>All in One SEO Pack</strong> &#8211; Provides full SEO customization for your posts and pages, including title tags, descriptions, meta tags, etc.<br />
<blockquote><p>Out-of-the-box SEO for your WordPress blog.</p></blockquote>
<ul>
<li>By <a title="Visit author homepage" href="http://michaeltorbert.com">Michael Torbert</a> | <a title="Visit plugin site" href="http://semperfiwebdesign.com">Visit plugin site</a></li>
</ul>
</li>
<li><strong>Contact Form 7</strong> &#8211; The author reports that this is just another contact form plugin, <em>understatement if ever there was one</em>.  This provides the easiest form creation and management we&#8217;ve ever used on any platform.<br />
<blockquote><p>Just another contact form plugin. Simple but flexible.</p></blockquote>
<ul>
<li>By <a title="Visit author homepage" href="http://ideasilo.wordpress.com/">Takayuki Miyoshi</a> | <a title="Visit plugin site" href="http://contactform7.com/">Visit plugin site</a></li>
</ul>
</li>
<li><strong>Custom Field Template</strong> &#8211; This extends the functionality of the already easy to use WordPress Custom Fields for pages and posts.<br />
<blockquote><p>This plugin adds the default custom fields on the Write Post/Page.</p></blockquote>
<ul>
<li>By <a title="Visit author homepage" href="http://wpgogo.com/">Hiroaki Miyashita</a> | <a title="Visit plugin site" href="http://wpgogo.com/development/custom-field-template.html">Visit plugin site</a></li>
</ul>
</li>
<li><strong>Google Analyticator</strong> &#8211; Allows for easy installation of Google&#8217;s Analytics code into your blog, including smart control so you don&#8217;t track admin activity etc.<br />
<blockquote><p>Adds the necessary JavaScript code to enable Google&#8217;s Analytics. After enabling this plugin visit the settings page and enter your Google Analytics&#8217; UID and enable logging.</p></blockquote>
<ul>
<li>By <a title="Visit author homepage" href="http://ronaldheft.com/">Ronald Heft</a> | <a title="Visit plugin site" href="http://ronaldheft.com/code/analyticator/">Visit plugin site</a></li>
</ul>
</li>
<li><strong>Google XML Sitemaps</strong> &#8211; Provides easy to maintain and control XML sitemaps for your blog / website, a must have for SEO and search engine ranking.<br />
<blockquote><p>This plugin will generate a special XML sitemap which will help search engines like Google, Yahoo, Bing and Ask.com to better index your blog.</p></blockquote>
<ul>
<li>By <a title="Visit author homepage" href="http://www.arnebrachhold.de/">Arne Brachhold</a> | <a title="Visit plugin site" href="http://www.arnebrachhold.de/redir/sitemap-home/">Visit plugin site</a></li>
</ul>
</li>
<li><strong>Most Popular Posts</strong> &#8211; This is great for boosting interest in your content, especially what&#8217;s popular.<br />
<blockquote><p>Display a link to the most popular posts on your blog according to the number of comments.</p></blockquote>
<ul>
<li>By <a title="Visit author homepage" href="http://www.wesg.ca">Wes Goodhoofd</a> | <a title="Visit plugin site" href="http://www.wesg.ca/2008/08/wordpress-widget-most-popular/">Visit plugin site</a></li>
</ul>
</li>
<li><strong>Similar Posts</strong> &#8211; Provides a configurable list of smartly chosen posts and/or pages to the bottom of your post to generate more interest in your content.<br />
<blockquote><p>Displays a highly configurable list of related posts. Similarity can be based on any combination of word usage in the content, title, or tags. Don&#8217;t be disturbed if it takes a few moments to complete the installation &#8212; the plugin is indexing your posts. Instructions and help online. Requires the latest version of the Post-Plugin Library to be installed.</p></blockquote>
<ul>
<li>By <a href="http://rmarsh.com/" title="Visit author homepage">Rob Marsh, SJ</a> | <a href="http://rmarsh.com/plugins/similar-posts/" title="Visit plugin site">Visit plugin site</a></li>
</ul>
</li>
<li><strong>WordPress Database Backup</strong> &#8211; Creates backups of your WordPress blog or website, what would you do if your server crashed!?<br />
<blockquote><p>On-demand backup of your WordPress database.</p></blockquote>
<ul>
<li>By <a title="Visit author homepage" href="http://www.ilfilosofo.com/">Austin Matzko</a> | <a title="Visit plugin site" href="http://www.ilfilosofo.com/blog/wp-db-backup">Visit plugin site</a></li>
</ul>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://camwebdesign.com/techniques/what-wordpress-plugins-do-we-use/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

