<?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>sammela.com &#187; WordPress</title>
	<atom:link href="http://sammela.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://sammela.com</link>
	<description>Stunning web design articles</description>
	<lastBuildDate>Tue, 17 Nov 2009 04:43:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A Meta Tag to give Hints to AdSense</title>
		<link>http://sammela.com/2009/11/14/a-meta-tag-to-give-hints-to-adsense/</link>
		<comments>http://sammela.com/2009/11/14/a-meta-tag-to-give-hints-to-adsense/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 18:41:48 +0000</pubDate>
		<dc:creator>Sam Mela</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://sammela.com/?p=467</guid>
		<description><![CDATA[Here is a feature I would like to see incorporated into both WordPress and AdSense.  If it already exists in some other form, I would like to know.
Basically, I would like to see a Meta Tag that tells AdSense (or other ad programs) ad categories it should not use, on a per page basis.
I&#8217;m thinking [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a feature I would like to see incorporated into both WordPress and AdSense.  If it already exists in some other form, I would like to know.</p>
<p>Basically, I would like to see a Meta Tag that tells AdSense (or other ad programs) ad categories it should not use, on a per page basis.</p>
<p>I&#8217;m thinking in terms of WordPress type articles where, in a particular article, you want to give AdSense a &#8220;hint&#8221; that your article is attacking something.</p>
<p>For example, the way things work now, if someone writes a blog article attacking AARP, then AdSense mistakenly plasters AARP ads onto your page.</p>
<p>I recognize that you can limit the scope of ads in AdSense, from the user Dashboard, but that is not what I am talking about at all.  I am talking about the scenario where AdSense evaluates the content of an individual blog post (for example), and grabs content related to that post.</p>
<p>Maybe something like this:</p>
<p>&lt;meta name=&#8221;NOAD&#8221; content=&#8221;aarp,othertopic,othertopic1&#8243; /&gt;</p>
<p>&lt;h3&gt;Add an Input Box to the WordPress Editor&lt;/h3&gt;</p>
<p>Finally, to complete this concept, upgrade the WordPres editor with one or more &#8220;Ad Hints&#8221; type boxes, to control the content of any Meta Tags tageted at dynamic ad selection.</p>
<p>© 2009, Sam Mela. All rights reserved.</p>
]]></content:encoded>
			<wfw:commentRss>http://sammela.com/2009/11/14/a-meta-tag-to-give-hints-to-adsense/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add Backtrace to the WiPeD WordPress Debugger</title>
		<link>http://sammela.com/2009/10/07/add-backtrace-to-the-wiped-wordpress-debugger/</link>
		<comments>http://sammela.com/2009/10/07/add-backtrace-to-the-wiped-wordpress-debugger/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 01:53:07 +0000</pubDate>
		<dc:creator>Sam Mela</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[article]]></category>

		<guid isPermaLink="false">http://sammela.com/?p=265</guid>
		<description><![CDATA[In a previous article (WiPeD: A Useful WordPress Debugger Plugin), I discussed the WiPeD WordPress Debugger, written by Sterling Camden, which you can read more about on the Chiptips Blog.
I&#8217;ve been educating myself about the structure of WordPress, and recently I found it useful to add some backtrace capability to WiPeD.
What is Backtrace?
Backtrace is the [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous article (<a title="WiPeD: A Useful WordPress Debugger" href="/2009/10/06/wiped-a-useful-wordpress-debugger-plugin/" target="_blank">WiPeD: A Useful WordPress Debugger Plugin</a>), I discussed the WiPeD WordPress Debugger, written by Sterling Camden, which you can read more about on the <a href="http://www.chipstips.com/?p=172">Chiptips Blog</a>.</p>
<p>I&#8217;ve been educating myself about the structure of WordPress, and recently I found it useful to add some backtrace capability to WiPeD.</p>
<h3>What is Backtrace?</h3>
<p>Backtrace is the PHP capability to create an array containing a list of the hierarchical function calls that led to a particular point of execution.</p>
<p>Actually the PHP <strong>debug_backtrace</strong> function produces an array of arrays. For each function in the call hierarchy, it makes available the line number, file name, and function name. But the format isn&#8217;t very use friendly for this application, so the bulk of my backtrace addition is devoted to producing a nice format that fits into the output scheme of the WiPeD debugger.</p>
<h3>How Backtrace Affects WiPeD</h3>
<ol>
<li><strong>Logging</strong> &#8212; the WPD_backtrace is used to perform a backtrace at any point in your code.  Just add a WPD_backtrace(); function call where you want the backtrace data logged.  As a coder/debugger, this is the only modification to your code you will need to make, in order to use this feature.</li>
<li><strong>Output</strong> &#8212; the WiPeD output now includes the results of the logged backtrace calls.</li>
</ol>
<h3>Example of Use</h3>
<p>Here&#8217;s an example of the <strong>WPD_backtrace()</strong> function used in the <strong>main </strong>method of the <strong>WP </strong>object in the <strong>classes.php</strong> file of WordPress.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">function</span> main<span style="color: #009900;">&#40;</span><span style="color: #000088;">$query_args</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; WPD_backtrace<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//ssmela &nbsp; &nbsp; &nbsp; </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">parse_request</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query_args</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">send_headers</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query_posts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">handle_404</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">register_globals</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; do_action_ref_array<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp'</span><span style="color: #339933;">,</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$this</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<h3>File and Code Modifications</h3>
<h5>CSS</h5>
<p>I added a css style file &#8212; wiped.css.  You can change the css in this file to control how the backtrace output looks.</p>
<p>The <strong>WPD_backtrace</strong> class defines the style of the backtrace output data.</p>
<p>The <strong>WPD_tracepoint</strong> class is a specialized class to define the style of the output data at the tracepoint.</p>
<p>You can also modify css tags used by the original author (WPD_output, WPD_message, WPD_text, WPD_element, and WPD_array).</p>
<h5>Additions to WiPeD.php</h5>
<p>Additions to WiPeD.php are marked as &#8220;ssmela addition 1&#8243;, &#8220;ssmela addition 2&#8243;,  and &#8220;ssmela addition 3&#8243;; and they are listed below, along with brief explanations.  Basically, my additions build on the existing general WiPeD logging and display capability, but they add a more specialized backtrace display capability.</p>
<ol>
<li>ssmela addition 1 &#8211;  Sets up to include the wiped.css file</li>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">// Start ssmela addition 1</span><br />
<span style="color: #666666; font-style: italic;">// Set up to include the wiped.css file</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/defined"><span style="color: #990000;">defined</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;WP_CONTENT_URL&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;WP_CONTENT_URL&quot;</span><span style="color: #339933;">,</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;siteurl&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;/wp-content&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/defined"><span style="color: #990000;">defined</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;WP_PLUGIN_URL&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> &nbsp;<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;WP_PLUGIN_URL&quot;</span><span style="color: #339933;">,</span> &nbsp;WP_CONTENT_URL &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;/plugins&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">function</span> wiped_head<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000088;">$css_url</span> <span style="color: #339933;">=</span> WP_PLUGIN_URL <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;/wiped/wiped.css&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/file_exists"><span style="color: #990000;">file_exists</span></a><span style="color: #009900;">&#40;</span>TEMPLATEPATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;/wiped.css&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$css_url</span> <span style="color: #339933;">=</span> get_bloginfo<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;template_url&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;/wiped.css&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #b1b100;">echo</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: #0000ff;">'&lt;link rel=&quot;stylesheet&quot; href=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$css_url</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;'</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><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #666666; font-style: italic;">// End ssmela Addition 1</span></div></td></tr></tbody></table></div>
<li>ssmela addition 2 &#8211;  Call the function that includes additional css file, wiped.css</li>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Start ssmela addition 2</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Call the function that includes wiped.css</span><br />
&nbsp; &nbsp; add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wiped_head'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// End ssmela addition 2</span></div></td></tr></tbody></table></div>
<li>ssmela addition 3 &#8211;  Function to add trace data to the WiPeD log</li>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">// Start ssmela addition 3</span><br />
<span style="color: #666666; font-style: italic;">// Function to add trace data to the WiPeD log</span><br />
<span style="color: #000000; font-weight: bold;">function</span> WPD_backtrace<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$trace_array</span> &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #339933;">=</span> <a href="http://www.php.net/debug_backtrace"><span style="color: #990000;">debug_backtrace</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$trace_array_count</span>&nbsp; <span style="color: #339933;">=</span> <a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$trace_array</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000088;">$callee_line</span> &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$callee_file</span> &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$callee_function</span>&nbsp; &nbsp; <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$caller_line</span> &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$caller_file</span> &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$trace_array_count</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$trace_element</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$trace_array</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$callee_line</span> &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #339933;">=</span> <span style="color: #000088;">$caller_line</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$callee_file</span> &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #339933;">=</span> <span style="color: #000088;">$caller_file</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$callee_function</span>&nbsp; &nbsp; <span style="color: #339933;">=</span> <span style="color: #000088;">$trace_element</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;function&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$caller_line</span> &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #339933;">=</span> <span style="color: #000088;">$trace_element</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;line&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$caller_file</span> &nbsp; &nbsp;&nbsp; &nbsp; <span style="color: #339933;">=</span> <span style="color: #000088;">$trace_element</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;file&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$call_list</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">&quot;&amp;nbsp;&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">&quot;Caller file: <span style="color: #006699; font-weight: bold;">$caller_file</span>&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">&quot;Caller line: <span style="color: #006699; font-weight: bold;">$caller_line</span>&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">&quot;Callee file: <span style="color: #006699; font-weight: bold;">$callee_file</span>&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">&quot;Callee line: <span style="color: #006699; font-weight: bold;">$callee_line</span>&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">&quot;Callee function: <span style="color: #006699; font-weight: bold;">$callee_function</span>&quot;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">&quot;&amp;nbsp;&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000088;">$call_list</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">=</span> <a href="http://www.php.net/array_reverse"><span style="color: #990000;">array_reverse</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$call_list</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$call_list_count</span>&nbsp; &nbsp; <span style="color: #339933;">=</span> <a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$call_list</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; WPD_print<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>WPD_backtrace<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;code&gt;+++++++++++++++++++++++++++&lt;/code&gt;&lt;/p&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; WPD_print<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>WPD_backtrace<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;code&gt;|||||||||||||||||||||||||||&lt;/code&gt;&lt;/p&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$call_list_count</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span> &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$call_list_element</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$call_list</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$call_list_element</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$call_list_element_string</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">!=</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$call_list_count</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WPD_print<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>WPD_backtrace<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$call_list_element_string</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/p&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WPD_print<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>WPD_tracepoint<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$call_list_element_string</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/p&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; WPD_print<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>WPD_backtrace<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;code&gt;|||||||||||||||||||||||||||&lt;/code&gt;&lt;/p&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; WPD_print<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;p class=<span style="color: #000099; font-weight: bold;">\&quot;</span>WPD_backtrace<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;code&gt;+++++++++++++++++++++++++++&lt;/code&gt;&lt;/p&gt;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #666666; font-style: italic;">// End ssmela addition 3</span></div></td></tr></tbody></table></div>
</ol>
<h3>Output</h3>
<p>The output looks like the following.  Towards the bottom of the output listing, note the red text color, which denotes the point in the code where the trace is actually called.  The entries above the red are preceding code points in the call tree.  The entries below the red is the actual trace code function, and could be removed in the future.  </p>
<ol>
<div style="height:300px; max-width:450px; background-color:#ececec; padding:10px; border:1px black solid; overflow:scroll">
<p style="margin-top: 0px; margin-bottom: 0px; font-family:Courier, monospace;">+++++++++++++++++++++++++++</p>
<p style="margin-top: 0px; margin-bottom: 0px;  font-family:Courier, monospace;">|||||||||||||||||||||||||||</p>
<p style="margin-top: 0px; margin-bottom: 0px;">&nbsp;</p>
<p style="margin-top: 0px; margin-bottom: 0px;">Caller file: /home/sammela/public_html/index.php</p>
<p style="margin-top: 0px; margin-bottom: 0px;">Caller line: 17</p>
<p style="margin-top: 0px; margin-bottom: 0px;">Callee file:   /home/sammela/public_html/wp-blog-header.php</p>
<p style="margin-top: 0px; margin-bottom: 0px;">Callee line: 16</p>
<p style="margin-top: 0px; margin-bottom: 0px;">Callee function: require</p>
<p style="margin-top: 0px; margin-bottom: 0px;">&nbsp;</p>
<p style="margin-top: 0px; margin-bottom: 0px;">&nbsp;</p>
<p style="margin-top: 0px; margin-bottom: 0px;">Caller file:   /home/sammela/public_html/wp-blog-header.php</p>
<p style="margin-top: 0px; margin-bottom: 0px;">Caller line: 16</p>
<p style="margin-top: 0px; margin-bottom: 0px;">Callee file:   /home/sammela/public_html/wp-includes/template-loader.php</p>
<p style="margin-top: 0px; margin-bottom: 0px;">Callee line: 37</p>
<p style="margin-top: 0px; margin-bottom: 0px;">Callee function: require_once</p>
<p style="margin-top: 0px; margin-bottom: 0px;">&nbsp;</p>
<p style="margin-top: 0px;margin-bottom: 0px;font-weight: bold;color: #FF0000;">&nbsp;</p>
<p style="margin-top: 0px;margin-bottom: 0px;font-weight: bold;color: #FF0000;">Caller file:   /home/sammela/public_html/wp-includes/template-loader.php</p>
<p style="margin-top: 0px;margin-bottom: 0px;font-weight: bold;color: #FF0000;">Caller line: 37</p>
<p style="margin-top: 0px;margin-bottom: 0px;font-weight: bold;color: #FF0000;">Callee file:   /home/sammela/public_html/wp-content/themes/Sam-Cutline-1-1.4-2ColumnRight/sandbox.php</p>
<p style="margin-top: 0px;margin-bottom: 0px;font-weight: bold;color: #FF0000;">Callee line: 23</p>
<p style="margin-top: 0px;margin-bottom: 0px;font-weight: bold;color: #FF0000;">Callee function: include</p>
<p style="margin-top: 0px;margin-bottom: 0px;font-weight: bold;color: #FF0000;">&nbsp;</p>
<p style="margin-top: 0px; margin-bottom: 0px;">&nbsp;</p>
<p style="margin-top: 0px; margin-bottom: 0px;">Caller file:   /home/sammela/public_html/wp-content/themes/Sam-Cutline-1-1.4-2ColumnRight/sandbox.php</p>
<p style="margin-top: 0px; margin-bottom: 0px;">Caller line: 23</p>
<p style="margin-top: 0px; margin-bottom: 0px;">Callee file: </p>
<p style="margin-top: 0px; margin-bottom: 0px;">Callee line: </p>
<p style="margin-top: 0px; margin-bottom: 0px;">Callee function: ssm_show_trace</p>
<p style="margin-top: 0px; margin-bottom: 0px;">&nbsp;</p>
<p style="margin-top: 0px; margin-bottom: 0px;  font-family:Courier, monospace;">|||||||||||||||||||||||||||</p>
<p style="margin-top: 0px; margin-bottom: 0px;  font-family:Courier, monospace;">+++++++++++++++++++++++++++</p>
</div>
</ol>
<h3>Download WiPeD with BackTrace</h3>
<p>Download a copy of WiPeD with BackTrace <a class="wpGallery" title="WiPeD Download" href="http://www.sammela.com/downloads/wiped.zip">here</a>.  </p>
<p>As stated previously, the original author of this excellent plugin is Sterling Camden.  His company is <a href="http://camdensoftware.com/" target="_blank">Camden Software Consulting</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sammela.com/2009/10/07/add-backtrace-to-the-wiped-wordpress-debugger/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WiPeD: A Useful WordPress Debugger Plugin</title>
		<link>http://sammela.com/2009/10/06/wiped-a-useful-wordpress-debugger-plugin/</link>
		<comments>http://sammela.com/2009/10/06/wiped-a-useful-wordpress-debugger-plugin/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 22:37:50 +0000</pubDate>
		<dc:creator>Sam Mela</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[article]]></category>

		<guid isPermaLink="false">http://sammela.com/?p=243</guid>
		<description><![CDATA[I like the WiPeD (WordPress Printf Debugging) Plugin for four reasons:

It does what I want
It is easy to install
It is easy to use
It is easy to customize

As a bonus, I should say, I talked to the author (Sterling &#8220;Chip&#8221; Camden)  on the phone today, and he&#8217;s very helpful.
Problems with echo
PHP programmers typically use the echo keyword [...]]]></description>
			<content:encoded><![CDATA[<p>I like the WiPeD (WordPress Printf Debugging) Plugin for four reasons:</p>
<ol>
<li>It does what I want</li>
<li>It is easy to install</li>
<li>It is easy to use</li>
<li>It is easy to customize</li>
</ol>
<p>As a bonus, I should say, I talked to the author (Sterling &#8220;Chip&#8221; Camden)  on the phone today, and he&#8217;s very helpful.</p>
<h3>Problems with echo</h3>
<p>PHP programmers typically use the <strong>echo</strong> keyword to output debugging information.</p>
<p>But there are some annoyances  with this approach.</p>
<ol>
<li>Echo output that precedes headers can cause PHP errors.</li>
<li>Echo statements are difficult to turn on and off.</li>
<li>It can be difficult to locate diagnostic echo statements when they are sprinkled throughout code.</li>
</ol>
<h3>WiPeD to the Rescue</h3>
<p>WiPeD solves the problems listed above by queing diagnostic outputs.  The diagnostic data is then dumped all at one, at a location chosen by the programmer.</p>
<p>Once the plugin is installed, it is a simple matter to write debug information to the queue.  Here&#8217;s an example:</p>
<div class="codecolorer-container xml default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:75px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">// Queue a message<br />
WPD_print(&quot;This is a test of the WiPeD WPD_print function&quot;);</div></td></tr></tbody></table></div>
<h3>Output</h3>
<p>Typically you don&#8217;t have to worry about output.  In the default install configuration, WiPeD outputs the queued diagnostic data on the <strong>get_footer </strong>and <strong>admin_footer</strong> actions, which means it winds up at the bottom of your page.  Note, however, you can set it to display on any actions you want (see &#8220;Options&#8221; below).</p>
<h3>Options</h3>
<p>When WiPeD is installed, it adds a &#8220;WiPeD&#8221; options menu item to the bottom of the Admin &#8220;Settings&#8221; menu.  In the otpions menu you can set the following:</p>
<ul>
<li>User capability level required to record debug info</li>
<li>User capability level required to display debug info</li>
<li>Actions that trigger display of debug info</li>
<li>Clear debug log when displayed (check yes/no)</li>
<li>Clear debug log now (check yes/no)</li>
</ul>
<h3>Summary</h3>
<p>WiPeD is a handy expanable debug support Plugin that does just what it should. </p>
<p>Want it?  Visit the WiPeD links below:</p>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top" style="padding-right:15px">&nbsp;</td>
<td align="left" valign="top" style="padding-right:15px">Author:</td>
<td align="left" valign="top"> <a href="http://chipsquips.com" title="Visit author homepage" target="_blank"  >Sterling &#8220;Chip&#8221; Camden</a></td>
</tr>
<tr>
<td align="left" valign="top"  style="padding-right:15px">&nbsp;</td>
<td align="left" valign="top" style="padding-right:15px">Visit:</td>
<td align="left" valign="top"><a href="http://chipstips.com/?tag=phpwpd" title="Visit plugin site" target="_blank"  >plugin site</a> </td>
</tr>
</table>
<p>&nbsp;</p>
<h3>Related Article</h3>
<p><a href="2009/10/07/add-backtrace-to-the-wiped-wordpress-debugger/" target="_blank">Add backtrace to the WiPeD Debugger.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sammela.com/2009/10/06/wiped-a-useful-wordpress-debugger-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make a WordPress Template Sandbox</title>
		<link>http://sammela.com/2009/09/30/make-a-wordpress-template-sandbox/</link>
		<comments>http://sammela.com/2009/09/30/make-a-wordpress-template-sandbox/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 04:31:52 +0000</pubDate>
		<dc:creator>Sam Mela</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[article]]></category>

		<guid isPermaLink="false">http://sammela.com/?p=222</guid>
		<description><![CDATA[Are you learning how do make code modifications in WordPress?
Sometimes you just want to experiment. 
But it is messy and risky to make changes in the standard template pages such as index.php, page.php, archive.php, etc. So the best thing to do is make yourself a code sandbox.
A sandbox template should pull in all the infrastructure [...]]]></description>
			<content:encoded><![CDATA[<p>Are you learning how do make code modifications in WordPress?</p>
<p>Sometimes you just want to experiment. </p>
<p>But it is messy and risky to make changes in the standard template pages such as index.php, page.php, archive.php, etc. So the best thing to do is make yourself a code sandbox.</p>
<p>A sandbox template should pull in all the infrastructure you need but allow you to write custom code and try things out. In WordPress, a custom template fulfills these requirements.  This article tells you how to build one.</p>
<p>First, if you are not familiar with the directory structure of themes in WordPress, read my article titled <a href="2009/09/29/the-wordpress-theme-directory-structure/">The Theme Directory Structure</a>.</p>
<h3>Build Your Sandbox</h3>
<p>Armed with knowledge from my Theme directory structure article, go to the directory of your favorite  theme and copy the <strong>index.php</strong> file to a file called <strong>sandbox.php</strong>.</p>
<p>Add the following line to the top of the <strong>sandbox.php</strong> file.</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<span style="color: #666666; font-style: italic;">/*<br />
Template Name: SandBox<br />
*/</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<p>That&#8217;s it.  You have created the basic sandbox.</p>
<p>If you are working locally on a PC or MAC, upload <strong>sandbox.php</strong> to your site.</p>
<h3>Using Your Sandbox Template</h3>
<p>To use your sandbox template, you can either create a new WordPress page or modify and old one.  I suggest creating a new one for starters. Let&#8217;s make a page called &#8220;sb&#8221;.</p>
<p>Now, if you want to view the results of your experimental changes to <strong>sandbox.php</strong>, you can just view your new page.</p>
<p>Now you can start making changes in your <strong>sandbox.php</strong> page.  </p>
<p>At the bottom of my <strong>sandbox.php</strong> page is the code that displays the sidebar, shown below:</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span> get_sidebar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<p>What happens if you add a put some html code just above the get_sidebar function?</p>
<p>Now our code looks like the following?</p>
<div class="codecolorer-container php default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;<br />
&nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &lt;td&gt;This is a table&lt;/td&gt;<br />
&nbsp; &nbsp; &lt;td&gt;above the right sidebar&lt;/td&gt;<br />
&nbsp; &lt;/tr&gt;<br />
&nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &lt;td&gt;This is row 2&lt;/td&gt;<br />
&nbsp; &nbsp; &lt;td&gt;of the table&lt;/td&gt;<br />
&nbsp; &lt;/tr&gt;<br />
&lt;/table&gt;<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_sidebar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<p>When you view the &#8220;sb&#8221; page, you should see a little table up above the sidebar.  Basically, you can try out any idea you want on the sandbox page and it won&#8217;t affect your main blog pages.</p>
<table>
<tr>
<td align="left" valign="top" style="padding-right:10px"><strong>TIP: </strong></td>
<td align="left" valign="top"><em>When you create a test page based on the sandbox template, make it &#8220;private&#8221;, so visitors to your blog won&#8217;t see it in the menu.</em>
<td>
</tr>
</table>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://sammela.com/2009/09/30/make-a-wordpress-template-sandbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Wordpress Theme Directory Structure</title>
		<link>http://sammela.com/2009/09/29/the-wordpress-theme-directory-structure/</link>
		<comments>http://sammela.com/2009/09/29/the-wordpress-theme-directory-structure/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 22:25:09 +0000</pubDate>
		<dc:creator>Sam Mela</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[article]]></category>

		<guid isPermaLink="false">http://sammela.com/?p=200</guid>
		<description><![CDATA[Wordpress uses a standard directory structure for storing themes.
Starting from your wordpress installation home directtor, all themes are stored in /wp-content/themes.
Each theme is stored in it&#8217;s own directory. The two themes that come with a standard WordPress installation are &#8220;WordPress Classic&#8221; and &#8220;WordPress Default&#8221;.  Their folders are located relative to the WordPress home directory as [...]]]></description>
			<content:encoded><![CDATA[<p>Wordpress uses a standard directory structure for storing themes.</p>
<p>Starting from your wordpress installation home directtor, all themes are stored in <strong>/wp-content/themes</strong>.</p>
<p>Each theme is stored in it&#8217;s own directory. The two themes that come with a standard WordPress installation are &#8220;WordPress Classic&#8221; and &#8220;WordPress Default&#8221;.  Their folders are located relative to the WordPress home directory as follows:</p>
<table border="0" cellspacing="0" cellpadding="2" style=" border: solid 1px #333333">
<tbody>
<tr style="border-bottom: solid 1px #333333">
<td style="padding-right:20x;border-bottom: solid 1px #333333;"><strong> Theme</strong></td>
<td style="border-bottom: solid 1px #333333;"><strong>Location</strong></td>
</tr>
<tr>
<td style="padding-right:20px;    ">WordPress Default</td>
<td>wp-content/themes/default</td>
</tr>
<tr>
<td style="padding-right:20x;">WordPress Classic</td>
<td>wp-content/themes/classic</td>
</tr>
</tbody>
</table>
<h3>Contents of the Theme Directory</h3>
<p>Within the Theme directory, minimally there will be the following files:</p>
<ul>
<li>index.php</li>
<li>header.php</li>
<li>sidebar.php</li>
<li>footer.php</li>
<li>functions.php</li>
<li>style.css</li>
</ul>
<p> Typically, there will be more.    Often there is an <strong>images</strong> sub-directory.</p>
<h3>How to Find Your Theme Directory</h3>
<ol>
<li>In the Site Admin Console, click on &#8220;Appearance&#8221; then &#8220;Themes&#8221;.</li>
<li>The &#8220;Current Theme&#8221; will be shown in the top right hand side of the screen.</li>
<li>The relative directory address will be listed below the Theme name.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://sammela.com/2009/09/29/the-wordpress-theme-directory-structure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keep Your Meta Tags Portable</title>
		<link>http://sammela.com/2009/09/28/keep-your-meta-tags-portable/</link>
		<comments>http://sammela.com/2009/09/28/keep-your-meta-tags-portable/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 05:22:45 +0000</pubDate>
		<dc:creator>Sam Mela</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[article]]></category>

		<guid isPermaLink="false">http://sammela.com/?p=145</guid>
		<description><![CDATA[It was difficult to think of an interesting title for this article. Maybe I should have called it &#8220;Save Time and Money &#8212; Keep Your Meta Tags Portable&#8221;, because eventually, if your Meta Tags are not portable, you&#8217;re going to invest time/money moving them.
Problem
The latest WordPress documentation says:
To add meta tags to your site, simply [...]]]></description>
			<content:encoded><![CDATA[<p>It was difficult to think of an interesting title for this article. Maybe I should have called it &#8220;Save Time and Money &#8212; Keep Your Meta Tags Portable&#8221;, because eventually, if your Meta Tags are not portable, you&#8217;re going to invest time/money moving them.</p>
<h3>Problem</h3>
<p>The latest WordPress documentation says:</p>
<blockquote><p>To add meta tags to your site, simply add them to the header.php template file in your WordPress Theme, specifically in the head section near the link for the style sheet.</p></blockquote>
<p>That works fine until you switch themes. The meta tags don&#8217;t follow you to the next theme. This may not be obvious at first. Your search engine rankings may go down if the Google, Yahoo, or Bing search engines cannot verify your site &#8212; an activity they do from time to time. But it could take a long time to trace this back to the missing meta tags, and meanwhile your site is losing <span style="color: #008000;"><strong>$</strong></span>traffic. </p>
<p>Not good.</p>
<h3>Solution</h3>
<p>Use a Wordpress Meta Tag Plugin.</p>
<p>I&#8217;m agnostic about which Meta Tag Plugin to use, but I will tell you that I am using Meta Tag Manager Wordpress Plugin from <a href="http://netweblogic.com/" target="_blank&quot;">netweblogic</a>.  Just download it, install it, and activate it according to the instructions.  It shows up as a menu item under &#8220;Settings&#8221; in your Admin Dashboard.  Click on it and you should see something like the screen below.  Just add new tags and save the changes.</p>
<div class="wp-caption alignnone" style="width: 510px"><a href="http://netweblogic.com/wordpress/plugins/meta-tag-manager/"><img title="Meta Tag Manager" src="http://sammela.com/articles/images/meta-tag-manager.gif" alt="Meta Tag Manager"/></a><p class="wp-caption-text">Meta Tag Manager</p></div>
<p>You&#8217;re done.</p>
<h3>Double Check Your Work</h3>
<p>Finally, make sure your tags are really showing up.  Navigate to your blog use your browser &#8220;view page source&#8221; capability to view the source of the page.  Make sure your meta tags are included.</p>
]]></content:encoded>
			<wfw:commentRss>http://sammela.com/2009/09/28/keep-your-meta-tags-portable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add a Sitemap to Your WordPress Site</title>
		<link>http://sammela.com/2009/09/26/add-a-sitemap-to-your-wordpress-site/</link>
		<comments>http://sammela.com/2009/09/26/add-a-sitemap-to-your-wordpress-site/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 02:04:07 +0000</pubDate>
		<dc:creator>Sam Mela</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[article]]></category>

		<guid isPermaLink="false">http://sammela.com/?p=54</guid>
		<description><![CDATA[
In a previous article (Sitemaps and Google Webmaster — Like Milk and Cookies) I explained why it is important to register your Sitemap with Google.  This article tells you how to create a Sitemap for your Wordpress site and register it with Google.
Sitemap Plugin Eases the Job
Google accepts Sitemaps in several formats, but it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://sammela.com/articles/images/skewed-text1.png" alt="Sitmap Text" style="border-width:0px;"/></p>
<p>In a previous article (<a href="http://sammela.com/2009/09/27/sitemaps-and-google-webmaster-like-milk-and-cookies/">Sitemaps and Google Webmaster — Like Milk and Cookies</a>) I explained why it is important to register your Sitemap with Google.  This article tells you how to create a Sitemap for your Wordpress site and register it with Google.</p>
<h3>Sitemap Plugin Eases the Job</h3>
<p>Google accepts Sitemaps in several formats, but it&#8217;s time consuming to create WordPress site by hand.  Furthermore, you will neeed to update the map every time you add or delete an article.   Here&#8217;s the good news &#8212; there are a number of excellent WordPress Plugins that do the job of creating Sitemaps for you.</p>
<p>I use a Plugin called &#8220;Sitemap Index&#8221; Version 1.2.2, by Twardes (<a href="http://torrentlist.pl/sitemap-index-plugin">http://torrentlist.pl/sitemap-index-plugin</a>).  This Plugin generates sitemaps dynamically, meaning that the sitemap is regenerated every time the Sitemap file is accessed.</p>
<p>It couldn&#8217;t be easier to install and use.  In the Plugins section of the WordPress Admin console, click on &#8220;Add New&#8221;.  Search on &#8220;sitemap index&#8221; (quotes included), and the &#8220;Sitemap Index&#8221; should be included in the result list.</p>
<p>Under &#8220;actions&#8221; on the right side of the screen, click &#8220;install&#8221;. It&#8217;s that easy.</p>
<h3>Get the URL of the Sitemap</h3>
<p>Click on Plugins on the left side of the WordPress Admin screen, then click on Sitemap Index &#8220;settings&#8221; on the right side of the screen.</p>
<p>You should see something like the following screen shot. Copy the Sitemap address so you can paste it into Google Webmaster Tools.</p>
<p><img src="http://sammela.com/articles/images/sitemap_index_settings.png" alt="Sitemap Index Settings Screen" /></p>
<h3>Add the Site and Sitemap to Google Webmaster Tools</h3>
<p> If you don&#8217;t already have a Google Webmaster Account, go to <a href="http://www.google.com/webmasters" target="_blank">http://www.google.com/webmasters</a> and create one.</p>
<p>It is very important to register your site with Google, because Google is the most popular search engine.</p>
<ol>
<li>Log into Webmaster Tools, and on the right-hand side of the screen click the &#8220;Add a Site&#8221; button.</li>
<li>Enter the name of your site and hit &#8220;enter&#8221;.</li>
<li>Now you should be in the Verification screen, which looks like the screenshot below.  You&#8217;ll need to copy the verification &#8220;meta&#8221; tag from the Webmaster tool back to the header.php file on your site.  </li>
</ol>
<p><img src="http://sammela.com/articles/images/webmaster_site_verification.png" alt="Sitemap Index Settings Screen" /></p>
<ol CONTINUE>
<li value="4">The header.php file is located in the same folder as your theme.</li>
<li>Using your favorite code editor, open header.php and look for a reasonable place to put the meta tag.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://sammela.com/2009/09/26/add-a-sitemap-to-your-wordpress-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome to the Article Well</title>
		<link>http://sammela.com/2009/09/20/hello-world/</link>
		<comments>http://sammela.com/2009/09/20/hello-world/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 12:35:24 +0000</pubDate>
		<dc:creator>Sam Mela</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[article]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[oscommerce]]></category>
		<category><![CDATA[articles]]></category>
		<category><![CDATA[data base]]></category>
		<category><![CDATA[os commerce]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://sammela.com/?p=1</guid>
		<description><![CDATA[OS Commerce Articles

OS Commerce: Add Product Options and Values Directly.  Learn how options and option values are stored in the OS Commerce database, and how to add them directly using a SQL statement.
OS Commerce: Add Product Attributes Directly.  Learn the difference between options, options values, and attributes and how to add product attributes.
cOS Commerce: Read Option and Option [...]]]></description>
			<content:encoded><![CDATA[<h3 style="margin-top:0px">OS Commerce Articles</h3>
<ol>
<li><a title="OS Commerce: Add Product Options and Values Directly" href="http://sammela.com/articles/article_7.php" target="_blank">OS Commerce: Add Product Options and Values Directly</a>.  Learn how options and option values are stored in the OS Commerce database, and how to add them directly using a SQL statement.</li>
<li><a title="OS Commerce: Add Product Attributes Directly" href="http://sammela.com/articles/article_8.php" target="_blank">OS Commerce: Add Product Attributes Directly</a>.  Learn the difference between options, options values, and attributes and how to add product attributes.</li>
<li><a title="OS Commerce: Read Option and Option Names Directly" href="http://sammela.com/articles/article_9.php" target="_blank">cOS Commerce: Read Option and Option Names Directly</a>.  Use PHP to retrieve product options, option values, and product attributes directly from OS Commerce.</li>
</ol>
<h3 style="margin-top:0px">Google Maps</h3>
<ol>
<li><a title="How to put your business on Google Maps" href="http://cdl4u.com/articles/article_10.php" target="_blank">How to  put your business on Google Maps</a>. Learn Want your business to show up every time someone types keywords into Google Maps? It&#8217;s easy to do, it&#8217;s free, and you can add links to your E-mail and Web site, coupons, and photos..</li>
</ol>
<h3 style="margin-top:0px">Craigslist</h3>
<ol>
<li><a title="Add HTML to Craigslist Ads" href="http://cdl4u.com/articles/article_11.php" target="_blank">Add HTML to Craigslist Ads.</a> Everyone uses Craigslist. Sometimes your business ad can get lost in an ocean of similar ads. So what can you do to make your ads standout? HTML to the rescue.</li>
</ol>
<h3 style="margin-top:0px">WordPress</h3>
<ol>
<li><a title="Create a New WordPress Theme" href="http://sammela.com/articles/article_14.php" target="_blank">Create a New WordPress Theme.</a> Often the best way to give your blog a facelift is to create a new WordPress theme, and the developers of Wordpress have made this easy to do.  This article tells you how to create a new theme.
</li>
<li><a title="Sitemaps and Google Webmaster -- Like Milk and Cookies" href="http://sammela.com/2009/09/27/sitemaps-and-google-webmaster-like-milk-and-cookies/" target="_blank">Sitemaps and Google Webmaster &#8212; Like Milk and Cookies.</a> This article won’t tell you how to make a Sitemap or how to use Google Webmaster Tools. There are plenty of of good articles that explain the mechanics of Sitemaps and Webmaster Tools. But sometimes it’s good to get up above the trees and see the big picture.  This article will make it a lot easier to understand more technically oriented articles.</li>
<li><a title="Keep Your Meta Tags Portable" href="http://sammela.com/2009/09/28/keep-your-meta-tags-portable/">Keep Your Meta Tags Portable.</a> Eventually, if your Meta Tags are not portable, you’re going to invest time/money moving them.  This article provides a solution.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://sammela.com/2009/09/20/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
