<?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>Andrew Norcross &#187; Tutorials</title>
	<atom:link href="http://andrewnorcross.com/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewnorcross.com</link>
	<description>Code, Coffee, and Camel Lights</description>
	<lastBuildDate>Fri, 20 Jan 2012 16:39:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Stop hyperlinking images!</title>
		<link>http://andrewnorcross.com/tutorials/functions-file/stop-hyperlinking-images/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=stop-hyperlinking-images</link>
		<comments>http://andrewnorcross.com/tutorials/functions-file/stop-hyperlinking-images/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 03:35:56 +0000</pubDate>
		<dc:creator>Norcross</dc:creator>
		
		<guid isPermaLink="false">http://andrewnorcross.com/?post_type=rkv_tutorials&#038;p=929</guid>
		<description><![CDATA[While I'm sure there is a reason for it, I've never needed it. WordPress will automatically link your images to themselves on upload by default. Here's a quick way to change that.]]></description>
			<content:encoded><![CDATA[<p></p><p>A pet peeve of mine, if you will. By default, WordPress will set the link to any image that you upload to the file itself. That&#8217;s great if you&#8217;re using some sort of LightBox setup, but 99% of the time you aren&#8217;t. It&#8217;s just the image. So if you forget to remove the link&#8230;..no dice.</p>
<p>Well, not if you add this handy line to your functions file</p>
<p><code>update_option('image_default_link_type', 'none');</code></p>
<p>Yep, that&#8217;s it.</p>
<p>** UPDATE 12/21/2011 **</p>
<p>Thanks to <a target="_blank" href="http://mitcho.com/" title="mitcho" target="_blank">@mitcho</a> for pointing out that we don&#8217;t need the option to update every time, only once. So here&#8217;s a slightly modified function to check the value first, then update if it isn&#8217;t set to &#8216;none&#8217;.</p>
<pre class="brush: php; title: ; notranslate">

$image_set = get_option( 'image_default_link_type' );
	if (!$image_set == 'none') {
		update_option('image_default_link_type', 'none');
	}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://andrewnorcross.com/tutorials/functions-file/stop-hyperlinking-images/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Obfuscate email addresses with a shortcode</title>
		<link>http://andrewnorcross.com/tutorials/shortcodes/obfuscate-email-addresses-with-a-shortcode/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=obfuscate-email-addresses-with-a-shortcode</link>
		<comments>http://andrewnorcross.com/tutorials/shortcodes/obfuscate-email-addresses-with-a-shortcode/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 15:30:54 +0000</pubDate>
		<dc:creator>Norcross</dc:creator>
		
		<guid isPermaLink="false">http://andrewnorcross.com/?post_type=rkv_tutorials&#038;p=855</guid>
		<description><![CDATA[Want to display your email address with a straightforward link, but don't want to leave it wide open for spam bots and harvesters? Well, this shortcode may be exactly what you need.]]></description>
			<content:encoded><![CDATA[<p></p><p><strong><em>**UPDATE**</em></strong> I&#8217;ve released a slightly modified version of this into a plugin that has a TinyMCE button. <a target="_blank" href="http://wordpress.org/extend/plugins/safer-email-link/" title="Download the Safer Email Link plugin" target="_blank">You can get it here</a>.</p>
<p>Folks that have been on the web for any length of time know that putting your email address on a forward-facing website is just asking for spam. While Gmail and other providers are pretty good at flagging them, it&#8217;s still an unnecessary burden, especially if you are using your own mailserver. But for many businesses and sites, you&#8217;ve gotta have it out there. So what to do?</p>
<p>The folks over at catswhocode recently published a post with a <a target="_blank" href="http://www.catswhocode.com/blog/10-super-useful-wordpress-shortcodes" title="Useful WP Shortcodes - Cats Who Code" target="_blank" rel="nofollow">handful of WP shortcodes</a>, one of which was obfuscating an email address using a convoluted regex and count method. Well, you could do that. But why not use a built-in WP function?</p>
<p>WordPress has an <a target="_blank" href="http://codex.wordpress.org/Function_Reference/antispambot" title="Antispambot function - WordPress Codex" target="_blank">antispambot function</a> that&#8217;s been in core since version 0.71. The only problem is that you can&#8217;t use it in a post, page, or widget on it&#8217;s own. So I&#8217;ve written a simple shortcode to allow you to call that function wherever you may need it.</p>
<p>This would go into your functions.php file</p>
<pre class="brush: php; title: ; notranslate">
function emailbot_ssc($attr) {
		extract( shortcode_atts( array(
			'address'	=&gt; '',
		), $attr ) );
	return '&lt;a class=&quot;email_link&quot; href=&quot;mailto:'.antispambot($attr['address']).'&quot; title=&quot;Send Us An Email&quot; target=&quot;_blank&quot;&gt;'.antispambot($attr['address']).'&lt;/a&gt;';
	}
add_shortcode(&quot;email&quot;, &quot;emailbot_ssc&quot;);
</pre>
<p>And to use the shortcode (on the HTML tab, not the visual editor)</p>
<pre class="brush: xml; title: ; notranslate">
[email address=&quot;you@emailcompany.com&quot;]
</pre>
<p>that&#8217;s it. And remember, if you need to use this (or any shortcode) in a widget, <a target="_blank" href="http://digwp.com/2010/03/shortcodes-in-widgets/" title="Enable shortcodes in widgets - Digging Into WordPress" target="_blank">you&#8217;ll need to enable it</a> if your theme hasn&#8217;t already done so.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewnorcross.com/tutorials/shortcodes/obfuscate-email-addresses-with-a-shortcode/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Optimize the Contact Form 7 plugin for Thesis (Updated)</title>
		<link>http://andrewnorcross.com/tutorials/tutorials/optimize-the-contact-form-7-plugin-for-thesis/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=optimize-the-contact-form-7-plugin-for-thesis</link>
		<comments>http://andrewnorcross.com/tutorials/tutorials/optimize-the-contact-form-7-plugin-for-thesis/#comments</comments>
		<pubDate>Sat, 25 Jun 2011 23:53:08 +0000</pubDate>
		<dc:creator>Norcross</dc:creator>
				<category><![CDATA[General Ramblings]]></category>
		<category><![CDATA[contact form 7]]></category>
		<category><![CDATA[custom functions]]></category>
		<category><![CDATA[thesis]]></category>

		<guid isPermaLink="false">http://andrewnorcross.com/?p=575</guid>
		<description><![CDATA[I’ve found that Contact Form 7 is the easiest to set up and configure. There was only one problem with it: the javascript loaded on every page. Not anymore! (Updated for CF7 v 2.4)]]></description>
			<content:encoded><![CDATA[<p></p><p>There are <a target="_blank" href="http://wordpress.org/extend/plugins/search.php?q=contact+form&amp;sort=">thousands of contact form plugins</a> out there. Hell, you can even <a target="_blank" href="http://www.catswhocode.com/blog/how-to-create-a-built-in-contact-form-for-your-wordpress-theme">roll your own</a> if you want to. But I&#8217;m lazy. And I want to focus on other things. So this is one of the few areas that I use a plugin. I&#8217;ve found that <a target="_blank" href="http://wordpress.org/extend/plugins/contact-form-7/">Contact Form 7</a> is the easiest to set up and configure. There was only one problem with it: the javascript loaded on every page. And being anal about things, I only wanted it on the actual contact page. So I decided to write a quick function to fix that, without hacking the actual plugin.</p>
<p>A few notes:</p>
<ul>
<li>This assumes that you have everything in the default folders</li>
<li>This is based on Thesis v1.8, and CF7 <span style="text-decoration: line-through;">v2.3</span> updated for v2.4.5</li>
</ul>
<pre class="brush: php; title: ; notranslate">
/* Adds in scripts for contact form 7 */
	remove_action('wp_enqueue_scripts', 'wpcf7_enqueue_scripts' ); // Removes the scripts from loading on all pages for CF 7
	add_action('thesis_hook_footer','new_cf7_scripts'); // Adds back in the scripts on the appropriate page

function new_cf7_scripts() {
	if (is_page(array('contact','another-page'))) { // Change the name to match the name(s) of the pages using the form ?&gt;
    &lt;script src=&quot;&lt;?php bloginfo('home'); ?&gt;/wp-content/plugins/contact-form-7/jquery.form.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
	&lt;script src=&quot;&lt;?php bloginfo('home'); ?&gt;/wp-content/plugins/contact-form-7/scripts.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;?php } }
</pre>
<p>Not terribly difficult. Just drop that into your custom-functions.php file and you should be good to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewnorcross.com/tutorials/tutorials/optimize-the-contact-form-7-plugin-for-thesis/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Add the new Twitter button to Thesis Posts and Teasers</title>
		<link>http://andrewnorcross.com/tutorials/tutorials/add-the-new-twitter-button-to-thesis-posts-and-teasers/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=add-the-new-twitter-button-to-thesis-posts-and-teasers</link>
		<comments>http://andrewnorcross.com/tutorials/tutorials/add-the-new-twitter-button-to-thesis-posts-and-teasers/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 20:48:11 +0000</pubDate>
		<dc:creator>Norcross</dc:creator>
				<category><![CDATA[General Ramblings]]></category>

		<guid isPermaLink="false">http://andrewnorcross.com/?p=590</guid>
		<description><![CDATA[I'm just gonna say it. I hate TweetMeme. It's slow, the javascript load time is horrible, and it breaks a lot. But until now, there really wasn't much option otherwise.]]></description>
			<content:encoded><![CDATA[<p></p><p>I&#8217;m just gonna say it. I hate TweetMeme. It&#8217;s slow, the javascript load time is horrible, and it breaks a lot. But until now, there really wasn&#8217;t much option otherwise.</p>
<p><a target="_blank" title="Twitter Button Builder" href="http://twitter.com/goodies/tweetbutton" target="_blank">Enter the &#8216;official&#8217; Twitter button.</a></p>
<p>I&#8217;ve begun switching over all the sites I manage over to this instead. I don&#8217;t have any hard metrics, but I have noticed a decrease in load time. Here&#8217;s the quick and dirty on how to do it.</p>
<pre class="brush: php; title: ; notranslate">

add_action('thesis_hook_before_post','custom_twitter'); //Add Twitter share for posts and singles
add_action('thesis_hook_before_teaser','custom_twitter'); //Add Twitter share for teasers

function custom_twitter() { ?&gt;
 &lt;p class=&quot;twitter&quot;&gt;
 &lt;a href=&quot;http://twitter.com/share&quot; class=&quot;twitter-share-button&quot; data-url=&quot;&lt;?php the_permalink() ?&gt;&quot; data-text=&quot;&lt;?php the_title_attribute(); ?&gt;&quot; data-count=&quot;vertical&quot; data-via=&quot;YOUR_TWITTER_NAME&quot;&gt;Tweet&lt;/a&gt;
 &lt;script type=&quot;text/javascript&quot; src=&quot;http://platform.twitter.com/widgets.js&quot;&gt;&lt;/script&gt;

 &lt;/p&gt;
 &lt;?php }
</pre>
<p>I personally add in a line of CSS here:</p>
<pre class="brush: css; title: ; notranslate">.custom p.twitter {float:right; margin:0 15px 15px;}</pre>
]]></content:encoded>
			<wfw:commentRss>http://andrewnorcross.com/tutorials/tutorials/add-the-new-twitter-button-to-thesis-posts-and-teasers/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Add a clickable header image in Thesis with just CSS</title>
		<link>http://andrewnorcross.com/tutorials/tutorials/add-a-clickable-header-image-in-thesis-with-just-css/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=add-a-clickable-header-image-in-thesis-with-just-css</link>
		<comments>http://andrewnorcross.com/tutorials/tutorials/add-a-clickable-header-image-in-thesis-with-just-css/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 20:40:31 +0000</pubDate>
		<dc:creator>Norcross</dc:creator>
				<category><![CDATA[General Ramblings]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[thesis]]></category>

		<guid isPermaLink="false">http://andrewnorcross.com/?p=528</guid>
		<description><![CDATA[Want a quick and clean way to add a clickable header image to your Thesis site? Don't wanna mess around with any functions? Check out this tutorial for an easy way.]]></description>
			<content:encoded><![CDATA[<p></p><p>One of the biggest things I see people try to do with Thesis is get a clickable banner image in their header (instead of just the text / tagline). And understandably so, people are a bit apprehensive about writing functions and using filters (although they shouldn&#8217;t be. But that&#8217;s for another tutorial).<br />
However, it doesn&#8217;t have to be that hard. You can get your own image in there with just a few lines of CSS. Here is what you need to do:</p>
<ul>
<li>Get an image <em>(make note of the dimensions of the image. It&#8217;ll matter later)</em></li>
<li>Upload the image into your /custom/images folder within your Thesis theme <em>(preferred)</em> or into your uploads folder</li>
<li>Copy the code below into you custom.css file, with a few modifications</li>
</ul>
<h3>Here&#8217;s the code</h3>
<pre class="brush: css; title: ; notranslate">
.custom #header {
	height:180px;
	padding:0;
	background:none;
	margin:0 auto;
	}

.custom #header #logo a {
	text-align:center;
	display: block;
	height: 180px; /* Must match the height given in the previous area */
    width: 600px; /* Not required, but will allow the image to be centered)*/
	background: url(images/FILENAME.PNG) no-repeat;
	outline: none;
}
.custom #header #logo, .custom #header #tagline {
	text-indent: -9999px;
}
</pre>
<h3>Things To Keep In Mind</h3>
<ul>
<li>If you put the image anywhere other than the custom/images/ folder, you need to put in the entire URL of the image in line 13.</li>
<li>Make sure to put in the height of the image in both places (line 2 and line 11)</li>
</ul>
<p>That&#8217;s really all there is to it. Problems? Feel free to comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewnorcross.com/tutorials/tutorials/add-a-clickable-header-image-in-thesis-with-just-css/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic (Feed is rejected)
Page Caching using disk: enhanced

Served from: andrewnorcross.com @ 2012-02-03 21:20:00 -->
