<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.1" -->
<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/"
	>

<channel>
	<title>More Than Scratch The Surface &#187; WordPress</title>
	<link>http://www.scratch99.com</link>
	<description>A Journey In Web Development</description>
	<pubDate>Sat, 12 Jul 2008 13:19:05 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
			<item>
		<title>WordPress - Colour Selector For Text Boxes in Posts</title>
		<link>http://www.scratch99.com/2007/06/wordpress-colour-selector-for-text-boxes-in-posts/</link>
		<comments>http://www.scratch99.com/2007/06/wordpress-colour-selector-for-text-boxes-in-posts/#comments</comments>
		<pubDate>Mon, 25 Jun 2007 15:52:58 +0000</pubDate>
		<dc:creator>Stephen Cronin</dc:creator>
		
		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[colour selector]]></category>

		<category><![CDATA[css]]></category>

		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.scratch99.com/2007/06/wordpress-colour-selector-for-text-boxes-in-posts/</guid>
		<description><![CDATA[Copyright © 2008 Stephen Cronin. Visit the original article at http://www.scratch99.com/2007/06/wordpress-colour-selector-for-text-boxes-in-posts/.You do not have Javascript Enabled. This page will not display properly.
In recent posts, I outlined how to create both simple and rounded text boxes within a post.  I&#8217;ve now created a Colour Selector for both types of text boxes, which allows you to [...]]]></description>
			<content:encoded><![CDATA[Copyright © 2008 <a href="http://www.scratch99.com">Stephen Cronin</a>. Visit the original article at <a href="http://www.scratch99.com/2007/06/wordpress-colour-selector-for-text-boxes-in-posts/">http://www.scratch99.com/2007/06/wordpress-colour-selector-for-text-boxes-in-posts/</a>.<br /><p><script src="http://www.scratch99.com/colorselector/script.js" type="text/javascript"></script><noscript><strong>You do not have Javascript Enabled. This page will not display properly.</strong></noscript></p>
<p>In recent posts, I outlined how to create both <a href="http://www.scratch99.com/2007/06/wordpress-simple-css-text-boxes-in-posts/" title="My previous blog outlining how to create simple text boxes in posts, using CSS.">simple</a> and <a href="http://www.scratch99.com/2007/06/wordpress-rounded-text-boxes-in-posts/" title="My post on creating rounded text boxes within a post">rounded</a> text boxes within a post.  I&#8217;ve now created a Colour Selector for both types of text boxes, which allows you to select colours you want, see a preview of the text box, then gives you the code for it.  Try it below! (may take some time to load the image)</p>
<h3>Colour Selector</h3>
<form id="typeofbox" name="typeofbox" style="text-align:left" action="http://www.scratch99.com/2007/06/wordpress-colour-selector-for-text-boxes-in-posts/"><strong>Type Of Box</strong><br />
<input type="radio" name="tob" value="rounded" checked="checked" onclick='changeboxtype("rounded")' />Rounded TextBox<br />
<input type="radio" name="tob" value="external" onclick='changeboxtype("external")' />Simple TextBox - External CSS<br />
<input type="radio" name="tob" value="inline" onclick='changeboxtype("inline")' />Simple TextBox - Inline CSS</form>
<input class="color" value="#EEEEEE" style="visibility:hidden" />
<form id="colourtype" name="userinput" style="text-align:left" action="http://www.scratch99.com/2007/06/wordpress-colour-selector-for-text-boxes-in-posts/"><strong>Area To Colour</strong><br />
<input type="radio" name="r1" value="background" checked="checked" onclick='changewhat("background")' />Background Colour<br />
<input type="radio" name="r1" value="font" onclick='changewhat("font")' />Font Colour<span id="borderradio" style="visibility:hidden"><br />
<input type="radio" name="r1" value="border" onclick='changewhat("border")' />Border Colour</span></form>
<h3>Preview:</h3>
<div id="egbox">
<div class="rtextbox"><span class="rtop"><span class="r1"></span><span class="r2"></span><span class="r3"></span><span class="r4"></span></span>
<div class="rtextboxinside">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</div>
<p><span class="rbottom"><span class="r4"></span><span class="r3"></span><span class="r2"></span><span class="r1"></span></span></div>
</div>
<h3>Code:</h3>
<div id="instructions" style="font-size:.9em">Copy the following code to the end of your external CSS file.  See my <a href="http://www.scratch99.com/2007/06/wordpress-rounded-text-boxes-in-posts/#setupstyle" title="How to setup rounded text boxes within a post">rounded text boxes</a> post for information on this and on calling the style.</div>
<div id="egcode" style="margin-left:20px; text-align:left; font-size:.9em; border: #dddddd 1px solid; width:420px; padding:10px">Code will go here when generated</div>
<p>Note: If your background is not white, you will need to replace the #FFF with the appropriate hex code for your background colour.  If you are unsure what your background colour is, I&#8217;d suggest using a Firefox extension, such as <a href="http://www.iosart.com/firefox/colorzilla/" title="The ColorZilla Firefox Extension which tells you the color of elements on your page">ColorZilla</a> or <a href="https://addons.mozilla.org/en-US/firefox/addon/60" title="The Web Developer Firefox Extension which includes many useful functions, including one which displays all the colours on your page">Web Developer</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.scratch99.com/2007/06/wordpress-colour-selector-for-text-boxes-in-posts/feed/</wfw:commentRss>
		</item>
		<item>
		<title>WordPress - Taming The Advanced Editor</title>
		<link>http://www.scratch99.com/2007/06/wordpress-taming-the-advanced-editor/</link>
		<comments>http://www.scratch99.com/2007/06/wordpress-taming-the-advanced-editor/#comments</comments>
		<pubDate>Thu, 21 Jun 2007 03:07:21 +0000</pubDate>
		<dc:creator>Stephen Cronin</dc:creator>
		
		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[advanced editor]]></category>

		<guid isPermaLink="false">http://www.scratch99.com/2007/06/wordpress-taming-the-advanced-editor/</guid>
		<description><![CDATA[Copyright © 2008 Stephen Cronin. Visit the original article at http://www.scratch99.com/2007/06/wordpress-taming-the-advanced-editor/.Adding simple HTML code to a post should be easy, but it can lead to major frustrations. Why? Because the Advanced Editor cleans your code for you. Unfortunately, it often changes your code so that it no longer works!
While I understand arguments for cleaning the [...]]]></description>
			<content:encoded><![CDATA[Copyright © 2008 <a href="http://www.scratch99.com">Stephen Cronin</a>. Visit the original article at <a href="http://www.scratch99.com/2007/06/wordpress-taming-the-advanced-editor/">http://www.scratch99.com/2007/06/wordpress-taming-the-advanced-editor/</a>.<br /><p>Adding simple HTML code to a post should be easy, but it can lead to major frustrations. Why? Because the Advanced Editor cleans your code for you. Unfortunately, it often changes your code so that it no longer works!</p>
<p>While I understand arguments for cleaning the code (errors in your HTML could break the Theme), I believe that if you want to add code, then you should be allowed to do so without it being changed.</p>
<p>I use HTML to <a href="http://www.scratch99.com/2007/06/wordpress-rounded-text-boxes-in-posts/" title="My post on creating rounded text boxes within a post">create rounded text boxes</a> within my posts. Unfortunately, my code fell foul of the Advanced Editor&#8217;s cleaning process. Below I summarise some of the solutions I discovered to this problem:</p>
<h2>Turning Off The Advanced Editor</h2>
<p>There is a simple solution: turn off the Advanced Editor. This should solve all the problems. I know that quite a few users have done this and it may be worth considering if you often add HTML. However, for many users this is not an ideal solution as they want to use the Advanced Editor.  </p>
<div class="csstextbox1">To turn off the advanced editor, login to the Admin area and click the My Profile link in the top right hand corner. The first parameter on the resulting page should be <strong>Use the visual editor when writing</strong>. If this is checked, uncheck it and click Update Profile.</div>
<h2>Using An External Text Editor</h2>
<p>If you only add HTML occasionally, leave the Advanced Editor on and use it for posts without HTML. Write posts with HTML using an external text editor, then copy the content into WordPress.</p>
<p>WordPress &#8216;cleans&#8217; your code when the Advanced Editor opens your post. Errors don&#8217;t occur the first time HTML is entered and saved, they occur on subsequent saves (the Advanced Editor re-opens the post after the save).</p>
<p>This means you should not have any problem if you:</p>
<ul>
<li>create the post content in an external text editor</li>
<li>create a new post in WordPress (or edit an existing one)</li>
<li>go to the Code Tab page</li>
<li>paste the post contents from the external file</li>
<li>save or publish the post</li>
</ul>
<p>The code will break the next time you edit the post (immediately if you <em>Save and continue</em>), but there will be no problem unless you save again. If you need to edit the post, do so in the text file, then repeat the above.</p>
<h2>Turning the Advance Editor Cleanup Off</h2>
<p>If you often enter your own HTML, but still want to use the Advanced Editor, then you might want to consider turning it&#8217;s cleanup option off. I stumbled upon how to do this on Thu Tu&#8217;s <a href="http://takethu.com/blog/?p=282" title="Thu Tu's article on how to turn off the Advanced Editor's cleanup function">Smacking Wordpress Editor</a>.  </p>
<div class="csstextbox1">Note: if you do this, the Advanced Editor will not do any cleanup. If you make errors in your HTML that break the theme, you&#8217;re on your own!  If this happens you may not be able to edit the post anymore - the only solution may be to close the browser, go to the manage posts page again and delete the offending post.</div>
<p>To summarize how to turn off the advance editor cleanup: </p>
<p>Download the <code>wp-includes/js/tinymce/tiny_mce.js</code> file using an FTP program and use a text editor to change the following (near line 167) from:</p>
<p class="codebox"><code>this._def(&quot;cleanup&quot;, true);</code></p>
<p>to </p>
<p class="codebox"><code>this._def(&quot;cleanup&quot;, false);</code></p>
<p>Save the file, then ftp it back up to the server, overwriting the original.</p>
<div class="csstextbox1">Note: you need to delete your browser cache before this takes effect. For Internet Explorer, click Tools on the menu, then Internet Options, then Delete Files. For Firefox, simply press Ctrl+F5.  For other browsers, sorry you&#8217;re on your own, but it should be straightforward to do.</div>
<h2>Stopping New Lines Before <code>&lt;div&gt;</code></h2>
<p>For me, turning the advance editor cleanup off solved most of my problems. Only one problem remained: WordPress automatically puts a new line before a <code>&lt;div&gt;</code>. In the case of my <a href="http://www.scratch99.com/2007/06/wordpress-rounded-text-boxes-in-posts/" title="My post on creating rounded text boxes within a post">rounded text boxes</a>, this means that there is a blank line before the first line of text.</p>
<p>Of course this only happens on subsequent saves, not the first one and can be easily solved by manually deleting the new line. However it is annoying to have to do this everytime you edit the post.   </p>
<p>I found the following ways to stop this happening, but none of them are really a viable solution for me, because of other problems they introduce:</p>
<p>It is possible turn off the automatic <code>&lt;br /&gt;</code>, by <a href="http://irama.org/web/cms/wordpress/" title="Article on disabling the br tags that WordPress automatically adds">Disabling WordPress&#8217; slap-happy approach to <code>&lt;br /&gt;</code></a> tags. However, this also turns off the automatic <code>&lt;br /&gt;</code> in places where I actually want them.  </p>
<p>Urban Giraffe has a <a href="http://urbangiraffe.com/plugins/disable-wpautop/" title="Plugin by John Godley which disables the automatic WordPress formatting">plugin</a> by John Godley to disable the WordPress wpautop function, which formats your posts. However, I found that it stripped the blank lines between paragraphs, even if I manually added <code>&lt;p&gt;</code> or <code>&lt;br /&gt;</code> tags. John&#8217;s post mentions this problem and gives a link to a WordPress Support page, but the suggestions there didn&#8217;t work for me. I only tried this quickly and didn&#8217;t persist, so it may be worth you trying.</p>
<p>In both cases, the solutions cause more work than just deleting the new line that WordPress adds before <code>&lt;div&gt;</code>, so I&#8217;ve settled for that.</p>
<h2>Alternative To Turning The Cleanup Off</h2>
<p>Turning off the Advance Editor cleanup, turns off <strong>all</strong> the cleanup. If all you need is the ability to use <code>&lt;div&gt;</code> without it being turned into <code>&lt;p&gt;</code>, there is a gentler option, outlined in a comment on this <a href="http://wordpress.org/support/topic/102799?replies=2#post-506773" title="WordPress Support article on allowing the DIV tag to be used in posts">WordPress Support page</a>.</p>
<p>To summarise, you need to:</p>
<ul>
<li>remove <code>p/-div[*]</code> from line66 of <code style="font-size:0.9em">\wp-includes\formatting.php</code></li>
<li>remove line 25 from <code style="font-size:0.9em">\wp-includes\js\tinymce\tiny_mce_config.php</code></li>
</ul>
<p>See the <a href="http://wordpress.org/support/topic/102799?replies=2#post-506773" title="WordPress Support article on allowing the DIV tag to be used in posts">support page</a> for more details on these changes.</p>
<p>This works well, but I&#8217;d rather have the cleanup totally off.</p>
<h2>Conclusion</h2>
<p>So, which of the above methods do I use?  Well truthfully, I&#8217;m not sure yet.  Maybe all of them!</p>
<p>I started by writing my posts in an text editor and I like this for another reason as well:  I can create my posts offline.  I do have an offline copy of WordPress running on my USB drive, but it&#8217;s easier to just open a text editor.  Yes, I&#8217;m lazy!  But I often write for a few minutes in between other things and a text editor is quicker.  </p>
<p>I am very tempted to turn the Advanced Editor off, because I add my own HTML to most posts.  I don&#8217;t really use the Advanced Editor features and I&#8217;m comfortable with HTML.  However I am persisting with it for the moment - but I have turned off the Advanced Editor Cleanup to make life easier.</p>
<p>So what do you do?  I&#8217;m interested in hearing of any other methods you know of.</p>
<script type="text/javascript">Nifty("div.csstextbox1","bgcolor-#FFFFFF");</script>]]></content:encoded>
			<wfw:commentRss>http://www.scratch99.com/2007/06/wordpress-taming-the-advanced-editor/feed/</wfw:commentRss>
		</item>
		<item>
		<title>WordPress - Rounded Text Boxes in Posts</title>
		<link>http://www.scratch99.com/2007/06/wordpress-rounded-text-boxes-in-posts/</link>
		<comments>http://www.scratch99.com/2007/06/wordpress-rounded-text-boxes-in-posts/#comments</comments>
		<pubDate>Thu, 21 Jun 2007 03:03:00 +0000</pubDate>
		<dc:creator>Stephen Cronin</dc:creator>
		
		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[advanced editor]]></category>

		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.scratch99.com/2007/06/wordpress-rounded-text-boxes-in-posts/</guid>
		<description><![CDATA[Copyright © 2008 Stephen Cronin. Visit the original article at http://www.scratch99.com/2007/06/wordpress-rounded-text-boxes-in-posts/.In my previous article I explained how to create simple text boxes, using CSS, to highlight certain text in your posts. While this is easy and effective, what I really wanted was to create text boxes with rounded corners. This article covers one technique that [...]]]></description>
			<content:encoded><![CDATA[Copyright © 2008 <a href="http://www.scratch99.com">Stephen Cronin</a>. Visit the original article at <a href="http://www.scratch99.com/2007/06/wordpress-rounded-text-boxes-in-posts/">http://www.scratch99.com/2007/06/wordpress-rounded-text-boxes-in-posts/</a>.<br /><p>In my previous article I explained <a href="http://www.scratch99.com/2007/06/wordpress-simple-css-text-boxes-in-posts/" title="My previous blog outlining how to create simple text boxes in posts, using CSS.">how to create simple text boxes</a>, using CSS, to highlight certain text in your posts. While this is easy and effective, what I really wanted was to create text boxes with rounded corners. This article covers one technique that allows you to do this. </p>
<h2>Advanced Editor Issues</h2>
<p>It should be relatively easy to create rounded corners, and it is, <em>if</em> you have the Advanced Editor turned off. If it is turned on, which is the default, you will encounter problems because WordPress kindly breaks the code.</p>
<div class="csstextbox1">These problems don&#8217;t occur the first time HTML is entered - they occur the next time the post is opened with the Advanced Editor. This means the text box works fine the first time it&#8217;s saved, but breaks on subsequent saves.</div>
<p>Check out my post <a href="http://www.scratch99.com/2007/06/wordpress-taming-the-advanced-editor/" title="My post covering ways to address the problems with adding HTML code to your posts">Taming The Advanced Editor</a>, which goes over the options open to you, including how to:</p>
<ul>
<li>turn the advanced editor off, if you choose to do so</li>
<li>avoid the problem by writing the post in an external text editor</li>
<li>change the settings so that the Advanced Editor is more friendly</li>
</ul>
<p>Any of the above options should let you create rounded text boxes.</p>
<p>Alternatively, you could use <a href="http://www.scratch99.com/2007/06/wordpress-simple-css-text-boxes-in-posts/" title="My previous blog outlining how to create simple text boxes in posts, using CSS.">simple text boxes</a> without rounded corners. These work fine because they don&#8217;t use the <code>&lt;div&gt;</code> tag, which is one of the things that the Advanced Editor does not allow by default.</p>
<h2>The Technique - Nifty Corners</h2>
<p>There are <strong>many</strong> ways to get rounded corners. My preferred solution is Alessandro Fulciniti&#8217;s <a href="http://www.html.it/articoli/nifty/index.html" title="Alessandro Fulciniti's Nifty Corners Technique">Nifty Corners</a>. </p>
<p>It&#8217;s a little cumbersome to code, but I like it for the following reasons:</p>
<ul>
<li>it avoids javascript, so it will work for users with javascript turned off (okay I know its not a big deal if people get square corners instead)</li>
<li>images aren&#8217;t used for the corners, so you can change colours via CSS, without creating new images (and the bandwidth will be lower).</li>
</ul>
<p>Most solutions use javascript and/or images for the rounded corners. If you read Alessandro&#8217;s article, you will see that he also has an improved solution that uses javascript.</p>
<div class="csstextbox1"><strong>EDIT: Although I like this technique because it does not require images or javascript, it causes havoc with validation. For that reason, I am now using the <a href="http://www.html.it/articoli/niftycube/index.html">javascript version of NiftyCorners</a>, rather than this version.</strong></div>
<p>Alessandro uses the <code>&lt;b&gt;</code> element to get the rounded corners. I&#8217;ve gone with <code>&lt;span&gt;</code> even though it&#8217;s longer, because the Advanced Editor will convert <code>&lt;b&gt;</code> to <code>&lt;strong&gt;</code> the next time you open the post.</p>
<h2><a name="setupstyle">Setting Up The Style</a></h2>
<p>For this technique, we need to add some styles to your external CSS file.</p>
<p>Download the <code>wp-content/themes/yourtheme/style.css</code> file (where yourtheme is the theme you are using) using an FTP program, <em>make a copy of it</em> in case you make a mistake, then use a text editor to add the following to the end of <code>style.css</code>:</p>
<p class="codebox"><code>.rtextbox{color:#555555; font-family:Arial; background: #EEEEEE; text-align:justify;}<br />
.rtextboxinside {margin-left: 8px; margin-right: 8px; margin-top: 3px; margin-bottom:3px}<br />
.rtop, .rbottom{display:block; background: #FFF}<br />
.rtop span, .rbottom span {display: block; height: 1px; overflow: hidden; background: #EEEEEE}<br />
.r1{margin: 0 5px}<br />
.r2{margin: 0 3px}<br />
.r3{margin: 0 2px}<br />
span.rtop span.r4, span.rbottom span.r4{margin: 0 1px; height: 2px}</code></p>
<p>The style of the rtextbox class can be changed to suit your needs (ie the colours, font, size, etc). This requires a basic knowledge of CSS, which is beyond the scope of this article, but an Internet search will reveal many sites with information on CSS.</p>
<p><strong>Note:</strong> I now created have a <a href="http://www.scratch99.com/2007/06/wordpress-colour-selector-for-text-boxes-in-posts/" title="My Colour Selector For Text Boxes in Posts article"><strong>Colour Selector</strong></a>, which can create the appropriate code for you. This works for <a href="http://www.scratch99.com/2007/06/wordpress-simple-css-text-boxes-in-posts/" title="My previous blog outlining how to create simple text boxes in posts, using CSS.">simple text boxes</a> or for rounded text boxes as outlined in this post. </p>
<p>When finished, save the file, then ftp it back up to the server, overwriting the original.</p>
<h2>Calling The Style From The Post</h2>
<p>To call the style when you are writing a post, go to the Code tab page, find the text to go in the box and add:</p>
<p class="codebox"><code>&lt;DIV class=rtextbox&gt;&lt;SPAN class=rtop&gt;&lt;SPAN class=r1&gt;&lt;/SPAN&gt;&lt;SPAN class=r2&gt;&lt;/SPAN&gt;&lt;SPAN class=r3&gt;&lt;/SPAN&gt;&lt;SPAN class=r4&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV class=rtextboxinside&gt;</code></p>
<p>immediately before the text and:</p>
<p class="codebox"><code>&lt;/DIV&gt;&lt;SPAN class=rbottom&gt;&lt;SPAN class=r4&gt;&lt;/SPAN&gt;&lt;SPAN class=r3&gt;&lt;/SPAN&gt;&lt;SPAN class=r2&gt;&lt;/SPAN&gt;&lt;SPAN class=r1&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</code></p>
<p>immediately after it. Don&#8217;t leave any spaces between the leading HTML, the text and the trailing HTML. Also be careful to enter it exactly as above (ie uppercase tags, no quote marks) or WordPress will change it to the above anyway <em>and</em> add a blank line at the bottom of the box as a lesson to you!</p>
<p>Once you&#8217;ve saved this, you should get a text box with the following style:</p>
<div class="csstextbox1">Note, if using the Advanced Editor, it is best to write the whole post first, then go to the Code tab page and call the style in the appropriate place. If you set up the text box first, save, then make some changes in the Advanced Editor and save again, your text box may break. See the Advanced Editor Issues section above for further advice.</div>
<h2>Creating a Quicktag button for your text box style</h2>
<p>If you are going to use text boxes often, you can set up a quicktag button that calls the rtextbox style for you, instead of you typing the lines in the previous section. Once setup, all you need to do is go the Code tab page, select the text you want and click the quicktag. Easy!</p>
<p>To set up a quick tag for the text box styles outlined above, you need to change the <code>quicktags.js</code> file in the <code>wp-includes/js</code> folder.  Download this file using an FTP program, <em>make a copy of it</em> and open it with a text editor.  Find the following section (at about line 126):</p>
<p class="codebox"><code>edButtons[edButtons.length] = <br />
new edButton(&#039;ed_more&#039;<br />
,&#039;more&#039;<br />
,&#039;&#039;<br />
,&#039;&#039;<br />
,&#039;t&#039;<br />
,-1<br />
);</code></p>
<p>and add this on the line after it:</p>
<p class="codebox"><code>edButtons[edButtons.length] = <br />
new edButton(&#039;ed_rtextbox&#039;<br />
,&#039;roundedbox&#039;<br />
,&#039;&lt;DIV class=rtextbox&gt;&lt;SPAN class=rtop&gt;&lt;SPAN class=r1&gt;&lt;/SPAN&gt;&lt;SPAN class=r2&gt;&lt;/SPAN&gt;&lt;SPAN class=r3&gt;&lt;/SPAN&gt;&lt;SPAN class=r4&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV class=rtextboxinside&gt;&#039;<br />
,&#039;&lt;/DIV&gt;&lt;SPAN class=rbottom&gt;&lt;SPAN class=r4&gt;&lt;/SPAN&gt;&lt;SPAN class=r3&gt;&lt;/SPAN&gt;&lt;SPAN class=r2&gt;&lt;/SPAN&gt;&lt;SPAN class=r1&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&#039;<br />
,&#039;&#039;<br />
);</code></p>
<p>When you are finished, save the file, then ftp it back up to the server, overwriting the original file.</p>
<p>You&#8217;re done! You should now have a <code>roundedbox</code> quicktag in the Code tab page of the editor (you may have to close the browser and open it again first). This quicktag button will add the appropriate code around the selected text when you click it.</p>
<p>This is the solution I use. If you use a different method for rounded text boxes, I&#8217;m interested in hearing about how you do it.</p>
<p><strong>Note:</strong> I now created have a <a href="http://www.scratch99.com/2007/06/wordpress-colour-selector-for-text-boxes-in-posts/" title="My Colour Selector For Text Boxes in Posts article"><strong>Colour Selector</strong></a>, which can create the appropriate code for you. This works for simple text boxes or for rounded text boxes as outlined in this post. </p>
<h2>Another Approach</h2>
<p>Check out Tim Rohrer&#8217;s <a href="http://timrohrer.com/blog/?p=118">Floating a rounded corner box inside a WordPress post entry</a> article for a different approach to creating rounded text boxes in a post.</p>
<script type="text/javascript">Nifty("div.csstextbox1","bgcolor-#FFFFFF");</script>]]></content:encoded>
			<wfw:commentRss>http://www.scratch99.com/2007/06/wordpress-rounded-text-boxes-in-posts/feed/</wfw:commentRss>
		</item>
		<item>
		<title>WordPress - Simple CSS Text Boxes In Posts</title>
		<link>http://www.scratch99.com/2007/06/wordpress-simple-css-text-boxes-in-posts/</link>
		<comments>http://www.scratch99.com/2007/06/wordpress-simple-css-text-boxes-in-posts/#comments</comments>
		<pubDate>Fri, 08 Jun 2007 01:13:56 +0000</pubDate>
		<dc:creator>Stephen Cronin</dc:creator>
		
		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.scratch99.com/2007/06/wordpress-simple-css-text-boxes-in-posts/</guid>
		<description><![CDATA[Copyright © 2008 Stephen Cronin. Visit the original article at http://www.scratch99.com/2007/06/wordpress-simple-css-text-boxes-in-posts/.In this article, I outline how to create simple text boxes using both inline and external CSS and how to set up a quicktag button so you can use them with the minimum of effort. You&#8217;ll be surprised at how easy it is to do!
I [...]]]></description>
			<content:encoded><![CDATA[Copyright © 2008 <a href="http://www.scratch99.com">Stephen Cronin</a>. Visit the original article at <a href="http://www.scratch99.com/2007/06/wordpress-simple-css-text-boxes-in-posts/">http://www.scratch99.com/2007/06/wordpress-simple-css-text-boxes-in-posts/</a>.<br /><p>In this article, I outline how to create <strong>simple text boxes</strong> using both <strong>inline and external CSS</strong> and how to set up a quicktag button so you can use them with the minimum of effort. You&#8217;ll be surprised at how easy it is to do!</p>
<p>I often have information that I want to include in a post, without it being part of the main body of the article. For example, additional information that may be useful to readers, but that disrupts the flow of the post.</p>
<p>The ideal way to include this sort of information is in a text box with formatting that sets it apart.</p>
<p style="padding:2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid">The information is available, but the formatting separates it from the main body of the post in the reader&#8217;s mind.</p>
<p>Books and websites often use this technique, so why not inside posts? It&#8217;s possible to use blockquotes for this purpose, but I wanted to keep that for quoting other people, so I decided to <strong>create text boxes using CSS</strong>.</p>
<div class="csstextbox1">If you&#8217;re interested in text boxes with rounded corners, this is a little more difficult (but so much cooler).  I don&#8217;t cover that in this article, as it would make it too long, but you can read about it in my <a href="http://www.scratch99.com/2007/06/wordpress-rounded-text-boxes-in-posts/" title="My article on how to create rounded text boxes in posts">Rounded Text Boxes in Posts</a> article.</div>
<h2><a name="inline">Using Inline CSS</a></h2>
<p>It is simple to use <strong>inline CSS</strong> to <strong>create a box</strong> around a paragraph.</p>
<p>First, use the default WordPress Editor (ie the Visual tab page) to write the entire post, including the text you want displayed in a <strong>text box</strong>. When you are finished, go to the Code tab page and locate the paragraph to go in the box. Add:  </p>
<p style="margin-left:15px; text-align:left; font-size:.9em"><code>&lt;p style=&quot;padding:2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid&quot;&gt;</code></p>
<p>immediately before the text and <code>&lt;/p&gt;</code> immediately after it. Save this and you should get a <strong>text box</strong> similar to this one:</p>
<p style="padding:2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid">Note, if you are using the Visual Editor, with the default settings, you cannot use <code>&lt;div&gt;</code> instead of <code>&lt;p&gt;</code>.  If you do, WordPress converts it to <code>&lt;p&gt;</code> anyway and may break the code in the process!  Unfortunately this means that this method only works for one paragraph - see my <a href="http://www.scratch99.com/2007/06/wordpress-rounded-text-boxes-in-posts/" title="My article on how to create <strong>rounded text boxes</strong> in posts&#8221;>Rounded Text Boxes in Posts</a> article for boxes with more than one paragraph.</p>
<p>You can change the style of the <strong>text box</strong> (ie the colours, font, size, border, etc), simply by changing the <strong>CSS</strong> in the <code>style=&quot;&quot;</code> section. This requires a basic knowledge of <strong>CSS</strong>, which is beyond the scope of this article, but an Internet search will reveal many sites with information on <strong>CSS</strong>.</p>
<p><strong>Note:</strong> I now created have a <a href="http://www.scratch99.com/2007/06/wordpress-colour-selector-for-text-boxes-in-posts/" title="My Colour Selector For Text Boxes in Posts article"><strong>Colour Selector</strong></a>, which can create the appropriate code for you. This works for <strong>simple text boxes</strong> (inline CSS or external CSS) as outlined in this post or for <strong>rounded text boxes</strong>.</p>
<h2><a name="external">Using External CSS</a></h2>
<p>If you want your <strong>text boxes</strong> to have a common style across your site, use external, rather than internal, CSS. You set up the style information once, in your <strong>external CSS</strong> file and reference it each time you add a <strong>text box</strong>.</p>
<p>If you want to change the style, you only need to change it in <strong>one</strong> place (the <strong>external CSS file</strong>) and it will automatically change in every post using this style.  With <strong>inline CSS</strong> you would have to manually change each post.</p>
<p>The <strong>external CSS file</strong> for the theme you are using is normally <code>style.css</code> in the <code>wp-content/themes/yourtheme</code> folder.  Download this file using an FTP program, <em>make a copy of it</em> in case you make a mistake, then use a text editor to add the following to the end of <code>style.css</code>:</p>
<p style="margin-left:15px; text-align:left; font-size:.9em"><code>.textbox {padding:2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid}</code></p>
<p>The style information can be changed to suit your needs. When finished, save the file, then ftp it back up to the server, overwriting the original.</p>
<p>To create a <strong>text box</strong>, simply reference the new class (textbox) in a <code>&lt;p&gt;</code> tag. Use the Visual Editor to write the entire post, go to the Code tab page, locate the paragraph to go in the box and add: <code>&lt;p class=&quot;textbox&quot;&gt;</code> immediately before the text and <code>&lt;/p&gt;</code> immediately after it.</p>
<div class="csstextbox1"><strong>WORDPRESS.COM Users</strong><br />
Apparently wordpress.com does not allow any <strong>inline CSS</strong> and charges extra for <strong>external CSS</strong>.  If so, <em>the inline CSS solution above will not work for you</em>.  If you have purchased the CSS Editing upgrade, <em>the external CSS solution above should work</em>.<br />
There are other options that don&#8217;t use CSS, as <a href="http://lorelle.wordpress.com/2007/02/02/wordpresscom-blog-bling-blockquotes-and-quotes/" title="Lorelle's Article on Non CSS Text Boxes" target="_blank">outlined</a> by Lorelle VanFossen, but be warned: these techniques are considered out of date by most people, including Lorrelle who is providing them as as workaround to wordpress.com&#8217;s CSS policy.</div>
<h2>Creating a Quicktag button for your text box style</h2>
<p>If you are going to use <strong>text boxes</strong> often, you can set up a quicktag button for either the <strong>internal</strong> or <strong>external CSS</strong> method. This means you don&#8217;t even need to type the line calling the <strong>text box</strong> style. Simply go the Code tab page, select the paragraph you want and click the quicktag. Easy!</p>
<p>I found an excellent tutorial on <a href="http://www.tamba2.org.uk/wordpress/quicktags/" title="Podz' Article on Setting Up Quicktags" target="_blank"> setting up quicktags</a> by Podz, and a <a href="http://lorelle.wordpress.com/2006/03/31/customizing-your-wordpress-quicktag-buttons/" title="Lorelle's Article on Customising Quicktags" target="_blank">useful article</a> by Lorelle VanFossen. Note Lorelle&#8217;s advice on <em>making a copy of your changes</em> so you can add them again if lost when upgrading WordPress.  </p>
<p>To set up a quick tag for the <strong>text box</strong> styles outlined above, you need to change the <code>quicktags.js</code> file in the <code>wp-includes/js</code> folder. Download this file using an ftp program, <em>make a copy of it</em> and open the original with a text editor. Find the following section (at about line 126):</p>
<p class="codebox"><code>edButtons[edButtons.length] = <br />
new edButton(&#039;ed_more&#039;<br />
,&#039;more&#039;<br />
,&#039;&#039;<br />
,&#039;&#039;<br />
,&#039;t&#039;<br />
,-1<br />
);</code></p>
<p>and add this on the line after it (if using the <strong>inline CSS</strong> method):</p>
<p class="codebox"><code>edButtons[edButtons.length] = <br />
new edButton(&#039;ed_textbox&#039;<br />
,&#039;textbox&#039;<br />
,&#039;&lt;p style=&quot;padding:2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid&quot;&gt;&#039;<br />
,&#039;&lt;/p&gt;&#039;<br />
,&#039;&#039;<br />
);</code></p>
<p>If you are using the <strong>external CSS</strong> method, you need to add this instead:</p>
<p class="codebox"><code>edButtons[edButtons.length] = <br />
new edButton(&#039;ed_textbox&#039;<br />
,&#039;textbox&#039;<br />
,&#039;&lt;p class=&quot;textbox&quot;&gt;&#039;<br />
,&#039;&lt;/p&gt;&#039;<br />
,&#039;&#039;<br />
);</code></p>
<p>When you are finished, save the file, then ftp it back up to the server, overwriting the original file.</p>
<p>You&#8217;re done! You should now have a <code>textbox</code> quicktag in the Code tab page of the editor, which will add the appropriate code when you select the paragraph and click the quicktag.</p>
<h2>Next article: Rounded Corners</h2>
<p>As you can see, <strong>simple square text boxes</strong> are easy and effective. However, what I really want are <strong>text boxes with rounded corners</strong>. I explain how to create these in my <a href="http://www.scratch99.com/2007/06/wordpress-rounded-text-boxes-in-posts/" title="My article on how to create rounded text boxes in posts"><strong>Rounded Text Boxes in Posts</strong></a> article.</p>
<p><strong>Note:</strong> I now created have a <a href="http://www.scratch99.com/2007/06/wordpress-colour-selector-for-text-boxes-in-posts/" title="My Colour Selector For Text Boxes in Posts article"><strong>Colour Selector</strong></a>, which can create the appropriate code for you. This works for <strong>simple text boxes</strong> (inline CSS or external CSS) as outlined in this post or for <strong>rounded text boxes</strong>.</p>
<script type="text/javascript">Nifty("div.csstextbox1","bgcolor-#FFFFFF");</script>]]></content:encoded>
			<wfw:commentRss>http://www.scratch99.com/2007/06/wordpress-simple-css-text-boxes-in-posts/feed/</wfw:commentRss>
		</item>
		<item>
		<title>WordPress Permalink Customisation - Caution For Beginners</title>
		<link>http://www.scratch99.com/2007/06/wordpress-permalink-customisation-caution-for-beginners/</link>
		<comments>http://www.scratch99.com/2007/06/wordpress-permalink-customisation-caution-for-beginners/#comments</comments>
		<pubDate>Fri, 01 Jun 2007 10:24:57 +0000</pubDate>
		<dc:creator>Stephen Cronin</dc:creator>
		
		<category><![CDATA[WordPress]]></category>

		<category><![CDATA[Blogging]]></category>

		<category><![CDATA[permalink]]></category>

		<guid isPermaLink="false">http://www.scratch99.com/2007/06/wordpress-permalink-customisation-caution-for-beginners/</guid>
		<description><![CDATA[Copyright © 2008 Stephen Cronin. Visit the original article at http://www.scratch99.com/2007/06/wordpress-permalink-customisation-caution-for-beginners/.This is only my second post since launching www.scratch99.com and I&#8217;ve already changed the Permalink structure! In this article, I examine why my original structure:
&#160;&#160;&#160;&#160;&#160;&#160;&#160; /%category%/%postname%/
doesn&#8217;t work for me.
Inspiration
After installing WordPress, I was keen to customise it. Whilst searching for information, I found the WordPress [...]]]></description>
			<content:encoded><![CDATA[Copyright © 2008 <a href="http://www.scratch99.com">Stephen Cronin</a>. Visit the original article at <a href="http://www.scratch99.com/2007/06/wordpress-permalink-customisation-caution-for-beginners/">http://www.scratch99.com/2007/06/wordpress-permalink-customisation-caution-for-beginners/</a>.<br /><p>This is only my second post since launching www.scratch99.com and I&#8217;ve already changed the Permalink structure! In this article, I examine why my original structure:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code>/%category%/%postname%/</code></p>
<p>doesn&#8217;t work for me.</p>
<h2>Inspiration</h2>
<p>After installing WordPress, I was keen to customise it. Whilst searching for information, I found the <a href="http://elliottback.com/wp/archives/2004/10/24/wordpress-customization-guide-for-newbies/" title="Elliot Back's Word Press Customisation Guide" target="_blank">WordPress Customisation Guide</a> by Elliot Back, which introduced me to the concept of permalink customisation. Note that this is quite dated (October 2004) and the method described to set up permalinks has changed (WordPress now sets up .htaccess for you, rather than you needing to copy code to it).</p>
<div class="csstextbox1">For newcomers, <a href="http://en.wikipedia.org/wiki/Permalink" title="Wikipedia's Permalink Entry" target="_blank">permalinks</a> are a permanent link to your posts. The default style of link for WordPress is <code>http://www.yourdomain.com/?p=123</code>, but you can change this to a variety of styles which are more user friendly, and more importantly, <strong>search engine friendly</strong>.</div>
<p>After reading Elliot&#8217;s article, I knew I wanted to change my permalink structure, but the article doesn&#8217;t give much information on <em>what</em> to change it to, so I went searching for further information.</p>
<p>This lead me to Fintan Darragh&#8217;s <a href="http://www.dech.co.uk/2005/11/ultimate-wordpress-seo-tips/" title="Fintan Darragh's Ultimate WordPress SEO Tips" target="_blank">Ultimate WordPress SEO Tips</a>, which recommends removing all non-essential tags from the permalink structure and replacing them with keyword rich tags such as <code>%postname%</code> and <code>%category%</code>, which makes your links more search engine friendly.</p>
<div class="csstextbox1">One argument against shortening the permalink structure, is that it increases the chance of duplicate post-slugs. Both Fintan&#8217;s article and <a href="http://blog.taragana.com/index.php/archive/wordpress-tip-on-permalink-options/" title="Angsuman Chakraborty's article on WordPress permalinks" target="_blank">another</a> by Angsuman Chakraborty state that WordPress will create unique post-slugs (although I searched the WordPress site and couldn&#8217;t verify this).</div>
<h2>Decision: <code>/%category%/%postname%/</code></h2>
<p>After searching some more, I found quite a few sites recommending <code>/%category%/%postname%/</code> as the permalink structure.</p>
<p>This appealed to me. Date information is not particularly important for my blog, as it will be more category than date driven. Using <code>/%category%/%postname%/</code> would ensure that only useful, keyword rich, information would be included in my links.</p>
<p>So my initial decision was made. I changed the permalink structure and published my first post.</p>
<h2>Problem with using <code>%category%</code></h2>
<p>Having made the initial decision, I quickly decided that I&#8217;d made a mistake.</p>
<p>Why? My blog is new, so my categories are not yet settled. What I write about may change as my blog matures. I will probably need to reorganise my categories at some point in future, probably several times. Each time I change a category, it will break some of my permalinks, resulting in bookmarks, links to my stories, etc that no longer work.</p>
<p>There are redirect plugins that can help if you do change the permalink structure, but it is far simpler if you pick a suitable structure first and don&#8217;t change it.</p>
<p>Therefore, my <strong>caution for beginners</strong>: Having <code>%category%</code> in your permalink structure is not sensible, unless you are very sure that your categories won&#8217;t change.</p>
<p>It seems obvious in hindsight, but when you are busy trying to sort out your theme, the multitude of plugins you can use, etc, it&#8217;s easy to overlook this. I&#8217;d found a lot of information on the benefits of using category, but <strong>none</strong> that mentioned any potential problems.</p>
<h2>My New Permalink Structure</h2>
<p>I&#8217;d only made one post and it was just an introduction to my blog (not something people would link to or be particularly interested in). Therefore I decided to change my permalink structure before my second post. But to what?</p>
<p>My first thought was to just use <code>/%postname%/</code>. I have seen articles recommending this for ultimate <a href="http://www.everyonesarticles.com/Category/Search-Engine-Optimization/159">SEO benefits</a>, and lets face it, it is oh so web 2.0 (think <a href="http://del.icio.us/" title="The Delicious website" target="_blank">Delicious</a> for example).</p>
<p>However, there are <a href="http://codex.wordpress.org/Using_Permalinks#Using_only_.25postname.25" title="Postname only problem explained on the WordPress Codex's guide to using permalinks" target="_blank">potential problems</a> with this approach, outlined on the WordPress Codex site, so it&#8217;s not worth risk.</p>
<p>Instead, I decided to put something short before <code>%postname%</code>. Although the date is not particularly important to me, I decided to use:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code>/%year%/%monthnum%/%postname%/</code></p>
<p>Adding the year and month number wastes only a little space and the information is marginally useful.</p>
<p>Hopefully this will be the last change for me! What do you use for your permalinks? Are there any other traps for newcomers to be aware of?</p>
<script type="text/javascript">Nifty("div.csstextbox1","bgcolor-#FFFFFF");</script>]]></content:encoded>
			<wfw:commentRss>http://www.scratch99.com/2007/06/wordpress-permalink-customisation-caution-for-beginners/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
