<?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>Big Red Tin &#187; WordPress</title>
	<atom:link href="http://bigredtin.com/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://bigredtin.com</link>
	<description>Thoughts about the web and business from the large pantry</description>
	<lastBuildDate>Wed, 08 Feb 2012 06:55:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>WordPress Theme Elements</title>
		<link>http://bigredtin.com/2011/wordpress-theme-elements/</link>
		<comments>http://bigredtin.com/2011/wordpress-theme-elements/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 01:44:20 +0000</pubDate>
		<dc:creator>Peter Wilson</dc:creator>
				<category><![CDATA[Behind the Websites]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bigredtin.com/?p=1286</guid>
		<description><![CDATA[When producing a theme, we try not to limit the website owner's options within the WordPress Dashboard. The owner may wish to enable an option down the track and be disappointed to find they can't.]]></description>
			<content:encoded><![CDATA[<p>A client asked us to put together a list of every design element required in a WordPress theme but it&#8217;s the sort of thing we think we should share.</p>
<p>When producing a theme, we try not to limit the website owner&#8217;s options within the WordPress Dashboard. The owner may wish to enable an option down the track and be disappointed if they can&#8217;t.</p>
<p>The downside for the designer and developer is they may put in work for elements that are never used. The upside is happy clients and return business.</p>
<p>Like most things web, the site&#8217;s purpose will dictate that some things just aren&#8217;t feasible. Consider this as a series of guidelines that you can adapt for your purposes.</p>
<p><span id="more-1286"></span>
<p>This is a giant list of everything we could think of. It makes the task of designing for WordPress look a lot more daunting than it actually is. The <a href="http://wpthemetestdata.wordpress.com/">theme test unit</a> contains posts with every type of content listed below.</p>
<p><em>For the purposes of this post, we focused on our <a href="http://bigredtin.com/framework/">internal WordPress framework</a>. </em></p>
<h4>The website basics</h4>
<p>The frame of the website includes the header, footer and any sidebars for website owners to add widgets. The frame may change on various pages throughout the site.</p>
<p>Some typical items that need to be designed for the site are:</p>
<ul>
<li>Menus, including hover states and any drop downs or mega menus, if applicable</li>
<li>Headings and sub headings: HTML can have up to six levels of headings and sub headings. To keep code semantic in our framework, it allows
<ul>
<li>5 levels of headings within a page (with the page title being the top level)</li>
<li>4 levels of headings within a post (on archive pages, the post title is a second level heading)</li>
</ul>
</li>
<li>Form input fields, including
<ul>
<li>label placement</li>
<li>error message placement</li>
<li>focus states (when the user&#8217;s cursor is in the input)</li>
<li>submit buttons
<ul>
<li>hover states</li>
<li>focus states</li>
<li>active states (when the button is clicked)</li>
</ul>
</li>
<li>an example of a typical layout can be found on our CSS framework&#8217;s <a href="http://www.minimumpage.com/forms.html">form demo page</a> (hit the submit button to view error messages).</li>
</ul>
</li>
<li>link colours
<ul>
<li>default</li>
<li>visited (if different from default)</li>
<li>hover state</li>
<li>focus state (for users navigating the page via keyboard)<br />As <a href="http://bigredtin.com/2011/maintaining-link-focus/">mentioned in a recent post</a>, we tend to reverse the foreground and background colours for the focus state. </li>
<li>active state (when the link is being clicked, frequently the same as hover state)</li>
</ul>
</li>
<li>Footer, typically containing
<ul>
<li>links to website policies</li>
<li>declaration of copyright,</li>
<li>links to main pages or a site map.</li>
</ul>
</li>
</ul>
<h4>Widgets</h4>
<p>Widgets are the various elements that appear in the sidebar, such as recent posts.</p>
<p>Each widget has a title and the contents described below</p>
<ul>
<li>List Widgets<br />Most widgets are a list of links. Commonly these are styled in the same fashion but, if the design demands it, they can be made to look quite different.
<ul>
<li> Archives of months/categories
<ul>
<li>Option: Display as drop down</li>
<li>Option: Show or hide post count</li>
<li>Option for categories: show hierarchy.</li>
</ul>
</li>
<li>Links/blog roll
<ul>
<li>Option: show link image (if no image, title is displayed)</li>
<li>Option: show link title</li>
<li>Option: show link description</li>
<li>Option: show link rating</li>
</ul>
</li>
<li>Pages/custom menu, shown as hierarchy. Options do not affect design.</li>
<li>Recent post titles
<ul>
<li>Option: number of posts to display</li>
</ul>
</li>
<li>Meta, links to site&#8217;s admin, RSS feed and similar</li>
<li>RSS Feed, can also be used to show recent posts. Shows title and an extract from the post.
<ul>
<li>Option: number to display</li>
<li>Option: display post author</li>
<li>Option: display post date</li>
</ul>
</li>
<li>Recent Comments.<br />Actually two links per list item; one to the comment and one to the commenter&#8217;s webpage.
<ul>
<li> Option: Number of comments to display</li>
</ul>
</li>
</ul>
</li>
<li>Other widgets
<ul>
<li>Search form, includes input and a submit button</li>
<li>Text widget, can include any HTML</li>
<li>Calendar: one month with links to dates on which there were posts</li>
<li>Tag cloud</li>
</ul>
</li>
</ul>
<p>Plugins can be used to add other widgets to your page, for example a mailing list subscription form.</p>
<h4>Archives and Search Results</h4>
<p>WordPress includes the following archives of posts.</p>
<ul>
<li>Main archive &#8211; archive of posts from all categories by all authors</li>
<li>Date based archives (by year, month and day)</li>
<li>Category archives</li>
<li>Tag archives</li>
<li>Author archives </li>
<li>Search results by search term</li>
</ul>
<p>It is possible for the designer to include a description or author bio on the page. If you add this, you need to allow for the element to be removed if no description/bio is defined.</p>
<p>The archives are a list of posts, while the designer may remove them, they typically include</p>
<ul>
<li>title,</li>
<li>category,</li>
<li>tags (if added by website owner),</li>
<li>author,</li>
<li>number of comments,</li>
<li>date of post,</li>
<li>a short excerpt, the beginning or full text of the post</li>
<li>a &#8216;read more&#8217; link</li>
</ul>
<p>Additionally, links to older and newer posts are displayed.</p>
<p>Search results display both pages and posts containing the search term in their title, excerpt or content.</p>
<h4>Single Posts</h4>
<p>Single posts typically display</p>
<ul>
<li>a feature image or thumbnail (if enabled by the designer)</li>
<li>title</li>
<li>category</li>
<li>tags (if defined by website owner)</li>
<li>author</li>
<li>comments (if enabled)</li>
<li>comment form (if open)</li>
<li>date of post</li>
<li>full text of the post</li>
<li>links to the next &amp; previous posts</li>
<li>links to the next and previous page of comments (if applicable)</li>
</ul>
<p>it is also possible to display a variety of information about the author if it has been defined.</p>
<p>Some plugins add extra content to the contents of this page. Designing for the gazillions of plugins available is impossible so discussing plugins with your client upfront will be helpful.</p>
<p>WordPress supports <a href="http://codex.wordpress.org/Post_Formats">post formats</a> which can be used to alter the display for the post depending on it&#8217;s content. The theme designer can choose to enable none, some or all of these. Possible post formats are:</p>
<ul>
<li>standard</li>
<li>aside</li>
<li>gallery</li>
<li>link</li>
<li>image</li>
<li>quote</li>
<li>status</li>
<li>video</li>
<li>audio</li>
<li>chat</li>
</ul>
<h4>Single pages</h4>
<p>WordPress allows multiple page templates to be included within a theme, common templates include:</p>
<ul>
<li>A standard page layout (required)</li>
<li>A home page</li>
<li>Special purpose landing pages</li>
</ul>
<p>Pages typically display</p>
<ul>
<li>a feature image or thumbnail (if enabled by the designer)</li>
<li>title</li>
<li>comments (if enabled)</li>
<li>comments form (if open)</li>
<li>full text of the page</li>
<li>links to the next &amp; previous pages of comments (if applicable)</li>
</ul>
<h4>Attachment pages</h4>
<p>An attachment page is linked to from an image or other media file.</p>
<ul>
<li>The full sized image, or a link to the media file</li>
<li>A caption</li>
<li>the next/previous attachment &#8211; if applicable.</li>
<li>title</li>
<li>date uploaded</li>
<li>comments (if enabled)</li>
<li>links to next / previous page of comments (if applicable)</li>
</ul>
<h4>Post and page content</h4>
<p>The WordPress visual editor allows website owners to add numerous items to their post content, including</p>
<ul>
<li>bulleted and numbers lists,</li>
<li>block quotes </li>
<li>left, right, centre or justified alignment of text,</li>
<li>links</li>
<li>headings &amp; subheadings &#8211; up to five levels in our framework</li>
<li>images (left, right or centre aligned)</li>
<li>images with captions  (left, right or centre aligned)</li>
<li>video &#8211; either uploaded or embedding a youtube video.</li>
<li>audio &#8211; either uploaded or embedding from elsewhere</li>
<li>links to next/previous pages (if the page/post is split across pages)</li>
</ul>
<p>If the website owner knows HTML, they can add other items using the HTML editor.</p>
<ul>
</ul>
<p>The <a href="http://wpthemetestdata.wordpress.com/2008/09/04/layout-test/">layout test post</a> on the theme test data page contains everything the website owner can add.</p>
<p>If the theme author enables it, each post and page may include a featured image/thumbnail. This may be displayed wherever post content appears.</p>
<p>Pull out quotes and other decretive elements can be added at the theme designers desecration.</p>
<h4>Comments</h4>
<p>Comments are generally displayed in the same manner on both pages and posts. WordPress allows for comments to be</p>
<ul>
<li>Paginated </li>
<li>Nested<br />By default WordPress allows comments to be nested up to ten levels deep. As the theme designer you can disable this or limit it to a lower number.<br />We tend to limit it three or four levels deep.</li>
<li>display avatars or not.<br />As these are enabled and disabled in the dashboard, it is important for the comment design to allow for both scenarios.</li>
</ul>
<p>The design of individual comments are dictated by the designer. Comments typically include</p>
<ul>
<li>name of the commenter</li>
<li>the contents of the comment</li>
<li>date and time of the comment</li>
<li>avatar (if enabled)</li>
<li>reply to this comment link (if enabled)</li>
<li>When commenters submit a comment, if the comment needs to be moderated by the admin the text &#8220;You comment is awaiting moderation&#8221; is displayed.</li>
</ul>
<h5>The comment form</h5>
<p>Users that aren&#8217;t logged in will see a comment form requesting:</p>
<ul>
<li>their name (required),</li>
<li>their email address (required),</li>
<li>their website (optional, the theme designer can remove this)</li>
<li>the comment (required)</li>
<li>a submit button</li>
</ul>
<p>If the user fails to fill in the form correctly, our framework displays error messages next to each field.</p>
<p>If the website owner has required users register before leaving a comment, in place of the comment form logged out users will see the text &#8220;You must be logged in to post a comment.&#8221; In our framework, we display a login form below this text.</p>
<p>Users that are logged in will see the text &#8220;Logged in as <a href="#">username</a>. <a href="#">Log out?</a>&#8221; and a form requesting the comment followed by a submit button.</p>
<h3>Not found pages</h3>
<p>If a search term returns no results or a visitor enters a URL incorrectly, a no results/file not found page will be displayed.</p>
<p>Anything can be displayed on this page, by default our framework includes:</p>
<ul>
<li>a one line explanation of what&#8217;s happened,</li>
<li>a search form,</li>
<li>a site map.</li>
</ul>
<h3>Additional items</h3>
<p>The theme designer may wish to add additional items &amp; content to their WordPress site. For the most part your imagination is the limit.</p>
<h3>Updates</h3>
<ul class="updates">
<li>28 Sep, 2011 &#8211; added a:active as suggested by <a href="http://bigredtin.com/2011/wordpress-theme-elements/#comment-2326">Edward Caissie</a> below</li>
<li>28 Sep, 2011 &#8211; change heading level details for posts, brain freeze.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://bigredtin.com/2011/wordpress-theme-elements/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Big Red Framework on WordPress.org</title>
		<link>http://bigredtin.com/2011/big-red-framework-on-wordpress-org/</link>
		<comments>http://bigredtin.com/2011/big-red-framework-on-wordpress-org/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 23:19:51 +0000</pubDate>
		<dc:creator>Peter Wilson</dc:creator>
				<category><![CDATA[Quick Notes]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bigredtin.com/?p=1248</guid>
		<description><![CDATA[Big Red, the Soupgiant WordPress framework, has been added to the WordPress.org theme repository.]]></description>
			<content:encoded><![CDATA[<p>Big Red, the <a href="http://soupgiant.com/">Soupgiant</a> WordPress framework, has been added to the <a href="http://wordpress.org/extend/themes/big-red-framework">WordPress.org theme repository</a>.</p>
<p>If you have any code suggestions, you can <a href="https://github.com/soupgiant/big-red-framework">fork the theme on Github</a> and submit a pull request.</p>
]]></content:encoded>
			<wfw:commentRss>http://bigredtin.com/2011/big-red-framework-on-wordpress-org/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Big Red Framework</title>
		<link>http://bigredtin.com/2011/big-red-framework/</link>
		<comments>http://bigredtin.com/2011/big-red-framework/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 01:53:19 +0000</pubDate>
		<dc:creator>Peter Wilson</dc:creator>
				<category><![CDATA[Quick Notes]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bigredtin.com/?p=1080</guid>
		<description><![CDATA[We&#8217;ve updated the base WordPress theme we use at Soupgiant for WordPress 3.1+ and to make more use of the WordPress API. Along with the standard features you would expect in a WordPress framework, it includes templates for the Theme My Login plugin, custom default code for Formidable / Formidable Pro plugins, custom html output [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve updated the base WordPress theme we use at <a title="Soupgiant" href="http://soupgiant.com">Soupgiant</a> for WordPress 3.1+ and to make more use of the WordPress API.</p>
<p>Along with the standard features you would expect in a WordPress framework, it includes</p>
<ul>
<li>templates for the <a title="Theme My Login" href="http://wordpress.org/extend/plugins/theme-my-login/">Theme My Login</a> plugin,</li>
<li>custom default code for <a title="Formidable" href="http://wordpress.org/extend/plugins/formidable/">Formidable</a> / <a title="Formidable Pro" href="http://formidablepro.com/">Formidable Pro</a> plugins,</li>
<li>custom html output for the <a title="Grunion Contact Form plugin" href="http://wordpress.org/extend/plugins/grunion-contact-form/">Grunion Contact Form plugin</a>, and,</li>
<li>a child theme <a href="https://github.com/soupgiant/big-red-framework/tree/master/assets/_starter">starter</a>.</li>
</ul>
<p>Never use the framework proper to set up a theme, set up a child theme instead.</p>
<ul>
<li>Copy the files from the starter directory into the base folder of your child theme</li>
<li>Create the sub-directory assets in your child theme</li>
<li>Copy the framework&#8217;s assets/child/ directory into the assets directory of your child theme</li>
</ul>
<p>See the WordPress codex page on <a title="child themes" href="http://codex.wordpress.org/Child_Themes">child themes</a> for more information.</p>
<p><strong>More documentation to come!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://bigredtin.com/2011/big-red-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Soupgiant WordPress themes on Github</title>
		<link>http://bigredtin.com/2010/soupgiant-wordpress-themes-github/</link>
		<comments>http://bigredtin.com/2010/soupgiant-wordpress-themes-github/#comments</comments>
		<pubDate>Mon, 13 Dec 2010 23:40:21 +0000</pubDate>
		<dc:creator>Peter Wilson</dc:creator>
				<category><![CDATA[Quick Notes]]></category>
		<category><![CDATA[GitHub]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bigredtin.com/?p=981</guid>
		<description><![CDATA[The Soupgiant base WordPress themes are now available on GitHub. There's no documentation at this stage, I'll write up a blog post with details in the coming week.]]></description>
			<content:encoded><![CDATA[<p><strong>Update: We&#8217;ve released our updated framework and renamed it the <a title="Big Red Framework" href="http://bigredtin.com/2011/big-red-framework/">Big Red Framework</a>.</strong></p>
<p>The <a href="http://soupgiant.com">Soupgiant</a> base WordPress themes are now available on <a href="http://github.com">GitHub</a>. There&#8217;s no documentation at this stage, I&#8217;ll write up a blog post with details in the coming weeks.</p>
<p>There are two parts to the theme</p>
<ul>
<li><strong><a title="Soupgiant Parent Theme" href="https://github.com/peterwilsoncc/soup03">Soupgiant Parent Theme</a></strong><br />
We use this as the parent theme across multiple projects. Any bug fixes or new features applied to this theme will be available to all child themes.</li>
<li><strong><a href="https://github.com/peterwilsoncc/soup03-child">Soupgiant Child Theme</a></strong><br />
Starting point for each project. Once duplicated for the project, <abbr>CSS</abbr> styling and per project <abbr>PHP</abbr> customisations are applied/overridden in the child theme. Most projects require a custom header.php &amp; footer.php.</li>
</ul>
<p>As I say, documentation to come.</p>
<p><strong>Update: </strong>We&#8217;re currently updating our themes to use WordPress 3.1 features, make wider use of the API and to make child themes easier. <a href="http://feeds.soupgiant.com/bigredtin">Subscribe to our RSS feed</a> and you&#8217;ll be notified when these are published.</p>
]]></content:encoded>
			<wfw:commentRss>http://bigredtin.com/2010/soupgiant-wordpress-themes-github/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Localisation in WordPress</title>
		<link>http://bigredtin.com/2010/javascript-localisation-in-wordpress/</link>
		<comments>http://bigredtin.com/2010/javascript-localisation-in-wordpress/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 20:00:45 +0000</pubDate>
		<dc:creator>Peter Wilson</dc:creator>
				<category><![CDATA[Behind the Websites]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wp_enqueue_script]]></category>
		<category><![CDATA[wp_localize_script]]></category>

		<guid isPermaLink="false">http://bigredtin.pressgiant.net/?p=759</guid>
		<description><![CDATA[I was asked on Twitter recently if it's possible to pass WordPress data to JavaScript, <code>wp_localize_script()</code> is the tool to do it with.]]></description>
			<content:encoded><![CDATA[<p>Recently on Twitter <a title="@iamcracks" href="http://twitter.com/iamcracks/">@iamcracks</a> asked</p>
<blockquote><p>Attention WordPress Wizards &amp; Gurus. Is it possible to &#8220;get WordPress to write a custom field into a javascript variable&#8221;?</p>
<p>&#8211; <a title="source" href="http://twitter.com/iamcracks/status/22658211370">source</a></p></blockquote>
<p>While I wouldn&#8217;t be so bold as to claim I&#8217;m either a wizard or a guru, I happen to know the answer to @iamcracks question.</p>
<p>A while back I wrote a two part tutorial on using <a title="JavaScript the WordPress way" href="http://bigredtin.com/behind-the-websites/javascript-the-wordpress-way-part-1/">JavaScript the WordPress way</a>, the code below builds on that. The first step is to load the JavaScript in functions.php using <code>wp_enqueue_script()</code> as detailed in the earlier tutorial:</p>
<pre><code>&lt;?php
function brt_load_scripts() {
  if (!is_admin()) {
    wp_enqueue_script(
      'brt-sample-script', //handle
      '/path/2/script.js', //source
      null, //no dependancies
      '1.0.1', //version
      true //load in html footer
    );
  }
}

add_action('wp_print_scripts', 'brt_load_scripts');
?&gt;</code></pre>
<p>This outputs the html required for the JavaScript when <code>wp_footer()</code> is called in footer.php</p>
<p>Localising the script is done using the function <code>wp_localize_script()</code> it takes three variables:</p>
<ul>
<li><strong>$handle</strong> &#8211; (string) the handle defined when registering the script with wp_enqueue_script</li>
<li><strong>$javascriptObject</strong> &#8211; (string) name of the JavaScript object that contains the passed variables.</li>
<li><strong>$variables</strong> &#8211; (array) the variables to be passed</li>
</ul>
<p>To pass the site&#8217;s home page and the theme directory, we&#8217;d add this function call below the <code>wp_enqueue_script</code> call above:</p>
<pre><code>&lt;?php
...
wp_localize_script('brt-sample-script', 'brtSampleVars', array(
  'url' =&gt; get_bloginfo('url'),
  'theme_dir' =&gt; get_bloginfo('stylesheet_directory')
  )
);
...
?&gt;</code></pre>
<p>The output html would be:</p>
<pre><code>&lt;script type='text/javascript'&gt;
/* &lt;![CDATA[ */
var brtSampleVars = {
  url: "http://bigredtin.com",
  theme_dir: "http://bigredtin.com/wp-content/themes/bigredtin"
};
/* ]]&gt; */
&lt;/script&gt;
&lt;script type='text/javascript' src='/path/2/script.js?ver=1.0.1'&gt;&lt;/script&gt;</code></pre>
<p>Accessing the variables within JavaScript is done using the standard dot notation, for example <code>brtSampleVars.theme_dir</code> to access the theme directory.</p>
<p>Using a post&#8217;s custom fields is slightly more complicated so I&#8217;ll write out the code in full:</p>
<pre><code>&lt;?php
function brt_load_scripts() {
  if (is_singular()) {
    wp_enqueue_script(
      'brt-sample-script', //handle
      '/path/2/script.js', //source
      null, //no dependancies
      '1.0.1', //version
      true //load in html footer
    );

    the_post();
    $allPostMeta = get_post_custom();
    wp_localize_script('brt-sample-script', 'brtSampleVars',
    array(
      'petersTwitter' =&gt; $allPostMeta['myTwitter'][0],
      'joshsTwitter' =&gt; $allPostMeta['joshsTwitter'][0]
      )
    );
    rewind_posts();
  }
}

add_action('wp_print_scripts', 'brt_load_scripts');
?&gt;</code></pre>
<p>Only pages and posts have custom fields so the check at the start of the function has become <code>is_singlular()</code> to check the user is on either a post or a page, earlier we were testing if the user was anywhere on the front end. The arguments for <code>wp_enqueue_script</code> have not changed.</p>
<p><code>the_post()</code> needs to be called to start the loop and initiate the $post object so the associated custom fields can be accessed in the following line and put in an array.</p>
<p>With the custom fields easily available, the information can then be passed to <code>wp_localize_script()</code> as earlier demonstrated. The final step is to rewind the loop so next time <code>the_post()</code> is called, from either single.php or page.php, the post data is available.</p>
<p>The html output from the sample above would be:</p>
<pre><code>&lt;script type='text/javascript'&gt;
/* &lt;![CDATA[ */
var brtSampleVars = {
  petersTwitter: "@pwcc",
  joshsTwitter: "@sealfur"
};
/* ]]&gt; */
&lt;/script&gt;
&lt;script type='text/javascript' src='/path/2/script.js?ver=1.0.1'&gt;&lt;/script&gt;</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://bigredtin.com/2010/javascript-localisation-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Delay Print Stylesheets Plugin</title>
		<link>http://bigredtin.com/2010/delay-print-css-plugin/</link>
		<comments>http://bigredtin.com/2010/delay-print-css-plugin/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 02:17:29 +0000</pubDate>
		<dc:creator>Peter Wilson</dc:creator>
				<category><![CDATA[Behind the Websites]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bigredtin.pressgiant.net/?p=739</guid>
		<description><![CDATA[A few weeks ago I wrote a post in which I adapted an idea from a zOompf article to delay the loading of print stylesheets until after a web page has fully rendered. I've decided to convert the code from the original post into a plugin and add it to the WordPress plugin directory.]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago I wrote a post in which I <a title="adapted an idea from a zOompf article" href="http://bigredtin.com/behind-the-websites/delay-loading-of-print-css/">adapted an idea from a zOompf article</a> to delay the loading of print stylesheets until after a web page has fully rendered. I finished that post with the following point/question:</p>
<blockquote><p>Another question to ask is whether all this is actually worth the effort – even when reduced through automation. On Big Red Tin, the print.css is 595 bytes, the delay in rendering is negligible.</p></blockquote>
<p>Chris and Jeff at <a title="Digging into WordPress" href="http://digwp.com">Digging into WordPress</a> picked up the article and posted it on their site. In turn it was picked up elsewhere and became the surprise hit of the summer at Big Red Tin. Not bad when one is shivering through a bitter Melbourne winter.</p>
<p>As a result of the interest, I decided to convert the code from the original post into a plugin and add it to the WordPress plugin directory.</p>
<h4>Further Testing</h4>
<p>As I warned in the original article, I&#8217;d tested the code in very limited circumstances and found it had worked. Fine for a code sample but not enough for a sub version-1.0-release plugin. Additional testing showed:</p>
<ol>
<li>Stylesheets intended for IE, through conditional comments, were loading in all browsers</li>
<li>When loading multiple stylesheets, the correct order was not maintained in all browsers</li>
</ol>
<p>If jQuery was available I wanted to use it for JavaScript event management otherwise I&#8217;d use purpose-written JavaScript. There&#8217;s no point, after all, of worrying about the rendering delay caused by 600-1000 bytes only to load a 71KB (or 24KB <a title="gzipped" href="http://developer.yahoo.net/blog/archives/2007/07/high_performanc_3.html">gzipped</a>) file in its place.</p>
<p>Other things I wanted to do included:</p>
<ol>
<li>Put the PHP in a class to reduce the risk of clashing function/class names</li>
<li>Put the JavaScript in its own namespace</li>
<li>Keep the output code as small as possible</li>
</ol>
<p>To support conditional comments for IE required adding each stylesheet within a separate &lt;script&gt; tag, using this method the output HTML takes the following form:</p>
<pre><code>&lt;script&gt;
  // add global print.css
&lt;/script&gt;
&lt;!--[if IE 6]&gt;
  &lt;script type='text/javascript'&gt;
    // add ie6 specific print.css
  &lt;/script&gt;
&lt;![endif]--&gt;</code></pre>
<p>This violates my aim to keep output as small as possible but footprint has to take second place to bug-free. I could have translated the code to use <a title="JavaScript conditional comments" href="http://en.wikipedia.org/wiki/Conditional_comment#Conditional_Comment_in_JScript">JavaScript conditional comments</a> by translating the IE version to the JavaScript engine it uses but this could lead to future-proofing problems.</p>
<p>To maintain the order of stylesheets, I added each event to an array of functions and then used a single event to loop through the array of functions. If jQuery is used, I add multiple events because jQuery runs events on a first in first out basis.</p>
<p>Putting the PHP in a class and the JavaScript in its own namespace is fairly self-explanatory. <a href="http://bit.ly/bBUXCh">Google is your friend</a> if you wish to read up further on this.</p>
<p>Minimising the footprint was also a simple step. I wrote the JavaScript out in full with friendly variable names. Once I was happy with the code, I ran the code through <a href="http://refresh-sf.com/yui/">the YUI JavaScript compressor</a>, commented out the original JavaScript in the plugin file and output the compressed version in its place.</p>
<p>The JavaScript is output inline (within the HTML) to avoid additional HTTP requests. I was in two minds about this because browser caching is lost in the process. So it may change in a later version.</p>
<p>I&#8217;ve worked out another way to keep the footprint small. Rather than creating a function to pass the stylesheet&#8217;s URL and ID to <code>brt_print.add(url, id)</code>, I wrote out the full function for each style sheet. I&#8217;ll fix that in the next release.</p>
<p>You can <a title="download" href="http://wordpress.org/extend/plugins/delay-print-css/download/">download</a> the <a title="Delay Print CSS Plugin" href="http://http://wordpress.org/extend/plugins/delay-print-css/">Delay Print CSS Plugin</a> from the WordPress plugin repository.</p>
]]></content:encoded>
			<wfw:commentRss>http://bigredtin.com/2010/delay-print-css-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Delay loading of print CSS</title>
		<link>http://bigredtin.com/2010/delay-loading-of-print-css/</link>
		<comments>http://bigredtin.com/2010/delay-loading-of-print-css/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 05:03:50 +0000</pubDate>
		<dc:creator>Peter Wilson</dc:creator>
				<category><![CDATA[Behind the Websites]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bigredtin.pressgiant.net/?p=689</guid>
		<description><![CDATA[Recently I stumbled across an article detailing browser performance with the CSS print media type. In most recent browsers the print stylesheet held up rendering.

The article suggested a solution, which I decided to automate for WordPress.]]></description>
			<content:encoded><![CDATA[<p>Recently I stumbled across an article on zOompf <a title="detailing browser performance with the CSS print media type" href="http://zoompf.com/blog/2009/12/browser-performance-problem-with-css-print-media-type">detailing browser performance with the CSS print media type</a>. In most recent browsers, Safari being the exception, the print stylesheet held up rendering of the page.</p>
<p>The zOomph article suggests a solution, to load print stylesheets using JavaScript once the page has  rendered (ie, on the <code>window.onload</code> event), with a backup for the JavaScript impaired. You can see their code in the original article.</p>
<h4>Automating the task for WordPress</h4>
<p>Most sites I develop are in WordPress so I decided to automate the process. This relies on using <code>wp_enqueue_style</code> to register the stylesheets:</p>
<pre><code>function enqueue_css(){
  if (!is_admin()){
    wp_enqueue_style (
      'bigred-print', /* handle */
      '/path-to/print.css', /* source */
      null, /* no requirements */
      '1.0', /* version */
      'print' /* media type */
    );
  }
}
add_action('wp_print_styles', 'enqueue_css');</code></pre>
<p>The above code will output the following HTML in the header:</p>
<pre><code>&lt;link rel='stylesheet' id='bigred-print-css'  href='/path-to/print.css?ver=1.0' type='text/css' media='print' /&gt;</code></pre>
<p>The first step is to wrap the above html in noscript tags, the WordPress <a title="filter" href="http://codex.wordpress.org/Plugin_API#Filters">filter</a> <code>style_loader_tag</code> is ideal for this.</p>
<pre><code>function js_printcss($tag, $handle) {
  global $wp_styles;
  if ($wp_styles-&gt;registered[$handle]-&gt;args == 'print') {
    $tag = "&lt;noscript&gt;" . $tag . "&lt;/noscript&gt;";
  }
  return $tag;
}
add_filter('style_loader_tag', 'js_printcss', 5, 2);</code></pre>
<p>The filter runs for all stylesheets, regardless of media type, so the function checks for print stylesheets and wraps them in the <code>noscript</code> tag, other media types are left alone.</p>
<p>The first two arguments are the filter and function names respectively, the third argument specifies the timing (5 is the default) and the final argument tells WordPress how many arguments to pass to the filter – two – in this case $tag and $handle.</p>
<p>With the new filter, WordPress now outputs following HTML in the header:</p>
<pre><code>&lt;noscript&gt;
&lt;link rel='stylesheet' id='bigred-print-css'  href='/path-to/print.css?ver=1' type='text/css' media='print' /&gt;
&lt;/noscript&gt;</code></pre>
<p>The next step is to add the JavaScript to load the stylesheets, we can do this by changing our original function,  <code>js_printcss</code>, and making use of a global variable:</p>
<pre><code>$printCSS = '';

function js_printcss($tag, $handle){
  global $wp_styles, $printCSS;
  if ($wp_styles-&gt;registered[$handle]-&gt;args == 'print') {

    $tag = "&lt;noscript&gt;" . $tag . "&lt;/noscript&gt;";

    preg_match("/&lt;\s*link\s+[^&gt;]*href\s*=\s*[\"']?([^\"' &gt;]+)[\"' &gt;]/", $tag, $hrefArray);
    $href = $hrefArray[1];

    $printCSS .= "var cssNode = document.createElement('link');";
    $printCSS .= "cssNode.type = 'text/css';";
    $printCSS .= "cssNode.rel = 'stylesheet';";
    $printCSS .= "cssNode.href = '" . esc_js($href) . "';";
    $printCSS .= "cssNode.media = 'print';";
    $printCSS .= "document.getElementsByTagName(\"head\")[0].appendChild(cssNode);";
  }
  return $tag;
}</code></pre>
<p>The code creates the PHP variable <code>$printCSS</code> globally, which is then called into the function using the global command.</p>
<p>After wrapping the tag in the <code>noscript</code> tags, the new function uses a regular expression to extract the URL of the stylesheet from the link tag and placing it the variable <code>$href</code>.</p>
<p>Having extracted the stylesheet&#8217;s URL, the function then appends the required JavaScript to the PHP global variable <code>$printCSS</code>.</p>
<p>The final step is to add the JavaScript to the footer of the HTML using the wp_footer action in WordPress. The PHP to do this is:</p>
<pre><code>function printCSS_scriptTags(){
  global $printCSS;
  if ($printCSS != '') {
    echo "&lt;script type='text/javascript'&gt;\n";
    echo "window.onload = function(){\n";
    echo $printCSS;
    echo "}\n&lt;/script&gt;";
  }
}

add_action('wp_footer', 'printCSS_scriptTags');</code></pre>
<p>The above code uses <code>window.onload</code> as dictated in the original article. A better method would be to use an event listener to do the work, for those using jQuery we would change the function to:</p>
<pre><code>function printCSS_scriptTags(){
  global $printCSS;
  if ($printCSS != '') {
    echo "&lt;script type='text/javascript'&gt;\n";
    echo "jQuery(window).ready(function(){\n";
    echo $printCSS;
    echo "});\n&lt;/script&gt;";
 }

}
add_action('wp_footer', 'printCSS_scriptTags');</code></pre>
<p>The above solution had been tested for very limited circumstances only and found to have worked. Were I to use the function in a production environment I would undertake further testing.</p>
<p>Another question to ask is whether all this is actually worth the effort – even when reduced through automation. On Big Red Tin, the print.css is 595 bytes, the delay in rendering is negligible.</p>
<p><strong>Update Aug 23, 2010</strong>: Fixed a type in the code block redefining <code>js_printcss</code>.</p>
<p><strong>Update Aug 27, 2010</strong>: I&#8217;ve decided to release this as a plugin, get the skinny and the plugin from the <a href="http://bigredtin.com/behind-the-websites/delay-print-css-plugin/">followup article</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://bigredtin.com/2010/delay-loading-of-print-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thesis V WordPress, Pearson V Mullenweg</title>
		<link>http://bigredtin.com/2010/thesis-v-wordpress/</link>
		<comments>http://bigredtin.com/2010/thesis-v-wordpress/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 01:33:38 +0000</pubDate>
		<dc:creator>Peter Wilson</dc:creator>
				<category><![CDATA[Behind the Websites]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[Chris Pearson]]></category>
		<category><![CDATA[GPL]]></category>
		<category><![CDATA[Matt Mullenweg]]></category>
		<category><![CDATA[Movable Type]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[Thesis]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bigredtin.pressgiant.net/?p=669</guid>
		<description><![CDATA[Mullenweg believes that, because WordPress is released under the GPLv2 license, all themes and plugins developed for WordPress must also be released under the same license. Pearson disagrees. I believe that Mullenweg is wrong. WordPress themes can operate on other blogging platforms with minimal changes.]]></description>
			<content:encoded><![CDATA[<p>Reading my WordPress feeds this-morning, it appears a <a title="war of words" href="http://thenextweb.com/socialmedia/2010/07/14/wordpress-and-thesis-go-to-battle-mullenweg-may-sue/">war of words</a> broke out overnight between Matt Mullenweg (the lead developer of WordPress) and Chris Pearson, the developer of the Thesis theme.</p>
<p>In brief, Mullenweg believes that, because WordPress is released under the <a title="GPLv2 license" href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt">GPLv2 license</a>, all themes and plugins developed for WordPress must also be released under the same license. Pearson disagrees.</p>
<p>This situation has never affected us directly at Soupgiant so we haven&#8217;t needed to, and this is important, ask our lawyer if my interpretation is correct. <strong>This is a layman&#8217;s opinion and should be treated as such</strong>.</p>
<p>The battle comes down to these clauses in the GPLv2 license:</p>
<blockquote><p>You must cause any work that you distribute or publish, that in    whole or in part contains or is derived from the Program or any    part thereof, to be licensed as a whole at no charge to all third    parties under the terms of this License.</p>
<p>If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works.</p>
<p>&#8211;source <a title="GPLv2 license" href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt">GPLv2 license</a></p></blockquote>
<p>Due to the second clause quoted above, I believe that Mullenweg is wrong. WordPress themes can operate on other blogging platforms with minimal changes. This has been done before with the <a title="Sandbox theme for WordPress" href="http://www.plaintxt.org/themes/sandbox/">Sandbox theme for WordPress</a> which was successfully ported to <a title="Movable Type" href="http://plugins.movabletype.org/sandbox/">Movable Type</a>.</p>
<p>WordPress themes output <abbr>HTML</abbr> with a series of calls to the blogging platform. To output the post&#8217;s title and contents in our base theme, we use the code:</p>
<pre><code>&lt;h2 class="entry-title"&gt;&lt;?php the_title() ?&gt;&lt;/h2&gt;
&lt;div class="entry-content"&gt;
    &lt;?php the_content("Continue reading " . the_title('', '', false)); ?&gt;
&lt;/div&gt;</code></pre>
<p>To output the same <abbr>HTML</abbr> in a Movable Type theme, we would output:</p>
<pre><code>&lt;h2 class="entry-title"&gt;&lt;$mt:EntryTitle$&gt;&lt;/h2&gt;
&lt;div class="entry-content"&gt;
    &lt;$mt:EntryBody$&gt; &lt;$mt:EntryMore$&gt;
&lt;/div&gt;</code></pre>
<p>In terms of a page&#8217;s output, the above code is a minor part of the page. <em>The theme&#8217;s template is mostly made up of HTML and CSS, HTML and CSS operate in the browser and not in the blogging platform</em>. It&#8217;s for that reason that I believe that Pearson is correct in this case.</p>
<p>I acknowledge that WordPress hooks may complicate the matter but these hooks output such a minor part of a theme&#8217;s HTML, that I consider the theme <em>uses</em> the platform but isn&#8217;t <em>derived</em> from the platform. I&#8217;ve left plugins out of this discussion as these are a more complicated matter: they can output HTML or they can build on the platform.</p>
<p>The above said, were I to release a WordPress theme I would probably release it under the GPL as a hat tip and thank you to the community that has assisted me so much. However, if the theme was as complicated as the Thesis theme, I may feel differently about the matter when it&#8217;s crunch time.</p>
<p>Again, this is a layman&#8217;s opinion and should be treated as such. If you have a layman&#8217;s opinion too, <a title="we'd love to hear it in the comments" href="http://bigredtin.com/behind-the-websites/thesis-v-wordpress/#comments">we&#8217;d love to hear it in the comments</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://bigredtin.com/2010/thesis-v-wordpress/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Getting the bloginfo correctly</title>
		<link>http://bigredtin.com/2010/getting-the-bloginfo-correctly/</link>
		<comments>http://bigredtin.com/2010/getting-the-bloginfo-correctly/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 02:12:30 +0000</pubDate>
		<dc:creator>Peter Wilson</dc:creator>
				<category><![CDATA[Behind the Websites]]></category>
		<category><![CDATA[bloginfo]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[domains]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress MS]]></category>

		<guid isPermaLink="false">http://bigredtin.pressgiant.net/?p=646</guid>
		<description><![CDATA[One of the standout problems when using plugins with WordPress MS is when they define a constant for the plugin’s url as the script starts executing.]]></description>
			<content:encoded><![CDATA[<p>This site runs on an <a title="WordPress MS" href="http://codex.wordpress.org/Create_A_Network">WordPress </a><abbr title="Multi Site"><a title="WordPress MS" href="http://codex.wordpress.org/Create_A_Network">MS</a></abbr> install, along with a number of other small sites. You can see the full list of sites <a title="on the directory page" href="http://pressgiant.net/">on the directory page</a>.</p>
<p>As with most WordPress sites we use plugins to enhance WordPress, including <a title="Donncha O Caoimh" href="http://ocaoimh.ie/">Donncha O Caoimh</a>&#8216;s excellent <a title="WordPress MU Domain Mapping" href="http://ocaoimh.ie/wordpress-mu-domain-mapping/">WordPress <abbr>MU</abbr> Domain Mapping</a> plugin. As the name implies, the domain mapping plugin allows us to use top level domains for each site rather than being stuck with sub-domains. In the case of this blog, without the plugin it would reside at <a title="bigredtin.pressgiant.com" href="http://bigredtin.pressgiant.net">bigredtin.pressgiant.net</a>.</p>
<h4>Taking care with plugins</h4>
<p>Many plugins are tested for the single site version of WordPress only. I don&#8217;t have a problem with this as most plugins are released under the GPL and free in terms of both speech and beer. If I&#8217;m not paying for software, it&#8217;s up to me to test it in the fringe environment of WordPress <abbr title="Multi Site">MS</abbr>.</p>
<p>Now that WordPress is WordPress <abbr title="Multi Site">MS</abbr> is WordPress, more developers may test in both environments but they certainly can&#8217;t be expected to test with all manner of combinations of plugins.</p>
<h4>The standout problem</h4>
<p>One of the standout problems when using plugins with WordPress <abbr title="Multi Site">MS</abbr> is when they define a constant for the plugin&#8217;s url as the script starts executing, the PHP code may look similar to:</p>
<pre><code>&lt;?php

  define('PLUGIN_DIR', get_bloginfo('url') . "/wp-content/plugins/peters-plugin");

  function plugin_js_css(){
    wp_enqueue_script('plugin-js', PLUGIN_DIR . '/script.js');
    wp_enqueue_style('plugin-css', PLUGIN_DIR . '/style.css');
  }

  add_action('init', 'plugin_js_css');

?&gt;</code></pre>
<p>The above stands equally for themes mapping the stylesheet directory at the start of execution:</p>
<pre><code>&lt;?php

  define('THEME_DIR', get_bloginfo('stylesheet_directory') );

  function theme_js_css(){
    wp_enqueue_script('theme-js', THEME_DIR . '/script.js');
    wp_enqueue_style('theme-css', THEME_DIR . '/style.css');
  }

  add_action('init', 'theme_js_css');

?&gt;</code></pre>
<p>The <a title="get_bloginfo" href="http://codex.wordpress.org/Function_Reference/get_bloginfo"><code>get_bloginfo</code></a> and <a title="bloginfo" href="http://codex.wordpress.org/Function_Reference/bloginfo"><code>bloginfo</code></a> functions return information about your blog and your theme settings including the site&#8217;s home page, the theme&#8217;s directory (as in the second code sample above) or the stylesheet url. <code>bloginfo</code> outputs the requested information to your <abbr>HTML</abbr>, <code>get_bloginfo</code> returns it for use in your <abbr>PHP</abbr>. </p>
<p>Outside of code samples, <code>bloginfo</code> and <code>get_bloginfo</code> are interchangeable throughout this article.</p>
<p>The problems occur when a subsequently loaded plugin needs to change something retrieved from <code>bloginfo</code>. In this site&#8217;s case, Domain Mapping changes all URLs obtained through <code>bloginfo</code>, but it could be a plugin that simply changes the stylesheet url to a subdomain to speed up page load.</p>
<p>In a recent case, a plugin – let&#8217;s call it <a title="Disqus" href="http://disqus.com/">Disqus</a> – was defining a constant in this manner. As result an <abbr title="Cross-site scripting">XSS</abbr> error was occurring when attempting to use Facebook Connect. Replacing the constant with a <code>bloginfo</code> call fixed the problem.</p>
<p>The improved code for the first sample above is:</p>
<pre><code>&lt;?php

  function plugin_js_css(){
    wp_enqueue_script('plugin-js', get_bloginfo('url') . '/wp-content/plugins/peters-plugin/script.js');
    wp_enqueue_style('plugin-css', Pget_bloginfo('url') . '/wp-content/plugins/peters-plugin/style.css');
  }

  add_action('init', 'plugin_js_css');

?&gt;</code></pre>
<h4>bloginfo doesn&#8217;t hit the database everytime</h4>
<p>I presume the developers set their own constants because they&#8217;d like to avoid hitting the database repeatedly to receive the same information.</p>
<p>Having run some tests on my local install of WordPress, I can assure you this is not the case. Running <code>bloginfo('stylesheet_directory')</code> triggers a db call on the first occurrence, the information is then cached for subsequent calls.</p>
<p>I realise I sound incredibly fussy and that I&#8217;m suggesting we protect against edge cases on our edge cases. You&#8217;re right, and <a title="it's not the first time" href="http://bigredtin.com/behind-the-websites/javascript-the-wordpress-way-part-1/">it&#8217;s not the first time</a>, but as developers it&#8217;s the edge cases that we&#8217;re employed to avoid.</p>
]]></content:encoded>
			<wfw:commentRss>http://bigredtin.com/2010/getting-the-bloginfo-correctly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8216;Skip to Content&#8217; Links</title>
		<link>http://bigredtin.com/2010/skip-to-content-links/</link>
		<comments>http://bigredtin.com/2010/skip-to-content-links/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 02:03:45 +0000</pubDate>
		<dc:creator>Peter Wilson</dc:creator>
				<category><![CDATA[Behind the Websites]]></category>
		<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Best Practice]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[content]]></category>
		<category><![CDATA[JAWS]]></category>
		<category><![CDATA[screen readers]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://bigredtin.pressgiant.net/?p=635</guid>
		<description><![CDATA[Josh and I were discussing the positioning of Skip to Content links on a website. In the past I've placed these in the first menu on the page, usually positioned under the header.]]></description>
			<content:encoded><![CDATA[<p>Big Red Tin co-author, Josh, and I were discussing the positioning of <em>Skip to Content</em> links on a website. In the past I&#8217;ve placed these in the first menu on the page, usually positioned under the header.</p>
<p>According to the <a title="fangs plugin for firefox" href="http://www.standards-schmandards.com/projects/fangs/">fangs plugin</a>, the <a title="JAWS" href="http://www.freedomscientific.com/products/fs/jaws-product-page.asp">JAWS</a> screen reader reads the opening of <a title="Soupgiant.com" href="http://soupgiant.com/">Soupgiant.com</a> as:</p>
<blockquote><p>Page has seven  headings and forty-three  links Soupgiant   vertical bar  Web Production  dash  Internet Explorer Heading level one Link Graphic Soupgiant   vertical bar  Web Production Heading level five Heat and Serve Combine  seventeen  years of web production experience, twenty  years of  television  and  radio experience,  put it all in a very large pot on a  gentle heat.  Stir regularly  and  serve. Soupgiant goes well with croutons  and  a  touch of parsley.List of five  items bullet <strong>This page link  Skip to Content</strong> bullet Link Home bullet Link About bullet Link Contact bullet Link Folio</p>
<p>- my emphasis</p></blockquote>
<p>That&#8217;s a lot of content to get through, on every page of the site, before the Skip to Content link. It would be much better if the skip to content link were earlier on the site.</p>
<p>As the <abbr>HTML</abbr> title of the page is read out by JAWS, the best position would be before the in-page title. The opening content would then read as:</p>
<blockquote><p>Page has seven  headings and forty-three  links Soupgiant   vertical bar  Web Production  dash  Internet Explorer <strong>This page link Skip to Content</strong> Heading level one Link Graphic Soupgiant   vertical bar  Web Production</p>
<p>- again, the emphasis is mine</p></blockquote>
<p>That gives the JAWS user the title of the page and immediately allows them to skip to the page&#8217;s content. I don&#8217;t read the header of on every page of a site, nor should I expect screen reader users to.</p>
<p>I realise screen readers most likely have a feature to skip around the page relatively easily, regardless of how the page is set up but our aim should not be <em>relative</em> ease, our aim should be <em>absolute</em> ease.</p>
<p>As a result, we&#8217;ve decided to move the skip to content links on future sites to earlier in the page.</p>
<p>Sadly, this revelation came up as a result of what I consider to be a limitation of the WordPress 3.0+ function <code><a title="wp_nav_menu" href="http://codex.wordpress.org/Function_Reference/wp_nav_menu">wp_nav_menu</a></code>, the inability to add items at the start of the menu. I should have considered the accessibility implications much earlier. It serves as a reminder, to all web developers, that we should constantly review our practices and past decisions.</p>
<p>If you&#8217;ve recently changed something you&#8217;ve always done, <a title="we'd love to hear about it in the comments" href="http://bigredtin.com/behind-the-websites/skip-to-content-links/#comments">we&#8217;d love to hear about it in the comments</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://bigredtin.com/2010/skip-to-content-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

