<?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>allcreatives.net &#187; Tips &amp; Tricks</title>
	<atom:link href="http://allcreatives.net/category/tips-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://allcreatives.net</link>
	<description></description>
	<lastBuildDate>Wed, 06 Jul 2011 13:16:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>Disable Autosave in WordPress</title>
		<link>http://allcreatives.net/2011/06/29/disable-autosave-in-wordpress/</link>
		<comments>http://allcreatives.net/2011/06/29/disable-autosave-in-wordpress/#comments</comments>
		<pubDate>Wed, 29 Jun 2011 08:43:53 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://allcreatives.net/?p=488</guid>
		<description><![CDATA[I&#8217;ve always come up against problems with the autosave feature in WordPress especially when working on more complex builds where content has in the past had a tendency to just disappear. Rather than trying to debug these issues myself and throwing myself into a blackhole of autosave hell, I&#8217;ve just started to (in effect) disable [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve always come up against problems with the autosave feature in WordPress especially when working on more complex builds where content has in the past had a tendency to just disappear.</p>
<p>Rather than trying to debug these issues myself and throwing myself into a blackhole of autosave hell, I&#8217;ve just started to (in effect) disable the autosave feature completely. My rationale being that the update button is more than sufficient when wanting to save something that we know we&#8217;ve updated.</p>
<p>Below is a quick step by step on how to disable autosave for WordPress version 3 and above. I could be wrong on this but I&#8217;m pretty sure that the definition for these settings were held in other files previous to version 3 of WordPress.</p>
<p><strong>Here&#8217;s how to do it:</strong></p>
<p><strong>1.</strong> Open up &#8216;wp-includes/default-constants.php&#8217; in your local WordPress file copy.<br />
<strong>2.</strong> Looks for the following line of code:</p>
<pre class="brush: php; title: ;">
if ( !defined( 'AUTOSAVE_INTERVAL' ) )
		define( 'AUTOSAVE_INTERVAL', 60 );
</pre>
<p>It should be around line 255.<br />
<strong>3.</strong> Change the 60 following the AUTOSAVE_INTERVAL to a much larger number. The 60 represents 60 seconds. There are 3600 seconds in an hour. So if you changed this to 36000 for example it would only attempt the autosave every 10 hours.<br />
<strong>4.</strong> Save the file and upload.</p>
]]></content:encoded>
			<wfw:commentRss>http://allcreatives.net/2011/06/29/disable-autosave-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the native WordPress tinyMCE WYSIWYG editor with your custom post meta textareas</title>
		<link>http://allcreatives.net/2011/02/02/using-the-native-wordpress-tinymce-wysiwyg-editor-with-your-custom-post-meta-textareas/</link>
		<comments>http://allcreatives.net/2011/02/02/using-the-native-wordpress-tinymce-wysiwyg-editor-with-your-custom-post-meta-textareas/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 21:01:11 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[tinyMCE]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Wordpress 3.0]]></category>

		<guid isPermaLink="false">http://allcreatives.net/?p=455</guid>
		<description><![CDATA[With WordPress 3.0, the creators really gave the blogging platform another dimension for those of us wanting to make the most of it as a fullly functioning CMS. One key addition was the introduction of custom post types, used in conjunction with the custom post meta features the two become a very powerful tool for [...]]]></description>
			<content:encoded><![CDATA[<p>With WordPress 3.0, the creators really gave the blogging platform another dimension for those of us wanting to make the most of it as a fullly functioning CMS.</p>
<p>One key addition was the introduction of custom post types, used in conjunction with the custom post meta features the two become a very powerful tool for completely custom content authored via WordPress&#8217;s excellect UI.</p>
<p>In this very quick tip I&#8217;m going to assume that you&#8217;ve added a custom post type and have even gotten as far as adding a custom meta box to this post type. I&#8217;m then going to assume that you got stuck as I did with adding textareas and allowing for them to be formatted with the same flexibility as the main content area ie. with tinyMCE. So here is what a snippet of your theme&#8217;s function.php file will look like by now:</p>
<pre class="brush: php; title: ;">
function meta_options(){
		global $post;
		$custom = get_post_custom($post-&gt;ID);
		$mytextarea = $custom[&quot;mytextarea&quot;][0];

?&gt;

	&lt;label&gt;My Textarea:&lt;/label&gt; &lt;textarea name=&quot;mytextarea&quot; id=&quot;mytextarea&quot;&gt;&lt;?php echo $mytextarea; ?&gt;&lt;/textarea&gt;
</pre>
<p>This may not be an exact copy of your code but yours will look very similar, probably just a little more complex. Now what I wanted todo but couldn&#8217;t figure out was how to take the textarea(s) set in the meta box above and add tinyMCE functionality to it. This is the code that I had to add to make it happen:</p>
<pre class="brush: jscript; title: ;">
&lt;script type=&quot;text/javascript&quot;&gt;
				/* &lt;![CDATA[ */

				jQuery(document).ready( function () {
					if ( typeof( tinyMCE ) == &quot;object&quot; &amp;&amp; typeof( tinyMCE.execCommand ) == &quot;function&quot; ) {

						tinyMCE.execCommand(&quot;mceAddControl&quot;, true, &quot;mytextarea&quot;);

					}
				});

				/* ]]&gt; */
		&lt;/script&gt;
</pre>
<p>Quite a simple piece of jQuery (already in use across the WordPress admin) that executes on the document being ready that uses the tincyMCE execCommand to add the WYSIWYG editor to one or more textareas using the id of the textarea which you&#8217;ll notice is in the function options.</p>
<p>So althogether the code for the metabox in your theme&#8217;s function.php will look a little something like this:</p>
<pre class="brush: php; title: ;">
function meta_options(){
		global $post;
		$custom = get_post_custom($post-&gt;ID);
		$mytextarea = $custom[&quot;mytextarea&quot;][0];

?&gt;

	&lt;label&gt;My Textarea:&lt;/label&gt; &lt;textarea name=&quot;mytextarea&quot; id=&quot;mytextarea&quot;&gt;&lt;?php echo $mytextarea; ?&gt;&lt;/textarea&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
				/* &lt;![CDATA[ */

				jQuery(document).ready( function () {
					if ( typeof( tinyMCE ) == &quot;object&quot; &amp;&amp; typeof( tinyMCE.execCommand ) == &quot;function&quot; ) {

						tinyMCE.execCommand(&quot;mceAddControl&quot;, true, &quot;mytextarea&quot;);

					}
				});

				/* ]]&gt; */
		&lt;/script&gt;
</pre>
<p>You can also use the execCommand to add tinyMCE to multiple textareas like so:</p>
<pre class="brush: php; title: ;">
function meta_options(){
		global $post;
		$custom = get_post_custom($post-&gt;ID);
		$mytextarea = $custom[&quot;mytextarea&quot;][0];

?&gt;

	&lt;label&gt;My Textarea:&lt;/label&gt; &lt;textarea name=&quot;mytextarea&quot; id=&quot;mytextarea&quot;&gt;&lt;?php echo $mytextarea; ?&gt;&lt;/textarea&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
				/* &lt;![CDATA[ */

				jQuery(document).ready( function () {
					if ( typeof( tinyMCE ) == &quot;object&quot; &amp;&amp; typeof( tinyMCE.execCommand ) == &quot;function&quot; ) {

						tinyMCE.execCommand(&quot;mceAddControl&quot;, true, &quot;mytextarea&quot;);
tinyMCE.execCommand(&quot;mceAddControl&quot;, true, &quot;mytextarea2&quot;);
tinyMCE.execCommand(&quot;mceAddControl&quot;, true, &quot;mytextarea3&quot;);
tinyMCE.execCommand(&quot;mceAddControl&quot;, true, &quot;mytextarea4&quot;);

					}
				});

				/* ]]&gt; */
		&lt;/script&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://allcreatives.net/2011/02/02/using-the-native-wordpress-tinymce-wysiwyg-editor-with-your-custom-post-meta-textareas/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Smoother @font-face embedding in IE 7 &amp; 8</title>
		<link>http://allcreatives.net/2009/12/05/smoother-font-face-embedding-in-ie-7-8/</link>
		<comments>http://allcreatives.net/2009/12/05/smoother-font-face-embedding-in-ie-7-8/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 12:41:54 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Guides & Tutorials]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[@font-face]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[EOT]]></category>
		<category><![CDATA[Font Embedding]]></category>
		<category><![CDATA[Font Squirrel]]></category>
		<category><![CDATA[Fonts]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[IE7]]></category>
		<category><![CDATA[IE8]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Typography]]></category>
		<category><![CDATA[Web Fonts]]></category>
		<category><![CDATA[WOFF]]></category>

		<guid isPermaLink="false">http://allcreatives.net/?p=261</guid>
		<description><![CDATA[You could say I&#8217;ve become somewhat obsessed with @font-face embedding over the past few months. I&#8217;ve most certainly fell head over heels for the @font-face generator from fontsquirrel.com (see the recap below). One thing however that has always bothered me is IE7 and IE8&#8242;s rendering of embedded fonts, so today with IE tester at hand [...]]]></description>
			<content:encoded><![CDATA[<p>You could say I&#8217;ve become somewhat obsessed with <a href="http://allcreatives.net/tag/font-face/">@font-face embedding</a> over the past few months. I&#8217;ve most certainly fell head over heels for the @font-face generator from fontsquirrel.com (see the recap below).</p>
<p>One thing however that has always bothered me is IE7 and IE8&#8242;s rendering of embedded fonts, so today with IE tester at hand and google ready to get wild I vowed to come up with a solution and I think I may just have.</p>
<h2>First off a quick recap</h2>
<p>If you haven&#8217;t already read my previous postings on @font-face I&#8217;d like to direct you to the following two posts:</p>
<ul>
<li><a style="text-decoration:underline;" href="http://allcreatives.net/2009/11/09/revisiting-font-face-things-may-be-looking-up/">Revisiting @font-face</a> introduces font embedding options right now.</li>
<li><a style="text-decoration:underline;" href="http://allcreatives.net/2009/11/12/font-face-a-guide-to-embedding-gorgeous-fonts-that-work-cross-browser/">Embedding fonts using @font-face</a> is a guide to using f<a href="http://fontsquirrel.com" target="_blank">ontsquirrel.com&#8217;s</a> previously mention <a href="http://www.fontsquirrel.com/fontface/generator" target="_blank">@font-face generator</a></li>
</ul>
<h2>Now let me illustrate the problem.</h2>
<p><a href="http://allcreatives.net/wp-content/uploads/2009/12/screengrab.png"><img class="bordered alignleft size-full wp-image-268" title="screengrab" src="http://allcreatives.net/wp-content/uploads/2009/12/screengrab2.png" alt="screengrab" /></a></p>
<p>When embedding using @font-face IE6 (surprisingly) renders the type face perfectly as does Firefox  and Safari but IE7 and IE8 serve up a sub-standard jagged font face that is really not pretty to look at.</p>
<p>Take a look at the <a href="http://allcreatives.net/wp-content/uploads/demos/ieff-fix/demo.html">first demo page</a> for a simple example of a custom font-face that has been embedded. If you can, take a look at this page in both Firefox and either IE7 or 8 to see the difference.</p>
<h2>What causes this?</h2>
<p>After much research I discovered the problem was being caused by Microsoft&#8217;s ClearType functionality. ClearType is designed and very much works to make rendered text online and throughout the windows system clearer to read. That&#8217;s great for body text and like I say it does work but when it comes to custom fonts that have been embedded ClearType is attempting to do a job which isn&#8217;t needed. This is what gives us the sharp, jagged looking font face that we don&#8217;t want. Because we want nicely anti-aliased text like we see in Firefox, IE6 and Safari.</p>
<p><del datetime="2008-08-08T14:03:44+00:00">As a side note I&#8217;m assuming that IE6 never had the functionality to render ClearType functionality and uses some other sort of properietary technology, leading to nicely embedded fonts in IE6 in a perverse sort of way.</del></p>
<p><strong>Update:</strong> For IE6, Windows XP does not force ClearType on in the browser and Windows Vista was shipped with IE7 pre-installed (falling into the bracket of our fix) therefore the risk of IE6 users being exposed to ClearType issues is minimal.</p>
<h2>How to fix this</h2>
<p>The good news is that there is a way to disable ClearType via the browser when visitors are viewing your web site. Now I&#8217;m not recommending this for any other use than what I&#8217;m demonstrating today, in general ClearType gets it right and helps visitors read your site the way it was meant to be read. Disabling ClearType in most circumstances leads to horribly rendered body text and a whole help of problems for your visitors eyes.</p>
<p><strong>The process of disabling ClearType</strong></p>
<p>Internet Explorer as a rule do not apply ClearType to elements using their proprietary CSS filters as they can conflict and result in wider issues for the browser so we can exploit this to make Internet Explorer leave our embedded fonts alone. Now unfortunately there a few subtle differences between the browser that mean we can&#8217;t simply apply a useless filter and move on.</p>
<p>Take a look at the <a href="http://allcreatives.net/wp-content/uploads/demos/ieff-fix/demo2.html">second demo page</a> where I&#8217;ve added a few additional fixes for IE7 and 8. Go ahead and take a look in both Firefox and IE7/8, you should now find a much nicer rendering of the font in IE. I&#8217;ll break down what&#8217;s been added below.</p>
<p><strong>The crux of the fix:</strong></p>
<pre class="brush: css; title: ;">
h2, p {font: 36px/44px 'OldSansBlackRegular', Arial, sans-serif;letter-spacing: 0;filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=hIEfix.png,sizingMethod=crop);zoom:1;}
</pre>
<p>The above snippet of CSS fixes our smoothing issues in both IE7 and IE8 as seen in the <a href="http://allcreatives.net/wp-content/uploads/demos/ieff-fix/demo2.html">previously linked demo page</a>. The key to this is filter CSS property and the zoom property which are only applicable to Internet Explorer.</p>
<p><strong>Looking at the filter property</strong></p>
<pre class="brush: css; title: ;">
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=images/headers/hIEfix.png,sizingMethod=crop);
</pre>
<p>This part is mostly for IE8, both IE7 and 8 need to have a filter present to disable ClearType but IE8 has to have this filter actual doing something to recognise it. I also noticed when testing that without a background image being present in IE8 the ClearType disable had little effect. So what this filter property does in effect is kill two birds with one stone. We add a filter which checks the required boxes for IE7 and 8 as well as adding a one by one transparent png image to satisfy IE8.</p>
<p><strong>Looking at the zoom property</strong></p>
<pre class="brush: css; title: ;">
zoom:1;
</pre>
<p>This is solely for IE7. It fixes an issue with hasLayout. If you don&#8217;t know anything about hasLayout then not to worry. Essentially IE filters can&#8217;t be assigned to any element that doesn&#8217;t have &#8216;layout&#8217; so the zoom:1 property gives our headers &#8216;layout&#8217;. hasLayout is only applicable to IE version 7 and lower as it was dropped from IE8 (thankfully). To learn more about hasLayout see <a href="http://haslayout.net/" target="_blank">here</a>.</p>
<h2>Done and dusted</h2>
<p>So in future when embedding fonts using @font-face you can use two simple IE only CSS properties and a 1 by 1 transparent png to give your fonts that anti-alias effect in IE7/8. You can even place these two properties in a separate IE only stylesheet as we are doing nothing else apart from tweaking the styles.</p>
<p>Just to note that as with any workaround you&#8217;ll need to test this on a site by site basis to ensure the fix is giving you the results you want. Even with this tweak font rendering in IE can still be unpredictable so testing and constant tweaking is a must!</p>
<h2>File Summary</h2>
<ul>
<li><a style="text-decoration:underline;" href="http://allcreatives.net/wp-content/uploads/demos/ieff-fix/demo.html">First Demo Page</a> &#8211; Showing an untouched @font-face embedding example.</li>
<li><a style="text-decoration:underline;" href="http://allcreatives.net/wp-content/uploads/demos/ieff-fix/demo2.html">Second Demo Page</a> &#8211; Showing a @font-face embedding example including the CSS fix.</li>
<li><a style="text-decoration:underline;" href="http://allcreatives.net/wp-content/uploads/demos/ieff-fix/demo.zip" target="_blank">ZIP package</a> &#8211; Containing both example pages and source files.</li>
<li><a style="text-decoration:underline;" href="http://allcreatives.net/2009/12/05/jquery-plugin-ie-font-face-cleartype-fix/">jQuery plugin</a> &#8211; Quick and easy jQuery plugin to achieve this fix.</li>
</ul>
<p>Your viewing this article on <a href="http://allcreatives.net">allcreatives.net</a> &#8211; <a href="http://allcreatives.net">the web design focused blog</a>.</p>
<p><strong>Update :</strong> Follow up post on <a href="http://allcreatives.net/2009/12/19/looking-at-the-bigger-picture-of-cleartype-and-font-face-embedding-firefox-and-safari/">ClearType issues in Firefox and Safari</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://allcreatives.net/2009/12/05/smoother-font-face-embedding-in-ie-7-8/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Contact form 7 &#8211; WordPress plugin, returning the validation message above the form</title>
		<link>http://allcreatives.net/2009/12/04/contact-form-7-wordpress-plugin-returning-the-validation-message-above-the-form/</link>
		<comments>http://allcreatives.net/2009/12/04/contact-form-7-wordpress-plugin-returning-the-validation-message-above-the-form/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 12:31:16 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Form Validation]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://allcreatives.net/?p=257</guid>
		<description><![CDATA[This is a very quick tip when using the wonderful contact form 7 plugin for wordpress. Whilst working on another web site recently I noticed that after installing the plugin and testing the form the success or warning message was appearing below the form on submit. This wasn&#8217;t ideal on longer forms as the messages [...]]]></description>
			<content:encoded><![CDATA[<p>This is a very quick tip when using the wonderful <a href="http://contactform7.com/">contact form 7 plugin for wordpress</a>.</p>
<p>Whilst working on another web site recently I noticed that after installing the plugin and testing the form the success or warning message was appearing below the form on submit. This wasn&#8217;t ideal on longer forms as the messages would go completely unnoticed. So the idea was to get the message to appear above the form it was validating.</p>
<p>After a bit of research I couldn&#8217;t find a quick and easy way to configure this so I decided to go into the plugin and found it quite easy to change myself.</p>
<h2>Changing this yourself &#8230;</h2>
<p>After installing the plugin follow this path to get to open the file that will need editing.</p>
<p><strong>Admin Home &gt; Plugins &gt; Editor &gt; Contact Form 7 &gt; Open  &#8211; contact-form-7/includes/classes.php</strong></p>
<p><strong>Now look for this block of PHP code.</strong></p>
<pre class="brush: php; title: ;">
function form_html() {
		$form = '&lt;div class=&quot;wpcf7&quot; id=&quot;' . $this-&gt;unit_tag . '&quot;&gt;';

		$url = wpcf7_get_request_uri();

		if ( $frag = strstr( $uri, '#' ) )
			$uri = substr( $uri, 0, -strlen( $frag ) );

		$url .= '#' . $this-&gt;unit_tag;

		$url = apply_filters( 'wpcf7_form_action_url', $url );
		$url = sanitize_url( $url );

		$enctype = apply_filters( 'wpcf7_form_enctype', '' );

		$form .= '&lt;form action=&quot;' . $url
			. '&quot; method=&quot;post&quot; class=&quot;wpcf7-form&quot;' . $enctype . '&gt;' . &quot;\n&quot;;
		$form .= '&lt;div style=&quot;display: none;&quot;&gt;' . &quot;\n&quot;;
		$form .= '&lt;input type=&quot;hidden&quot; name=&quot;_wpcf7&quot; value=&quot;'
			. esc_attr( $this-&gt;id ) . '&quot; /&gt;' . &quot;\n&quot;;
		$form .= '&lt;input type=&quot;hidden&quot; name=&quot;_wpcf7_version&quot; value=&quot;'
			. esc_attr( WPCF7_VERSION ) . '&quot; /&gt;' . &quot;\n&quot;;
		$form .= '&lt;input type=&quot;hidden&quot; name=&quot;_wpcf7_unit_tag&quot; value=&quot;'
			. esc_attr( $this-&gt;unit_tag ) . '&quot; /&gt;' . &quot;\n&quot;;
		$form .= '&lt;/div&gt;' . &quot;\n&quot;;
		$form .= $this-&gt;form_elements();
if ( ! $this-&gt;responses_count )
			$form .= $this-&gt;form_response_output();

		$form .= '&lt;/form&gt;';

		$form .= '&lt;/div&gt;';

		return $form;
	}
</pre>
<p><strong>The lines that outputs the validation are &#8230;</strong></p>
<pre class="brush: php; title: ;">
if ( ! $this-&gt;responses_count )
			$form .= $this-&gt;form_response_output();
</pre>
<p>So if you cut this line and paste it anywhere else in the code block you can change the position of the validation block.</p>
<p><strong>Here is my example of this which outputs the validation block before the form begins &#8230;</strong></p>
<pre class="brush: php; title: ;">
function form_html() {
		$form = '&lt;div class=&quot;wpcf7&quot; id=&quot;' . $this-&gt;unit_tag . '&quot;&gt;';

		$url = wpcf7_get_request_uri();

		if ( $frag = strstr( $uri, '#' ) )
			$uri = substr( $uri, 0, -strlen( $frag ) );

		$url .= '#' . $this-&gt;unit_tag;

		$url = apply_filters( 'wpcf7_form_action_url', $url );
		$url = sanitize_url( $url );

		$enctype = apply_filters( 'wpcf7_form_enctype', '' );
if ( ! $this-&gt;responses_count )
			$form .= $this-&gt;form_response_output();

		$form .= '&lt;form action=&quot;' . $url
			. '&quot; method=&quot;post&quot; class=&quot;wpcf7-form&quot;' . $enctype . '&gt;' . &quot;\n&quot;;
		$form .= '&lt;div style=&quot;display: none;&quot;&gt;' . &quot;\n&quot;;
		$form .= '&lt;input type=&quot;hidden&quot; name=&quot;_wpcf7&quot; value=&quot;'
			. esc_attr( $this-&gt;id ) . '&quot; /&gt;' . &quot;\n&quot;;
		$form .= '&lt;input type=&quot;hidden&quot; name=&quot;_wpcf7_version&quot; value=&quot;'
			. esc_attr( WPCF7_VERSION ) . '&quot; /&gt;' . &quot;\n&quot;;
		$form .= '&lt;input type=&quot;hidden&quot; name=&quot;_wpcf7_unit_tag&quot; value=&quot;'
			. esc_attr( $this-&gt;unit_tag ) . '&quot; /&gt;' . &quot;\n&quot;;
		$form .= '&lt;/div&gt;' . &quot;\n&quot;;
		$form .= $this-&gt;form_elements();

		$form .= '&lt;/form&gt;';

		$form .= '&lt;/div&gt;';

		return $form;
	}
</pre>
<p>And that&#8217;s it! Any question, feel free to ask away in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://allcreatives.net/2009/12/04/contact-form-7-wordpress-plugin-returning-the-validation-message-above-the-form/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using jQuery to fix IE6 CSS annoyances</title>
		<link>http://allcreatives.net/2009/12/03/using-jquery-to-fix-ie6-css-annoyances/</link>
		<comments>http://allcreatives.net/2009/12/03/using-jquery-to-fix-ie6-css-annoyances/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 20:37:54 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Guides & Tutorials]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://allcreatives.net/?p=234</guid>
		<description><![CDATA[With the usage of IE6 finally declining the majority of us can now afford to be a bit more forgiving in our cross browser testing. Despite this in some circumstances the percentage of a site&#8217;s IE6 users is still far to high to do anything other than link a separate stylesheet and spend hours writing [...]]]></description>
			<content:encoded><![CDATA[<p>With the usage of IE6 finally declining the majority of us can now afford to be a bit more forgiving in our cross browser testing. Despite this in some circumstances the percentage of a site&#8217;s IE6 users is still far to high to do anything other than link a separate stylesheet and spend hours writing fixes. The following technique is aimed at those of us that have the luxury of dealing with a smaller audience of IE6 users. As a rule of thumb I aim to use technique when said IE6 audience is smaller than 10%.</p>
<p>So with that said what I am going to demonstrate here is a Javascript based work around for IE6 selector issues using jQuery&#8217;s powerful selector options.</p>
<p>First of all I should mention that a &#8216;do all&#8217; script does already exist, authored by Dean Edwards the IE7 script includes a range of Javascript functions aiming to improve the experience of IE6 visitors viewing your site. The reason I tend to write a custom piece of Javascript rather than use Dean Edward&#8217;s script is simply down to control, I like to be in complete control rather than at the mercy of a third party script and the potential bugs that come along with third party scripts. I also find that the IE7 script contains I little bit more than I need and therefore adds excess weight to my pages.</p>
<h2>The Setup</h2>
<p>What you&#8217;ll need to implement this technique are three files, two you may have already if your site is already established. Firstly a copy of the jQuery framework, a IE6 specific stylesheet and an IE6 specific Javascript file. Of course the IE6 stylesheet and Javascript file will only be executed if the visitor&#8217;s browser is IE6. We achieve this using Microsoft lifesaving conditional browser comments.</p>
<p><strong>An example of how this would look in your page head</strong></p>
<pre class="brush: xml; title: ;">
&lt;script type=&quot;text/javascript&quot; src=&quot;/path/to/js/jquery.js&quot;&gt;&lt;/script&gt;
&lt;!--[if IE 6]&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;/path/to/js/ie6.js&quot;&gt;&lt;/script&gt;
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/path/to/js/ie6.css&quot; /&gt;
&lt;![endif]--&gt;
</pre>
<p>Now what you&#8217;ll need is the <a href="http://docs.jquery.com/Selectors" target="_blank">selectors page of the jQuery documentation open and ready</a>. It is almost identical to select an element in jQuery as it is in CSS but always check the documentation when in doubt.</p>
<p>Also take a look at some of the more <a href="http://www.quirksmode.org/css/contents.html" target="_blank">advanced and 2.1 specification CSS selectors</a> that are compatible with IE7. You&#8217;ll now able to use these and simply work around them in your ie6 Javascript/CSS technique.</p>
<h2>In Practice</h2>
<p><strong>An nice piece of CSS that needs fixing in IE6</strong></p>
<pre class="brush: css; title: ;">
p:first-child { font-weight:bold; }
p &gt; img { border:1px solid #CCC;float:right; }
</pre>
<p>So the above CSS will work in IE7, Firefox and any other browser you may care to mention. It uses the first-child selector as well as the parent &gt; child selector. The problem is it doesn&#8217;t work at all in IE6, this is where the technique comes into play.</p>
<p>To work around this in IE6 you can use jQuery to select the CSS elements for IE6 that the stylesheet can&#8217;t.</p>
<p>As I mentioned early on the method of selecting an element in jQuery is almost identical to that of CSS so lets have a look at selecting the elements from the CSS snippet above. Once the elements have been selected they will need to be styled but doing this via Javascript is fairly messy so this script simply adds a new class that can be styled via the IE6 stylesheet on one line.</p>
<p><strong>The IE6 Javascript file</strong></p>
<pre class="brush: jscript; title: ;">
$(document).ready( function(){

$(&quot;p:first-child&quot;).addClass(&quot;paragraphfirst&quot;);
$(&quot;p &gt; img&quot;).addClass(&quot;imginp&quot;);

});
</pre>
<p>The Javascript above calls the jQuery document ready function to start.  After this the jQuery selectors get the elements from the CSS code snippet further above and adds a new class to each instance.</p>
<p>So now in IE6 the first instance of a paragraph is accessible as well as any images contained directly in a paragraph using the class names assigned.</p>
<p>The beauty of this is that this file is only loaded in IE6 so does not affect the performance of your site for anyone wise enough to be using a browser other than IE6. As mentioned it also allows easy styling of these elements using one line of CSS code.</p>
<p>Once the classes have been added they are styled via the IE6 only stylesheet.</p>
<p><strong>The IE6 stylesheet corresponding to the Javascript above</strong></p>
<pre class="brush: css; title: ;">
.paragraphfirst { font-weight:bold; }
.imginp { border:1px solid #CCC;float:right; }
</pre>
<h2>Usage</h2>
<p>Hopefully given this very simple demonstration of a very powerful technique you can see the benefits of using this technique over struggling with just an IE6 stylesheet on its own. As well as saving you time in IE6 hell it also sets you free to write cleaner, more forward thinking CSS in your regular stylesheets.</p>
<p>You can even get a little more advanced and use jQuery wraps and appends to fix more tricky bugs and add more dividers where necessary.</p>
<p>The key as mentioned earlier is to keep <a href="http://docs.jquery.com/Selectors" target="_blank">the selector page of the jQuery documents</a> a click away and also do some <a href="http://www.quirksmode.org/css/contents.html" target="_blank">research into CSS 2.1 selectors and beyond</a> if you are not already familiar with them.</p>
]]></content:encoded>
			<wfw:commentRss>http://allcreatives.net/2009/12/03/using-jquery-to-fix-ie6-css-annoyances/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>@font-face a guide to embedding gorgeous fonts that work cross-browser</title>
		<link>http://allcreatives.net/2009/11/12/font-face-a-guide-to-embedding-gorgeous-fonts-that-work-cross-browser/</link>
		<comments>http://allcreatives.net/2009/11/12/font-face-a-guide-to-embedding-gorgeous-fonts-that-work-cross-browser/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 01:25:00 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[External Resources & Freebies]]></category>
		<category><![CDATA[Guides & Tutorials]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[@font-face]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[EOT]]></category>
		<category><![CDATA[Font Embedding]]></category>
		<category><![CDATA[Fonts]]></category>
		<category><![CDATA[Typography]]></category>
		<category><![CDATA[Web Fonts]]></category>
		<category><![CDATA[WOFF]]></category>

		<guid isPermaLink="false">http://allcreatives.net/?p=183</guid>
		<description><![CDATA[Since launching the site I've had a few emails regarding the font being used on allcreatives and also the technique used to embed the font. Despite two previous posts on the progress on @font-face I realised I hadn't actually posted up on how to implement @font-face effectively, so here it is.]]></description>
			<content:encoded><![CDATA[<p>Since launching the site I&#8217;ve had a few emails regarding the font being used on allcreatives and also the technique used to embed the font. Despite <a href="http://allcreatives.net/category/fonts/">two previous posts</a> on the progress on @font-face I realised I hadn&#8217;t actually posted up on how to implement @font-face effectively, so here it is.</p>
<p>The process, thanks to <a href="fontsquirrel's @font-face generator" target="_blank">fontsquirrel&#8217;s @font-face generator</a> is now quite straight forward. If you are unsure of what @font-face actually is and what all the fuss is about then hop over the<a href="http://allcreatives.net/category/fonts/"> fonts category</a> and take a look at my last two recent posts on the subject. Using the aforementioned generator we should be able to achieve @font-face perfection is two simple steps.</p>
<h2>Step 1 : Get your @font-face kit</h2>
<p>Font Squirrel have a great resource for prepackaged @font-face kits which are <a href="http://www.fontsquirrel.com/fontface" target="_blank">available here</a> otherwise you can take a font you have already on your system and run it through the <a href="http://www.fontsquirrel.com/fontface/generator">@font-face generator</a>.  Just to note that you will have to check the license agreement for any font you use with this generator to make sure you are legally allowed to embed it.</p>
<p>Now following the steps on the generator page you should now be presented with download package. Take this, download, unzip and then re-upload the font files contained to your web hosting under a sub-directory such as fonts. Do this in the same way you would with a stylesheet. The files you have uploaded should be as follows for each font family you have ran through the generator:</p>
<ul>
<li>yourfont.eot &#8211; for Internet Explorer</li>
<li>yourfont.woff &#8211; for Firefox 3.6+</li>
<li>yourfont.svg &#8211; for Chrome and Opera</li>
<li>yourfont.originalformat &#8211; whether it be .ttf of .otf for Safari and Firefox 3.5</li>
</ul>
<h2>Step 2 : Add the relevant CSS code to your stylesheet</h2>
<p>Now we have our relevant font files uploaded all that&#8217;s left is todo is add the CSS code to our stylesheet the font(s) to be embedded and used. Within the package from Font Squirrel you should have an example CSS file that looks something like this :</p>
<pre class="brush: css; title: ;">
/* * This CSS file has been generated by fontsquirrel.com and is based on the work of Paul Irish. * */ /* * * The fonts included are copyrighted by the vendor listed below. * * @vendor: West Wind Fonts * @licenseurl: http://www.fontsquirrel.com/license/Dearest * * */ @font-face { font-family: 'Dearest Regular'; src: url('Dearest.eot'); src: local('Dearest Regular'), local('Dearest'), url('Dearest.woff') format('woff'), url('Dearest.ttf') format('truetype'), url('Dearest.svg#Dearest') format('svg'); } @font-face { font-family: 'Dearest Open Regular'; src: url('Dearest_open.eot'); src: local('Dearest Open Regular'), local('DearestOpen'), url('Dearest_open.woff') format('woff'), url('Dearest_open.ttf') format('truetype'), url('Dearest_open.svg#DearestOpen') format('svg'); } @font-face { font-family: 'Dearest Outline Regular'; src: url('Dearest_outline.eot'); src: local('Dearest Outline Regular'), local('DearestOutline'), url('Dearest_outline.woff') format('woff'), url('Dearest_outline.ttf') format('truetype'), url('Dearest_outline.svg#DearestOutline') format('svg'); }
</pre>
<p>Copy this in its entirety and paste it into your stylesheet. Now look for the parts of the above code that precede an extension such as dearest.svg and change this to the correct path for your font files (uploaded earlier), keeping the font name and extension in place. Obviously the dearest font name in the above code with be replaced by your font file name.</p>
<p>After you have successfully changed the paths to point to the correct location of your font files you can use use the font name in the css &#8216;font-family&#8217; property as you would with Arial or Verdana. Remember that if your font name has spaces in it you&#8217;ll need to enclose the name on the font-family line in single quotes.</p>
<p>Now if you go ahead and check your page in Firefox, Safari or heck even Internet Explorer you should now find beautifully replaced fonts.</p>
<p>Just a final note however to say that whilst @font-face rendering on Mac computers is near perfect it may be a little sketchy on Windows machines, a lot of this has to do with the quality of the font be used. Some fonts just seem to cope better with embedding than others at the moment and whilst Macs seem to mask this better you may find that it is indeed the font itself at fault as opposed to the operating system.</p>
]]></content:encoded>
			<wfw:commentRss>http://allcreatives.net/2009/11/12/font-face-a-guide-to-embedding-gorgeous-fonts-that-work-cross-browser/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IE Conditional browser comments in xslt &#8211; a quick snippet that will save a lot of time</title>
		<link>http://allcreatives.net/2009/08/21/ie-conditional-browser-comments-in-xst-a-quick-snippet-that-will-save-a-lot-of-time/</link>
		<comments>http://allcreatives.net/2009/08/21/ie-conditional-browser-comments-in-xst-a-quick-snippet-that-will-save-a-lot-of-time/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 10:50:26 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[IE7]]></category>
		<category><![CDATA[IE8]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[XSLT]]></category>

		<guid isPermaLink="false">http://istmay.com/?p=9</guid>
		<description><![CDATA[XSLT is a great language used with XML files and is a language that we hope to cover a bit more of here on istmay. If you are new to XSLT and are dealing with stylesheets the following snippet of code could be invaluable.]]></description>
			<content:encoded><![CDATA[<div id="attachment_14" class="wp-caption alignleft" style="width: 190px"><img class="size-full wp-image-14 " title="internet-explorer-logo" src="http://istmay.com/wp-content/uploads/2009/08/internet-explorer-logo.jpg" alt="IE the devil child of Microsoft" width="180" height="180" /><p class="wp-caption-text">IE the devil child of Microsoft</p></div>
<p><a rel="nofollow" href="http://www.w3schools.com/xsl/default.asp" target="_blank">XSLT</a> is a great language used with XML files and is a language that we hope to cover a bit more of here on istmay. If you are new to XSLT and are dealing with stylesheets the following snippet of code could be invaluable.</p>
<blockquote><p>&lt;xsl:comment&gt;&lt;![CDATA[[if IE]&gt;<br />
Browser rules go here as normal<br />
&lt;![endif]]]&gt;&lt;/xsl:comment&gt;</p></blockquote>
<p>You see XSLT is a very robust language and in turn can handle most of what you throw at it however it can be slightly temperamental when dealing with the browser comments. This is due to the comment code used to start the standard browser comments. Using the code above this is avoided.</p>
<p>In the example we&#8217;ve used if IE as the conditional comment but you can change this to check for any version of IE and you can also use the code multiple times to filter different versions of IE as you normally would.</p>
]]></content:encoded>
			<wfw:commentRss>http://allcreatives.net/2009/08/21/ie-conditional-browser-comments-in-xst-a-quick-snippet-that-will-save-a-lot-of-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

