<?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>WordPress Theming</title>
	<atom:link href="http://wptheming.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://wptheming.com</link>
	<description>Tutorials, Themes and Plugins</description>
	<lastBuildDate>Thu, 16 May 2013 03:02:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Check if Jetpack Modules Are Enabled</title>
		<link>http://wptheming.com/2013/04/check-if-jetpack-modules-are-enabled/</link>
		<comments>http://wptheming.com/2013/04/check-if-jetpack-modules-are-enabled/#comments</comments>
		<pubDate>Tue, 23 Apr 2013 23:31:55 +0000</pubDate>
		<dc:creator>Devin</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://wptheming.com/?p=5994</guid>
		<description><![CDATA[It&#8217;s pretty easy to check if a Jetpack module is active: Here&#8217;s some popular module names you might be looking for: carousel contact-form custom-css gravatar-hovercards infinite-scroll minileven (mobile theme) sharedaddy shortcodes widgets]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s pretty easy to check if a Jetpack module is active:</p>
<pre class="brush: php; title: ; notranslate">
$jetpack_active_modules = get_option('jetpack_active_modules');
if ( class_exists( 'Jetpack', false ) &amp;&amp; $jetpack_active_modules &amp;&amp; in_array( 'your-module', $jetpack_active_modules ) ) {
      // Do something
}
</pre>
<p><span id="more-5994"></span></p>
<p>Here&#8217;s some popular module names you might be looking for:</p>
<ul>
<li>carousel</li>
<li>contact-form</li>
<li>custom-css</li>
<li>gravatar-hovercards</li>
<li>infinite-scroll</li>
<li>minileven (mobile theme)</li>
<li>sharedaddy</li>
<li>shortcodes</li>
<li>widgets</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://wptheming.com/2013/04/check-if-jetpack-modules-are-enabled/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>JetPack Infinite Scroll + Masonry</title>
		<link>http://wptheming.com/2013/04/jetpack-infinite-scroll-masonry/</link>
		<comments>http://wptheming.com/2013/04/jetpack-infinite-scroll-masonry/#comments</comments>
		<pubDate>Sun, 14 Apr 2013 18:09:37 +0000</pubDate>
		<dc:creator>Devin</dc:creator>
				<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://wptheming.com/?p=5852</guid>
		<description><![CDATA[I added support for Jetpack Infinite Scroll on a theme of mine that uses Masonry recently. Since I couldn&#8217;t find any good code snippets or recommendations for how the callback should work I wanted to share a couple methods I tried. If anyone has improvements or recommendations, please let me know. All of these examples [...]]]></description>
				<content:encoded><![CDATA[<p>I added support for Jetpack Infinite Scroll on a theme of mine that uses Masonry recently.</p>
<p>Since I couldn&#8217;t find any good code snippets or recommendations for how the callback should work I wanted to share a couple methods I tried.  If anyone has improvements or recommendations, please let me know.</p>
<p>All of these examples use the &#8220;post-load&#8221; javascript event that Jetpack triggers.  You can read about that on the Jetpack Infinite Scroll <a href="http://jetpack.me/support/infinite-scroll/">documentation page</a>.<span id="more-5852"></span></p>
<h3>The Simplest</h3>
<p>Trigger a re-layout after the new elements load in.  The only issue with this that I&#8217;ve seen is a flash of un-organized posts layered on top of each other before the re-layout actually happens.  (Solution found in this <a href="http://wordpress.org/support/topic/infinite-scroll-support-and-jetpack">WordPress.org thread</a>).</p>
<pre class="brush: jscript; title: ; notranslate">
jQuery( document ).ready( function( $ ) {
	setInterval( function() {
     	$( '#content' ).masonry( 'reload' );
     }, 300 );
});
</pre>
<h3>More Convoluted</h3>
<p>Desandro recommends using the <a href="http://masonry.desandro.com/docs/methods.html">appended method</a> in his docs.  This is a bit more complicated to implement because you need to figure out which are the new elements.</p>
<p>Jetpack doesn&#8217;t pass the new elements in the &#8220;post-load&#8221; event, but does append a new div &#8220;.infinite-wrap&#8221; with a unique id &#8220;#infinite-view-1&#8243;.  So, if you keep track of how many times the event has fired, you&#8217;ll be able find the div that contains the new elements.</p>
<p>Here was my attempt at that (works, but the new element layout never seems to be 100% consistent):</p>
<pre class="brush: jscript; title: ; notranslate">
jQuery( document ).ready( function( $ ) {
     infinite_count = 0;
     // Triggers re-layout on infinite scroll
     $( document.body ).on( 'post-load', function () {
	infinite_count = infinite_count + 1;
	var $container = $('#content');
	var $selector = $('#infinite-view-' + infinite_count);
	var $elements = $selector.find('.hentry');
	$elements.hide();
	$container.masonry( 'appended', $elements, true );
	$elements.fadeIn();
     });
});
</pre>
<h3>Final</h3>
<p>This final method I went with is a bit of the mix between the two.  It uses the &#8220;reload&#8221; method which seems to be more consistent, but also keeps track of which are the new elements and fades them in as they load.  This seemed to create a smoother visual effect than simply popping them into place.</p>
<pre class="brush: jscript; title: ; notranslate">
jQuery( document ).ready( function( $ ) {
     infinite_count = 0;
     // Triggers re-layout on infinite scroll
     $( document.body ).on( 'post-load', function () {
	infinite_count = infinite_count + 1;
	var $container = $('#content');
	var $selector = $('#infinite-view-' + infinite_count);
	var $elements = $selector.find('.hentry');
	$elements.hide();
	$container.masonry( 'reload' );
	$elements.fadeIn();
     });
});
</pre>
<h3>Feedback</h3>
<p>If you have any suggestions or feedback as to improve this code, please let me know.</p>
<h3>Other Resources</h3>
<ul>
<li><a href="http://jetpack.me/support/infinite-scroll/">Infinite Scroll Jetpack Docs</a></li>
<li><a href="http://ottopress.com/2012/jetpack-and-the-infinite-scroll/">Jetpack Infinite Scroll Tutorial by Otto</a></li>
<li><a href="http://wptheming.com/2012/03/infinite-scroll-to-wordpress-theme/">Add Infinite Scroll to Any WordPress Theme (Not Using Jetpack)</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://wptheming.com/2013/04/jetpack-infinite-scroll-masonry/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Lazy Loading Images</title>
		<link>http://wptheming.com/2013/03/lazy-loading-images/</link>
		<comments>http://wptheming.com/2013/03/lazy-loading-images/#comments</comments>
		<pubDate>Wed, 20 Mar 2013 04:19:09 +0000</pubDate>
		<dc:creator>Devin</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wptheming.com/?p=5456</guid>
		<description><![CDATA[Images are generally the heaviest assets on a webpage- so if you&#8217;re interested in fast load times for users, this is one of the best places to optimize. Lazy Load Your Images One popular technique for speeding up the initial load time is called &#8220;lazy loading&#8221;. It works by replacing the source of images (src=&#8221;/example.gif&#8221;) [...]]]></description>
				<content:encoded><![CDATA[<p>Images are generally the heaviest assets on a webpage- so if you&#8217;re interested in fast load times for users, this is one of the best places to optimize.</p>
<h3>Lazy Load Your Images</h3>
<p>One popular technique for speeding up the initial load time is called &#8220;lazy loading&#8221;.  It works by replacing the source of images (src=&#8221;/example.gif&#8221;) with a transparent placeholder image (src=&#8221;/pixel.gif&#8221;).  This allows everything else on the page (text,fonts,scripts,etc) to render first.<span id="more-5456"></span></p>
<p>The original source for the image is generally saved into a data attribute, such as &#8220;data-src&#8221;, so it can be accessed in later.</p>
<p>This is helpful because we now have complete control over when images get loaded.  At any time the source of the image (src=&#8221;/transparent.gif&#8221;) can be replaced by the actual source in the data attribute.  (See <a href="https://gist.github.com/devinsays/5185162">a simple jQuery plugin</a> example).</p>
<p>Several lazy load scripts also work by only loading in the actual images once they enter the viewport, which means the images in the footer won&#8217;t load in until the user has actually scrolled down that far.  This can save bandwidth for the user as images that don&#8217;t get viewed, won&#8217;t get loaded.</p>
<p>Also, many jQuery plugins use a quick fadeIn function when replacing images with their actual source, which can be a nice visual effect.</p>
<h3>Lazy Loading in WordPress</h3>
<p>The key in WordPress is to filter the_content, post_thumbnail_html, and get_avatar content so that any images will have their source replaced by the transparent placeholder.</p>
<p>The best solution I found for this is in the <a href="http://wordpress.org/extend/plugins/lazy-load/">Lazy Load plugin</a> code by Automattic, Jake Goldman, 10Up, and Mohammad Jangda.  If you&#8217;re simply looking for the easiest way to lazy load images on your site I highly recommend using the plugin.</p>
<p>The Lazy Load plugin uses a single function to filter any $content passed to it, and replace any images within that $content with the placeholder image.  Here&#8217;s what it looks like (slightly modifed):</p>
<pre class="brush: php; title: ; notranslate">
function add_image_placeholders( $content ) {
	// Don't lazyload for feeds, previews, mobile
	if( is_feed() || is_preview() || ( function_exists( 'is_mobile' ) &amp;&amp; is_mobile() ) )
		return $content;

	// Don't lazy-load if the content has already been run through previously
	if ( false !== strpos( $content, 'data-src' ) )
		return $content;

	// In case you want to change the placeholder image
	$placeholder_image = apply_filters( 'lazyload_images_placeholder_image', get_template_directory_uri() . '/images/pixel.gif' );

	// This is a pretty simple regex, but it works
	$content = preg_replace( '#&lt;img([^&gt;]+?)src=[\'&quot;]?([^\'&quot;\s&gt;]+)[\'&quot;]?([^&gt;]*)&gt;#', sprintf( '&lt;img${1}src=&quot;%s&quot; data-src=&quot;${2}&quot;${3}&gt;&lt;noscript&gt;&lt;img${1}src=&quot;${2}&quot;${3}&gt;&lt;/noscript&gt;', $placeholder_image ), $content );

	return $content;
}
</pre>
<p>Then, you can add your filters to replace images in specific bits of content.</p>
<p><strong>Post Content:</strong></p>
<pre class="brush: php; gutter: false; title: ; notranslate">
add_filter( 'the_content', 'add_image_placeholders', 99 );
</pre>
<p><strong>Featured Images:</strong></p>
<pre class="brush: php; gutter: false; title: ; notranslate">
add_filter( 'post_thumbnail_html', 'add_image_placeholders', 11 );
</pre>
<p><strong>Avatars (generally in comments):</strong></p>
<pre class="brush: php; gutter: false; title: ; notranslate">
add_filter( 'get_avatar', 'add_image_placeholders', 11 );
</pre>
<h3>Javascript</h3>
<p>Once you&#8217;ve implemented the code above in your theme, you shouldn&#8217;t be seeing any images in the content that you filtered- just the placeholder pixel.</p>
<p>So, now you can replace the images when you choose with a bit of jQuery:</p>
<pre class="brush: jscript; gutter: false; title: ; notranslate">
jQuery('img').attr('src',jQuery(this).attr('data-src'));
</pre>
<p>The Lazy Load WordPress plugin uses <a href="https://github.com/artzstudio/jQuery-Sonar/blob/master/jquery.sonar.js">jQuery Sonar</a>, which doesn&#8217;t replace images until it is in the viewport window.</p>
<p>There are also a ton of other scripts that do something similar.  I say find one that works for you (it&#8217;ll likely need a bit of customization), or roll your own.</p>
<h3>Should you lazy load images in a theme?</h3>
<p>I originally had a homebrewed version for lazy loading thumbnails in my <a href="http://wptheming.com/2013/03/visual-theme/">Visual theme</a>, but have since decided to <a href="https://github.com/devinsays/visual/commit/bc6e1bf944025b3d4fdc207ed4dff87cf338fbae">remove it</a>.</p>
<p>I think functionality like this is much better handled by a plugin like <a href="http://wordpress.org/extend/plugins/lazy-load/">Lazy Load</a>.  I plan to start encouraging users to install this plugin, and may even add a notice and automatic loader for it.</p>
]]></content:encoded>
			<wfw:commentRss>http://wptheming.com/2013/03/lazy-loading-images/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Visual Theme</title>
		<link>http://wptheming.com/2013/03/visual-theme/</link>
		<comments>http://wptheming.com/2013/03/visual-theme/#comments</comments>
		<pubDate>Wed, 06 Mar 2013 02:50:17 +0000</pubDate>
		<dc:creator>Devin</dc:creator>
				<category><![CDATA[Downloads]]></category>

		<guid isPermaLink="false">http://wptheming.com/?p=5277</guid>
		<description><![CDATA[Visual is a free theme designed to showcase photography, artwork and images in a neat masonry grid layout. Theme Features Masonry layout: Regardless of the featured image height and width (or even if no image is selected) the posts will look great in a nice dynamic grid. Responsive Layout: Visual looks great on small screens, [...]]]></description>
				<content:encoded><![CDATA[<p>Visual is a free theme designed to showcase photography, artwork and images in a neat masonry grid layout.</p>
<p><a href="http://themes.wptheming.com/visual"><img src="http://wptheming.wpengine.netdna-cdn.com/wp-content/uploads/2013/03/visual-theme.png" alt="visual-theme" width="600" height="450" class="alignnone size-full wp-image-5289" /></a><span id="more-5277"></span></p>
<h3>Theme Features</h3>
<ul>
<li>Masonry layout:  Regardless of the featured image height and width (or even if no image is selected) the posts will look great in a nice dynamic grid.</li>
<li>Responsive Layout: Visual looks great on small screens, such as tablets and smartphones, as well as on laptops and desktops.</li>
<li>Three color schemes: Light, Dark and Minimal</li>
<li>Typography: Uses <a href="http://www.theleagueofmoveabletype.com/raleway">Raleway</a>, a beautiful webfont by Matt McInerney and served by Google Fonts</li>
<li>Icon Font:  Pixel dense retina displays look great with this theme because of the icon gylphs from <a href="http://www.entypo.com/">Entypo</a>, by Daniel Bruce.</li>
<li>Solid code: Visual is built off of the <a href="http://underscores.me/">Underscores</a> starter theme and uses WordPress best practices.</li>
</ul>
<h3>How to Use the Theme</h3>
<ul>
<li>Download the theme and activate</li>
<li>Set your menu in WordPress (under &#8220;Appearance&#8221; > &#8220;Menus&#8221;)</li>
<li>If images don&#8217;t show up by default, you may need to set the featured image.  Edit your post and click &#8220;Set featured image&#8221;.</li>
<li>If you are making changes to the CSS or template files, consider using a child theme.  You can <a href="http://wptheming.wpengine.netdna-cdn.com/wp-content/uploads/2013/03/visual-child.zip">download this one</a> to start with.</a></li>
</ul>
<h3>WordPress.com Users</h3>
<p>A version of Visual has been built for WordPress.com.  You can get it for <a href="http://visualdemo.wordpress.com/">free here</a>.  If you&#8217;re using Visual on WordPress.com you won&#8217;t be able to alter the template code or use third-party plugins, but you can still make some css changes with <a href="http://en.support.wordpress.com/custom-design/">custom design upgrade</a>.</p>
<h3>Theme Demo</h3>
<p><a href="http://themes.wptheming.com/visual/">View the Demo</a></p>
<h3>Get the Theme</h3>
<p><a href="http://wordpress.org/extend/themes/visual">Download from WordPress.org</a></p>
<h3>Upgrade</h3>
<p>For additional options, features, and support, check out <a href="http://wptheming.com/visual/">Visual+</a>.  Purchases help to support both the free and paid versions.  <a href="http://wptheming.com/visual/">Read more</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://wptheming.com/2013/03/visual-theme/feed/</wfw:commentRss>
		<slash:comments>69</slash:comments>
		</item>
		<item>
		<title>Drop Down Menu Indicator</title>
		<link>http://wptheming.com/2013/03/drop-down-menu-indicator/</link>
		<comments>http://wptheming.com/2013/03/drop-down-menu-indicator/#comments</comments>
		<pubDate>Sun, 03 Mar 2013 22:38:12 +0000</pubDate>
		<dc:creator>Devin</dc:creator>
				<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://wptheming.com/?p=5235</guid>
		<description><![CDATA[I think it&#8217;s important to give users a visual cue when menu items have a drop down menu. One way I&#8217;ve handled this in the past is to use the Superfish jQuery plugin, which adds a class to any list items with children. This allows them to be styled differently- with a background image of [...]]]></description>
				<content:encoded><![CDATA[<p>I think it&#8217;s important to give users a visual cue when menu items have a drop down menu.</p>
<p>One way I&#8217;ve handled this in the past is to use the Superfish jQuery plugin, which adds a class to any list items with children.  This allows them to be styled differently- with a background image of a down arrow (for instance).</p>
<p><img src="http://wptheming.wpengine.netdna-cdn.com/wp-content/uploads/2013/03/menu-example.gif" alt="menu-example" width="383" height="63" class="alignnone size-full wp-image-5248" /></p>
<p>However, I just saw a new theme released by Paul de Wouters called <a href="http://wordpress.org/extend/themes/spine">Spine</a>.  Instead of using javascript to apply the class- he uses a custom <a href="https://github.com/pdewouters/spine-theme/blob/master/includes/topbar-walker.php">Walker_Nav_Menu</a> so that the class is added to the markup directly.</p>
<p>I think this is a much better way to do it, and solves an issue I&#8217;ve seen in some themes where the menu items shift a bit when the new classes and styling are applied with javascript.<br />
<span id="more-5235"></span></p>
<h3>Custom Walker Code</h3>
<p>I&#8217;ve adapted Paul&#8217;s code a little bit so it just adds a &#8220;has-children&#8221; css class to any top level &#8220;li&#8221; that has a &#8220;ul&#8221; contained within it:</p>
<pre class="brush: php; title: ; notranslate">
class Custom_Nav_Walker extends Walker_Nav_Menu {

	function display_element( $element, &amp;$children_elements, $max_depth, $depth=0, $args, &amp;$output ) {
		$id_field = $this-&gt;db_fields['id'];
		if ( !empty( $children_elements[$element-&gt;$id_field] ) &amp;&amp; ( depth == 0 ) ) {
			$element-&gt;classes[] = 'has-children'; // Use any classname you like
		}
		Walker_Nav_Menu::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
	}
	
}
</pre>
<p>Then, when you call the menu in the theme, make sure to include the walker:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php wp_nav_menu( array( 'theme_location' =&gt; 'primary', 'walker' =&gt; new Visual_Nav_Walker(), 'depth' =&gt; '2' ) ); ?&gt;
</pre>
<p>However, for some reason the above code does not fall back to wp_page_menu properly when no menu is set.  So, this is my workaround:</p>
<pre class="brush: php; title: ; notranslate">
if ( has_nav_menu( 'primary' ) ) {
     wp_nav_menu( array( 'theme_location' =&gt; 'primary', 'walker' =&gt; new Visual_Nav_Walker(), 'depth' =&gt; '2' ) );
} else {
     wp_page_menu();
}
</pre>
<h3>Menu Filter (Updated 3/20/13)</h3>
<p>Chip Bennet posted <a href="https://gist.github.com/devinsays/5210667">an alternative approach</a> using a filter on wp_nav_menu_objects to the WordPress Theme Reviewers List.  This approach seems a bit more straightforward than a walker, so it&#8217;s also worth checking out.</p>
<h3>Styling the List Item</h3>
<p>There&#8217;s many ways you could go about styling this list item with the &#8220;has-children&#8221; class.  For a new theme I&#8217;ve been working on, I already use glyphs from the <a href="http://www.entypo.com/">Entypo icon font</a>- and I think the &#8220;chevron-small-down&#8221; from this collection works great as a drop down menu indicator.</p>
<p>To use it with my menu (.main-navigation) I just needed to add this CSS:</p>
<pre class="brush: css; title: ; notranslate">
.main-navigation li {
     float: left;
     position: relative;
}
.main-navigation li.has-children a {
     padding-right:40px;
}
.main-navigation li.has-children &gt; a:after {
     content:'\e760';
     font-family: 'entypo';
     position: absolute;
     right:20px;
     speak: none;
}
</pre>
<p>(For more about using icon fonts, <a href="http://wptheming.com/2012/12/icon-fonts/">see this post</a>)</p>
<p>I&#8217;ve also been thinking a &#8220;has-children&#8221; class might be a good core feature.  Any thoughts? </p>
]]></content:encoded>
			<wfw:commentRss>http://wptheming.com/2013/03/drop-down-menu-indicator/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>TypeKit Code Snippet</title>
		<link>http://wptheming.com/2013/02/typekit-code-snippet/</link>
		<comments>http://wptheming.com/2013/02/typekit-code-snippet/#comments</comments>
		<pubDate>Fri, 01 Feb 2013 23:51:41 +0000</pubDate>
		<dc:creator>Devin</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://wptheming.com/?p=4854</guid>
		<description><![CDATA[Assuming you don&#8217;t want to use the TypeKit plugin, here&#8217;s how to enqueue the scripts directly from your theme:]]></description>
				<content:encoded><![CDATA[<p>Assuming you don&#8217;t want to use the TypeKit plugin, here&#8217;s how to enqueue the scripts directly from your theme:</p>
<pre class="brush: php; title: ; notranslate">
/**
 * TypeKit Fonts
 *
 * @since Theme 1.0
 */
function theme_typekit() {
    wp_enqueue_script( 'theme_typekit', '//use.typekit.net/xxxxxxx.js');
}
add_action( 'wp_enqueue_scripts', 'theme_typekit' );

function theme_typekit_inline() {
  if ( wp_script_is( 'theme_typekit', 'done' ) ) { ?&gt;
  	&lt;script type=&quot;text/javascript&quot;&gt;try{Typekit.load();}catch(e){}&lt;/script&gt;
&lt;?php }
}
add_action( 'wp_head', 'theme_typekit_inline' );
</pre>
]]></content:encoded>
			<wfw:commentRss>http://wptheming.com/2013/02/typekit-code-snippet/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Featured Image Meta</title>
		<link>http://wptheming.com/2013/01/featured-image-meta/</link>
		<comments>http://wptheming.com/2013/01/featured-image-meta/#comments</comments>
		<pubDate>Sun, 27 Jan 2013 03:48:48 +0000</pubDate>
		<dc:creator>Devin</dc:creator>
				<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://wptheming.com/?p=4756</guid>
		<description><![CDATA[I&#8217;ve built a couple themes where I&#8217;ve needed to give users more control over how the featured image is displayed for individual posts. The obvious place to put these options are in the thumbnail metabox itself. Display Thumbnail Landscape In this theme the default display of the thumbnails is a cropped to a square next [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve built a couple themes where I&#8217;ve needed to give users more control over how the featured image is displayed for individual posts.  The obvious place to put these options are in the thumbnail metabox itself.</p>
<h3>Display Thumbnail Landscape</h3>
<div class="clearfix" style="margin-bottom:25px">
<img src="http://wptheming.wpengine.netdna-cdn.com/wp-content/uploads/2013/01/meta-banner.jpg" alt="meta-banner" width="282" height="291" class="alignleft size-full wp-image-4758" /></p>
<p>In this theme the default display of the thumbnails is a cropped to a square next to the title. But if the user had a large landscape image, they could choose to display it full width instead.
</p></div>
<p><span id="more-4756"></span></p>
<h3>Option to Display Featured Image in Post Automatically</h3>
<div class="clearfix" style="margin-bottom:25px">
<img src="http://wptheming.wpengine.netdna-cdn.com/wp-content/uploads/2013/01/meta-display.jpg" alt="meta-display" width="282" height="248" class="alignleft size-full wp-image-4757" /></p>
<p>In this theme the featured image is used as a thumbnail on portfolio archive pages, but it is also displayed full size on the portfolio post types.  This option gives users the option to use a different image in the actual post if they prefer.
</p></div>
<h3>Add the Option</h3>
<p>Adding the option is fairly simple, you&#8217;ll just need to hook into the admin_post_thumbnail_html filter:</p>
<pre class="brush: php; gutter: false; title: ; notranslate">
/* Add a checkbox to the featured image metabox */

add_filter( 'admin_post_thumbnail_html', 'theme_featured_image_meta');

function theme_featured_image_meta( $content ) {
	global $post;
	$text = __( &quot;Don't display image on post.&quot;, 'textdomain' );
	$id = 'hide_featured_image';
	$value = esc_attr( get_post_meta( $post-&gt;ID, $id, true ) );
    $label = '&lt;label for=&quot;' . $id . '&quot; class=&quot;selectit&quot;&gt;&lt;input name=&quot;' . $id . '&quot; type=&quot;checkbox&quot; id=&quot;' . $id . '&quot; value=&quot;' . $value . ' &quot;'. checked( $value, 1, false) .'&gt; ' . $text .'&lt;/label&gt;';
    return $content .= $label;
}
</pre>
<h3>Sanitize and Save the Option</h3>
<p>This option will need to be sanitized and saved when the post is updated- like any other custom field in a metabox.</p>
<p>This is a longer topic than I want to cover in this short post, but if you need a tutorial on how to do that I&#8217;d recommend the one on <a href="http://wp.smashingmagazine.com/2011/10/04/create-custom-post-meta-boxes-wordpress/">Smashing Magazine by Justin Tadlock</a>.</p>
<h3>Credits</h3>
<p>The thumbnail images above are from <a href="http://www.alex-kunz.com/">Alexander S. Kunz Photography</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://wptheming.com/2013/01/featured-image-meta/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Getting Started With CodeKit + CSS Preprocessors</title>
		<link>http://wptheming.com/2013/01/codekit-css-preprocessors/</link>
		<comments>http://wptheming.com/2013/01/codekit-css-preprocessors/#comments</comments>
		<pubDate>Fri, 11 Jan 2013 14:45:48 +0000</pubDate>
		<dc:creator>Devin</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wptheming.com/?p=4570</guid>
		<description><![CDATA[I experimented with CSS preprocessing today (both LESS and SASS). I have to admit, it was much easier to set up than I thought and really intuitive to use. To get started, I just downloaded a copy of CodeKit (OSX) and dropped a couple theme directories into it. When that happened, CodeKit started to watch [...]]]></description>
				<content:encoded><![CDATA[<p>I experimented with CSS preprocessing today (both <a href="http://lesscss.org/">LESS</a> and <a href="http://sass-lang.com/">SASS</a>).  I have to admit, it was much easier to set up than I thought and really intuitive to use.</p>
<p>To get started, I just downloaded a copy of <a href="http://incident57.com/codekit/">CodeKit</a> (OSX) and dropped a couple theme directories into it.  When that happened, CodeKit started to watch all the LESS and SASS files in those directories- and automatically compiled them into actual CSS files whenever I saved.</p>
<p>To become more familiar with the syntax, I <a href="https://github.com/devinsays/Less/commits/master">forked a copy</a> of Jared Erickson&#8217;s <a href="https://github.com/alliswell/Less">LESS theme</a> on GitHub and made some edits.  Then I converted it to SASS syntax.  If you&#8217;re completely new both SASS and LESS- I think that&#8217;s a fun small project to do.<span id="more-4570"></span></p>
<p>I didn&#8217;t get deep into the mixins and nesting, but I already see several ways it could improve my workflow.  And honestly, I was just as impressed with the CodeKit UI and features- like live browser reloading, file minification, etc.</p>
<p>Just so you have no reason not to try it too, I made a short video showing how to take a regular WordPress theme and set it up to start using SASS files with CodeKit:</p>
<p><iframe src="http://player.vimeo.com/video/57192888?byline=0&amp;portrait=0" width="600" height="376" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>
<h3>Other Resources</h3>
<ul>
<li><a href="http://css-tricks.com/musings-on-preprocessing/">Musings on Preprocessing</a> (CSS Tricks)
<li><a href="http://sass-lang.com/">SASS Documentation</a></li>
<li><a href="http://lesscss.org/">LESS Documentation</a></li>
<li><a href="http://incident57.com/codekit/">CodeKit</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://wptheming.com/2013/01/codekit-css-preprocessors/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Translatable Javascript Strings</title>
		<link>http://wptheming.com/2013/01/translatable-javascript-strings-in-wordpress/</link>
		<comments>http://wptheming.com/2013/01/translatable-javascript-strings-in-wordpress/#comments</comments>
		<pubDate>Wed, 09 Jan 2013 03:34:24 +0000</pubDate>
		<dc:creator>Devin</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://wptheming.com/?p=4546</guid>
		<description><![CDATA[I&#8217;ve been working on a plugin that needs to update the text of an object via javascript when an element is clicked. Like the rest of my plugin, those strings in the javascript need to be translatable. Thankfully WordPress makes this easy to do. Original Let&#8217;s say this is the script you are enqueuing: Translatable [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been working on a plugin that needs to update the text of an object via javascript when an element is clicked.  Like the rest of my plugin, those strings in the javascript need to be translatable.  Thankfully WordPress makes this easy to do.</p>
<h3>Original</h3>
<p>Let&#8217;s say this is the script you are enqueuing:</p>
<pre class="brush: php; title: ; notranslate">
function prefix_enqueue_custom_script(){
	wp_register_script( 'prefix_custom_script', plugin_dir_url( __FILE__ ) .'js/custom-script.js', array( 'jquery' ) );
        wp_enqueue_script( 'prefix_custom_script' );
}
</pre>
<h3>Translatable</h3>
<p>In this custom script there are two strings that should be translatable: &#8220;upload&#8221; and &#8220;remove&#8221;.  To make this happen we&#8217;ll use the <a href="http://codex.wordpress.org/Function_Reference/wp_localize_script">wp_localize_script</a> function, which gets hooked onto the script handle:</p>
<pre class="brush: php; title: ; notranslate">
function prefix_enqueue_custom_script(){
	wp_register_script( 'prefix_custom_script', plugin_dir_url( __FILE__ ) .'js/custom-script.js', array( 'jquery' ) );
        wp_enqueue_script( 'prefix_custom_script' );
        wp_localize_script( 'prefix_custom_script', 'prefix_object_name', array(
		'upload' =&gt; __( 'upload', 'textdomain' ),
		'remove' =&gt; __( 'remove', 'textdomain' )
	) );
}
</pre>
<h3>Using the Strings</h3>
<p>Now in my javascript, instead of simply using the text &#8220;upload&#8221; and &#8220;remove&#8221; I&#8217;ll use the variables prefix_object_name.upload and prefix_object_name.remove.</p>
]]></content:encoded>
			<wfw:commentRss>http://wptheming.com/2013/01/translatable-javascript-strings-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Icon Fonts</title>
		<link>http://wptheming.com/2012/12/icon-fonts/</link>
		<comments>http://wptheming.com/2012/12/icon-fonts/#comments</comments>
		<pubDate>Sun, 30 Dec 2012 01:48:57 +0000</pubDate>
		<dc:creator>Devin</dc:creator>
				<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://wptheming.com/?p=4399</guid>
		<description><![CDATA[Overview This tutorial explains how to output post meta (comments, tags, categories, edit link) and display a small icon before each one using an icon font. Icon fonts are great for this purpose because they can scale to any size, look great on retina devices, have a smaller file size than images, and use a [...]]]></description>
				<content:encoded><![CDATA[<h3>Overview</h3>
<p>This tutorial explains how to output post meta (comments, tags, categories, edit link) and display a small icon before each one using an icon font.  Icon fonts are great for this purpose because they can scale to any size, look great on retina devices, have a smaller file size than images, and use a single HTTP request.</p>
<h3>Examples</h3>
<style>.icon-font-demo .icon:before {font-size:65px; margin-right:10%; color:#049a79;}</style>
<p class="icon-font-demo"><span class="icon comments-link"></span> <span class="icon cat-links"></span> <span class="icon tag-links"></span> <span class="icon edit-link"></span></p>
<p>An icon font I particularly like (and use in this demo) is <a href="http://www.entypo.com/">Entypo</a> by Daniel Bruce.  There&#8217;s over 250 icon glyphs available in the font and the download size is only 19k.  But there are a lot of <a href="http://css-tricks.com/flat-icons-icon-fonts/">great choices</a> out there to use. (Update: the tags icon is now from <a href="http://fortawesome.github.com/Font-Awesome/">FontAwesome</a>)<span id="more-4399"></span></p>
<h3>Build a Custom Font</h3>
<p>Since you&#8217;ll generally only need a couple of the glyphs in the icon font you use, I recommend using <a href="http://fontello.com/">Fontello</a> to trim the font down to what you need.  In my theme, I only needed five of the glyphs- which took the download size down to 4k!</p>
<p><a href="http://fontello.com/">Fontello</a> also allows you to remap the characters, generates all the CSS you need, and puts it into a nice little download package (for free!).  I didn&#8217;t use the exact CSS Fontello generated, but it was extremely useful to get the ASCII number for the glyphs so that I could easily pop them into a <a href="http://css-tricks.com/css-content/">:before psuedo</a> element in my own stylesheet.</p>
<h3>The Markup/Code</h3>
<p>I&#8217;m about to paste in a big blob of code here that I use to output the post meta.  What this does is:</p>
<ul>
<li>Links to the comments section of the post and displays the number of comments (if there are any)</li>
<li>Outputs the categories the post is listed in, as long as there is more than one category on the site</li>
<li>Outputs the list of tags (separated by commas) if the post has any</li>
<li>Displays the edit link (for users with permissions to edit the post)</li>
</ul>
<p>Most of this is ripped directly out of the <a href="http://underscores.me/">_s theme</a>, which I use as a base for most of my custom themes.</p>
<pre class="brush: php; gutter: false; title: ; notranslate">
&lt;footer class=&quot;entry-meta&quot;&gt;
	&lt;?php if ( ! post_password_required() &amp;&amp; ( comments_open() || '0' != get_comments_number() ) ) : ?&gt;
		&lt;span class=&quot;icon comments-link&quot;&gt;&lt;?php comments_popup_link( __( '&lt;span&gt;Comment&lt;/span&gt;', 'example' ), __( '1 &lt;span&gt;Comment&lt;/span&gt;', 'example' ), __( ' % &lt;span&gt;Comments&lt;/span&gt;', 'example' ) ); ?&gt;&lt;/span&gt;
	&lt;?php endif; ?&gt;
	&lt;?php if ( 'post' == get_post_type() ) :?&gt;
		&lt;?php
			/* translators: used between list items, there is a space after the comma */
			$categories_list = get_the_category_list( __( ', ', 'example' ) );
			if ( $categories_list ) :
		?&gt;
		&lt;span class=&quot;sep&quot;&gt; | &lt;/span&gt;
		&lt;span class=&quot;icon cat-links&quot;&gt;
			&lt;?php printf( __( '&lt;span&gt;Posted in&lt;/span&gt; %1$s', 'example' ), $categories_list ); ?&gt;
		&lt;/span&gt;
		&lt;?php endif; // End if categories ?&gt;
		&lt;?php
			/* translators: used between list items, there is a space after the comma */
			$tags_list = get_the_tag_list( '', __( ', ', 'example' ) );
			if ( $tags_list ) :
		?&gt;
		&lt;span class=&quot;sep&quot;&gt; | &lt;/span&gt;
		&lt;span class=&quot;icon tag-links&quot;&gt;
			&lt;?php printf( __( '&lt;span&gt;Tagged&lt;/span&gt; %1$s', 'example' ), $tags_list ); ?&gt;
		&lt;/span&gt;
		&lt;?php endif; // End if $tags_list ?&gt;
	&lt;?php endif; // End if 'post' == get_post_type() ?&gt;

	&lt;?php edit_post_link( __( 'Edit', 'example' ), '&lt;span class=&quot;sep&quot;&gt; | &lt;/span&gt;&lt;span class=&quot;icon edit-link&quot;&gt;', '&lt;/span&gt;' ); ?&gt;
&lt;/footer&gt;&lt;!-- .entry-meta --&gt;
</pre>
<h3>Styling</h3>
<p>Now that the markup is in place, we can style it with the icon font.</p>
<p>You&#8217;ll need to load the font at the top of style.css in your theme.  In mine, I use a custom font generated by Fontello called &#8220;ExampleCustom&#8221;:</p>
<pre class="brush: css; gutter: false; title: ; notranslate">
@font-face {
    font-family: 'ExampleCustom';
    src: url('fonts/example.eot');
    src: url('fonts/example.eot?#iefix') format('embedded-opentype'),
         url('fonts/example.woff') format('woff'),
         url('fonts/example.ttf') format('truetype'),
         url('fonts/example.svg') format('svg');
    font-weight: normal;
    font-style: normal;
}
</pre>
<p>Below is the styling I used for the meta elements. Basically we&#8217;re just using a :before psuedo element to output the glyph character (e.g. content: &#8216;\270e&#8217;;).  The characters will be different depending on the icon font use.</p>
<pre class="brush: css; title: ; notranslate">
footer.entry-meta a {
	color:#555;
	text-decoration: none;
}
footer.entry-meta a:hover {
	color: #0a836b;
}
footer.entry-meta .sep {
	margin:0 8px;
}
.cat-links span, .tag-links span {
	width:0;
	display: inline-block;
	text-indent:-9999em;
}
.icon:before {
	vertical-align: -2px;
	color:#454545;
	font-family: &quot;ExampleCustom&quot;, sans-serif;
	font-size:20px;
	font-size:2.0rem;
	margin:0 4px 0 0;
}
.icon:hover:before {
	color: #000;
}
.comments-link:before {
	content: &quot;\e720&quot;;
}
.cat-links:before {
	content: &quot;\1f4c4&quot;;
}
.tag-links:before {
	content: &quot;\e70d&quot;;
}
.edit-link:before {
	content: '\270e';
}
</pre>
<p>The text for &#8220;Posted In&#8221; and &#8220;Tagged&#8221; would normally be displayed, but since I have an icon font to convey the message, that text is hidden with a &#8220;text-indent:-9999em;&#8221;.</p>
<h3>Download an Example</h3>
<p>If you want to play with a real life example, check out <a href="https://github.com/devinsays/light">the theme</a> I&#8217;ve been working on.</p>
]]></content:encoded>
			<wfw:commentRss>http://wptheming.com/2012/12/icon-fonts/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Display a &#8220;Pretty&#8221; Post Date</title>
		<link>http://wptheming.com/2012/12/display-a-pretty-post-date/</link>
		<comments>http://wptheming.com/2012/12/display-a-pretty-post-date/#comments</comments>
		<pubDate>Thu, 27 Dec 2012 17:44:14 +0000</pubDate>
		<dc:creator>Devin</dc:creator>
				<category><![CDATA[Snippets]]></category>

		<guid isPermaLink="false">http://wptheming.com/?p=4368</guid>
		<description><![CDATA[On services like Twitter and Facebook you&#8217;ll see content that was posted &#8220;posted X minutes ago&#8221; or &#8220;posted X days ago&#8221;. I like that. I think it&#8217;s bit more personalized than simply using the long form date (e.g. December 27th, 2012). On my site I now display the post dates as a human time diff [...]]]></description>
				<content:encoded><![CDATA[<p>On services like Twitter and Facebook you&#8217;ll see content that was posted &#8220;posted X minutes ago&#8221; or &#8220;posted X days ago&#8221;.  I like that.  I think it&#8217;s bit more personalized than simply using the long form date (e.g. December 27th, 2012).</p>
<p>On my site I now display the post dates as a <a href="http://codex.wordpress.org/Function_Reference/human_time_diff">human time diff</a> (aka, a human readable format) if the post is less than a month old.  If it&#8217;s older than I month, I use the standard date format selected inside the WordPress dashboard under &#8220;Settings > General : Date Format&#8221; (in my case Month Day, Year).</p>
<h3>The Code Snippet</h3>
<pre class="brush: php; title: ; notranslate">
if ( ! function_exists( 'example_posted_on' ) ) :
/**
 * Prints HTML with meta information for the current post-date/time and author.
 *
 * @since Example 1.0
 */
 
function example_posted_on() {
	$post_date = the_date( 'Y-m-d','','', false );
	$month_ago = date( &quot;Y-m-d&quot;, mktime(0,0,0,date(&quot;m&quot;)-1, date(&quot;d&quot;), date(&quot;Y&quot;)) );
	if ( $post_date &gt; $month_ago ) {
		$post_date = sprintf( __( '%1$s ago', 'example' ), human_time_diff( get_the_time('U'), current_time('timestamp') ) );
	} else {
		$post_date = get_the_date();
	}
	printf( __( 'Posted &lt;time class=&quot;entry-date&quot; datetime=&quot;%1$s&quot; pubdate&gt;%2$s&lt;/time&gt;&lt;span class=&quot;byline&quot;&gt; by &lt;span class=&quot;author vcard&quot;&gt;%3$s&lt;/span&gt;&lt;/span&gt;', 'example' ),
		esc_attr( get_the_date( 'c' ) ),
		esc_html( $post_date ),
		esc_html( get_the_author() )
	);
}

endif;
</pre>
<h3>Explanation</h3>
<p><b>Use a Function</b></p>
<p>Instead of adding this code to each template where I need to display the date, I&#8217;ve wrapped it in the function &#8220;example_posted_on&#8221; so I can reuse and easily update it if needed.  Whenever I need to call the date, I just use example_posted_on().</p>
<p>Since this is used in a theme of mine, I&#8217;ve wrapped it in a &#8220;if ( ! function_exists( &#8216;example_posted_on&#8217; ) ) :&#8221; check so someone can easily override it from a child theme if they need to.</p>
<p><b>Compare the Timestamps</b></p>
<p>To check if the date of the post is older than a month, I generate a timestamp to compare with the one from the post:</p>
<pre class="brush: php; title: ; notranslate">
$month_ago = date( &quot;Y-m-d&quot;, mktime(0,0,0,date(&quot;m&quot;)-1, date(&quot;d&quot;), date(&quot;Y&quot;)) );
</pre>
<p>You could easily change this to be to any time period you want and compare those timestamps instead.</p>
<p><b>Make Sure it is Translatable</b></p>
<p>If you&#8217;re wondering why the strings are wrapped in &#8220;sprintf&#8221; and &#8220;printf&#8221;, that&#8217;s so everything can be translated if someone wants to localize the theme for a different language.  Make sure to change the textdomain &#8220;example&#8221; to whatever you&#8217;ve defined as the textdomain in your theme.</p>
<p><b>Be Careful of Caching</b></p>
<p>If your site makes use of heavy caching (W3C Total Cache, and/or a good CDN) your post &#8220;day&#8221; may get stuck for a while.  If it&#8217;s included as part of a publicly released theme you may want to give users an option to turn it off and use the regular date instead.</p>
<p>Another option (in that case), would be to use javascript to look for the post date, and convert it to a human readable format on front end instead- but that&#8217;s probably fodder for another post.</p>
]]></content:encoded>
			<wfw:commentRss>http://wptheming.com/2012/12/display-a-pretty-post-date/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Multivariate Testing with Optimizely</title>
		<link>http://wptheming.com/2012/12/multivariate-testing-optimizely/</link>
		<comments>http://wptheming.com/2012/12/multivariate-testing-optimizely/#comments</comments>
		<pubDate>Sun, 23 Dec 2012 21:21:20 +0000</pubDate>
		<dc:creator>Devin</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://wptheming.com/?p=4114</guid>
		<description><![CDATA[I do a lot of multivariate testing on high-traffic websites with Optimizely, a powerful and easy-to-use web application. This video explains how to use Optimizely to create a basic multivariate test (relying on javascript to push events and create variants). Some of that code is also posted below. Tracking Events I fire off a tracking [...]]]></description>
				<content:encoded><![CDATA[<p>I do a lot of multivariate testing on high-traffic websites with <a href="http://www.optimizely.com">Optimizely</a>, a powerful and easy-to-use web application.</p>
<p>This video explains how to use Optimizely to create a basic multivariate test (relying on javascript to push events and create variants). Some of that code is also posted below.</p>
<p><iframe src="http://www.youtube.com/embed/uAZbGMcp98Q?list=UU30JyMPp9S6DT0yZ4Gj2ICQ" frameborder="0" width="640" height="360"></iframe><span id="more-4114"></span></p>
<h3>Tracking Events</h3>
<p>I fire off a tracking event for anything I want to track on the page.  My primary use for this is to measure clicks, and to see my variants have any effect on this (e.g. measuring clicks on a conversion module).</p>
<p>Here&#8217;s some of the example code I used on WP Theming to measure clicks on the different sections of the page.  I put this code under &#8220;Options -> Global Javascript&#8221; in the Optimizely editor:</p>
<pre class="brush: jscript; gutter: false; title: ; notranslate">
window.optimizely = window.optimizely || [];

$(&quot;#masthead a&quot;).live(&quot;mousedown touchstart&quot;, function() {
     window.optimizely.push(['trackEvent', 'masthead']);
});

$(&quot;.hentry a&quot;).live(&quot;mousedown touchstart&quot;, function() {
     window.optimizely.push(['trackEvent', 'hentry']);
});

$(&quot;#comments a&quot;).live(&quot;mousedown touchstart&quot;, function() {
     window.optimizely.push(['trackEvent', 'comments']);
});

$(&quot;#colophon a&quot;).live(&quot;mousedown touchstart&quot;, function() {
     window.optimizely.push(['trackEvent', 'footer']);
});
</pre>
<p>In this example I am tracking any clicks on any link in the #masthead, .hentry, #comments, and #colophon.  You&#8217;ll also need to add a goal for each of these track events if you want to see it in the results dashboard.    </p>
<p>To set up a new goal, click &#8220;Set Up Goals&#8221; in the Optimizely editor, then &#8220;Add a Goal&#8221;, then &#8220;Create a New Goal&#8221;.  Under &#8220;What to Track&#8221;, select &#8220;Custom Event&#8221;.  You can name your goal whatever like, but make sure the &#8220;Custom Event to track&#8221; matches trackEvent you&#8217;re pushing in the javascrip (e.g. masthead, hentry, comments, footer).</p>
<h3>Create a Variant</h3>
<p>To create a new variant, just click &#8220;Add Variation&#8221; from the Optimizely editor and name it.  Then click the &#8220;Edit Code&#8221; tab at the bottom of the screen, and put in whatever jQuery you want to alter the appearance of the variant.  In the WordPress.com example, I used:</p>
<pre class="brush: jscript; gutter: false; title: ; notranslate">
$('#home-signup h4').text('Free Account');
</pre>
<h3>Using Optimizely with WordPress</h3>
<p>Optimizely has their <a href="http://support.optimizely.com/customer/portal/articles/457323-how-do-i-integrate-optimizely-with-my-wordpress-site-">own plugin to embed the code</a>, but as I mentioned in the screencast, it&#8217;s a bit of a blunt instrument.</p>
<p>If you&#8217;re comfortable editing code, I&#8217;d probably just enqueue it yourself and only load it on the pages you need:</p>
<pre class="brush: php; gutter: false; title: ; notranslate">
function prefix_optimizely() {
	if ( !is_single() ) {
		wp_enqueue_script( 'optimizely', 'http://cdn.optimizely.com/js/xxxxxxx.js', array( 'jquery' ), false, true );
	}
}
add_action('wp_enqueue_scripts', 'prefix_optimizely');
</pre>
<p>This above code (for example) would just load the Optimizely snippet on single post pages.</p>
<h3>Is Optimizely Worth It?</h3>
<p>If you sell any sort of product and have a good amount of traffic to your site, I think it&#8217;s worth investigating how users interact with your site.  If you could change the color of a link, move a button, or use a different image on your home page, and that led to a 5% increase in sales, would that be worth it?</p>
<p><b>Sidenote:</b>  If you need help setting up variants in <a href="http://www.optimizely.com">Optimizely</a> for your WordPress site, <a href="http://wptheming.com/contact/">get in touch</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://wptheming.com/2012/12/multivariate-testing-optimizely/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
