<?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; themes</title>
	<atom:link href="http://bigredtin.com/tag/themes/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>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>Charging for themes? Do the right thing!</title>
		<link>http://bigredtin.com/2009/charging-for-themes-do-the-right-thing/</link>
		<comments>http://bigredtin.com/2009/charging-for-themes-do-the-right-thing/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 00:23:42 +0000</pubDate>
		<dc:creator>Peter Wilson</dc:creator>
				<category><![CDATA[Behind the Websites]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://soupgiant.com/?p=240</guid>
		<description><![CDATA[Of all the Wordpress functions, I think wp_register_script, wp_register_style, wp_enqueue_script, and, wp_enqueue_style are the most elegant.]]></description>
			<content:encoded><![CDATA[<p>Of all the WordPress functions, I think <code>wp_register_script</code>, <code>wp_register_style</code>, <code>wp_enqueue_script</code>, and, <code>wp_enqueue_style</code> are the most elegant. It&#8217;s possible to get away with using only the <code>wp_enqueue_*</code> functions, but I prefer to use both for a little bit more control.</p>
<p>For the uninitiated, these functions allow you to add JavaScript and CSS files to the header (or footer, in later versions of <abbr title="WordPress">WP</abbr>) without running of the risk of another plugin adding the same file, that is, you avoid the following:</p>
<pre><code>&lt;script type="text/javascript" source="http://.../a-plugin/jQuery.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" source="http://.../a-plugin/plugin.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" source="http://.../my-theme/jQuery.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" source="http://.../my-theme/theme.js"&gt;&lt;/script&gt;</code></pre>
<p>If you develop themes or plugins for WordPress and are unaware of these functions, you should refer to the codex to get the low down on at least <code><a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_script">wp_enqueue_script</a></code>, and <code><a href="http://codex.wordpress.org/Function_Reference/wp_enqueue_style">wp_enqueue_style</a></code> &#8211; these register and queue the files, the <code>wp_register_*</code> functions register the file ready to be queued for output.</p>
<h4>The Rant</h4>
<p>Despite the value these functions can add to themes and plugins, they are under-utilised in development. The functions have wider adoption in plug-in development, but it&#8217;s still well below 100%. In theme development adoption is virtually non-existent (at least in the themes I&#8217;ve used).</p>
<p>This failure to code properly is evenly spread across both free and paid themes. I?m happy to look the other way for free themes. After all, the motivation behind the theme may have been to learn WordPress development.</p>
<p>In commercial themes, particularly those above the US$30-$35 price point, it&#8217;s downright frustrating that these products haven&#8217;t been developed properly.</p>
<p>When someone purchases a theme, they shouldn&#8217;t have to debug the product to find out why a JavaScript framework is being included twice. The reason for the purchase is that they either don&#8217;t want to, or know how to, develop.</p>
<h4>Avoiding costly mistakes</h4>
<p>Evaluating a commercial theme on behalf of a client triggered this rant. At $195, it&#8217;s quite expensive in the world of WordPress. As I was viewing the source code of the online demo, I discovered the <em>faux pas</em>. We&#8217;ll advise against using that theme as a starting point. In fact, within short time we&#8217;d found a theme $195 cheaper that would do the job.</p>
<p>Looking at the source code of a demo site is usually enough to tell you how the theme is inserting its scripts:</p>
<ul>
<li>Both &lt;link&gt; and &lt;script&gt; tags will use single quotes around attributes (&#8216;), rather than double quotes (&#8220;),</li>
<li>CSS &lt;link&gt; tags will have an ID attribute ending in -css, eg: id=&#8217;shadowbox-css-css&#8217;, and,</li>
<li>JavaScript and CSS files include the version number as a query string eg jQuery.js?ver=1.3.2 (although a hook can be used to remove this)</li>
</ul>
<p>Making sure that the <code>wp_register_script</code>, <code>wp_register_style</code>, <code>wp_enqueue_script</code>, and, <code>wp_enqueue_style</code> are included properly will save time, bandwidth and also avoid some detrimental conflicts.</p>
]]></content:encoded>
			<wfw:commentRss>http://bigredtin.com/2009/charging-for-themes-do-the-right-thing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

