<?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>iamtgc &#187; Wordpress</title>
	<atom:link href="http://iamtgc.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://iamtgc.com</link>
	<description></description>
	<lastBuildDate>Thu, 02 Feb 2012 00:15:10 +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>Add Pinterest&#8217;s &#8220;Pin It&#8221; Button To Your WordPress Blog</title>
		<link>http://iamtgc.com/2012/02/01/add-pinterests-pin-it-button-to-your-wordpress-blog/</link>
		<comments>http://iamtgc.com/2012/02/01/add-pinterests-pin-it-button-to-your-wordpress-blog/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 00:15:10 +0000</pubDate>
		<dc:creator>tgc</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://iamtgc.com/?p=666</guid>
		<description><![CDATA[Even if you haven&#8217;t been fortunate enough to receive a Pinterest invite yet, chances are you&#8217;ve seen their &#8220;Pin It&#8221; button somewhere in your daily browsing. Fortunately you don&#8217;t need an invitation to add the &#8220;Pin It&#8221; button to your &#8230; <a href="http://iamtgc.com/2012/02/01/add-pinterests-pin-it-button-to-your-wordpress-blog/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Even if you haven&#8217;t been fortunate enough to receive a <a href="http://pinterest.com" title="Pinterest">Pinterest</a> invite yet, chances are you&#8217;ve seen their &#8220;Pin It&#8221; button somewhere in your daily browsing.  Fortunately you don&#8217;t need an invitation to add the &#8220;Pin It&#8221; button to your website.  In this article I will show you how to add the &#8220;Pin It&#8221; button to your WordPress blog.<br />
<span id="more-666"></span><br />
To get an understanding of the API, you can visit Pinterest&#8217;s <a href="http://pinterest.com/about/goodies/" title="Pinterest / Goodies" target="_blank">Goodies</a> page, and scroll down to the section labeled <strong>&#8220;Pin It&#8221; Button For Websites</strong>.  There you&#8217;ll see the following code generator.</p>
<p><a href="http://iamtgc.com/wp-content/uploads/2012/01/pinterest-form.jpg"><img src="http://iamtgc.com/wp-content/uploads/2012/01/pinterest-form.jpg" alt="" title="Pinterest Form" width="630" height="456" class="aligncenter size-full wp-image-677" /></a></p>
<p>Once you begin populating the fields, your changes are reflected in the code window.  As you may notice, the URLs you&#8217;re Pinning will need to be <a href="http://en.wikipedia.org/wiki/Percent-encoding" title="Percent-encoding - Wikipedia, the free encyclopedia" target="_blank">URL encoded</a>.</p>
<p><a href="http://iamtgc.com/wp-content/uploads/2012/01/pinterest-form-partial1.jpg"><img src="http://iamtgc.com/wp-content/uploads/2012/01/pinterest-form-partial1.jpg" alt="" title="Partially Populated Pinterest Form" width="625" height="449" class="aligncenter size-full wp-image-686" /></a></p>
<p>In order to implement this code generation in WordPress, we&#8217;ll get the <strong>URL of the webpage the pin is on</strong> using</p>
<pre class="brush:php;">
&lt;?php echo urlencode( get_permalink() ); ?&gt;
</pre>
<p>The <strong>URL of the image to be pinned</strong> using the post&#8217;s thumbnail</p>
<pre class="brush:php;">
&lt;?php echo urlencode( wp_get_attachment_thumb_url( get_post_thumbnail_id() ) ); ?&gt;
</pre>
<p>And for the <em>optional</em> <strong>Description of the Pin</strong>, we&#8217;ll use the post&#8217;s title</p>
<pre class="brush:php;">
&lt;?php echo urlencode( get_the_title() ); ?&gt;
</pre>
<p>When we put it all together, here&#8217;s what the relevant excerpt of our <strong>loop-single.php</strong> will look like. If you want to include the Pin Count along with the &#8220;Pin It&#8221; button, you can change the <strong>count-layout</strong> attribute to either <strong>horizontal</strong> or <strong>vertical</strong>.</p>
<pre class="brush:html;">
&lt;div id="post-&lt;?php the_ID(); ?&gt;" &lt;?php post_class(); ?&gt;&gt;
&lt;h1 class="entry-title"&gt;&lt;?php the_title(); ?&gt;
     &lt;a href="http://pinterest.com/pin/create/button/?url=&lt;?php echo urlencode(get_permalink()); ?&gt;&#038;media=&lt;?php echo urlencode(wp_get_attachment_thumb_url(get_post_thumbnail_id())); ?&gt;&#038;description=&lt;?php echo urlencode( get_the_title()); ?&gt;" class="pin-it-button" count-layout="none"&gt;Pin It&lt;/a&gt;
     &lt;script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"&gt;&lt;/script&gt;
&lt;/h1&gt;

&lt;div class="entry-meta"&gt;
&lt;?php twentyten_posted_on(); ?&gt;
&lt;/div&gt;&lt;!-- .entry-meta --&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://iamtgc.com/2012/02/01/add-pinterests-pin-it-button-to-your-wordpress-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove the default header images from a Twentyeleven child theme</title>
		<link>http://iamtgc.com/2011/08/12/remove-default-header-images-from-twentyeleven-child-theme/</link>
		<comments>http://iamtgc.com/2011/08/12/remove-default-header-images-from-twentyeleven-child-theme/#comments</comments>
		<pubDate>Sat, 13 Aug 2011 03:36:03 +0000</pubDate>
		<dc:creator>tgc</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://iamtgc.com/?p=485</guid>
		<description><![CDATA[Recently we looked at adding a sidebar to twentyeleven via a child theme. While adding functionality is likely where you will start in your theme customization, there will likely come a point that you will want to remove some specific &#8230; <a href="http://iamtgc.com/2011/08/12/remove-default-header-images-from-twentyeleven-child-theme/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently we looked at <a href="http://iamtgc.com/2011/07/15/adding-the-sidebar-to-a-twentyeleven-child-theme/" title="Adding the sidebar to a Twentyeleven child theme">adding a sidebar to twentyeleven via a child theme</a>.  While adding functionality is likely where you will start in your theme customization, there will likely come a point that you will want to remove some specific functionality as well.  </p>
<p>One of the most eye catching features of twentyeleven are it&#8217;s header images, but if you really want to make the theme your own, you may want to remove the stock header images in favor of your own.  Today we will do just that as we continue to explore customizing twentyeleven via a child theme.<br />
<span id="more-485"></span><br />
First, let&#8217;s see how twentyeleven loads it&#8217;s header images.  Here is a portion of twentyeleven&#8217;s <strong>functions.php</strong>, abbreviated for brevity.</p>
<pre class="brush:php;">
add_action( 'after_setup_theme', 'twentyeleven_setup' );

if ( ! function_exists( 'twentyeleven_setup' ) ):
...
function twentyeleven_setup() {
...
    register_default_headers( array(
        'wheel' => array(
            'url' => '%s/images/headers/wheel.jpg',
            'thumbnail_url' => '%s/images/headers/wheel-thumbnail.jpg',
            /* translators: header image description */
            'description' => __( 'Wheel', 'twentyeleven' )
        ),
...
    ) );
}
endif; // twentyeleven_setup
</pre>
<p>By looking at this, we know the headers are loaded with <a href="http://codex.wordpress.org/Function_Reference/register_default_headers" title="Function Reference/register default headers &laquo; WordPress Codex" target="_blank">register_default_headers</a>, in the twentyeleven_setup function, which is had been added to the after_theme_setup hook via <a href="http://codex.wordpress.org/Function_Reference/add_action" title="Function Reference/add action &laquo; WordPress Codex" target="_blank">add_action</a>.</p>
<p>Since the twentyeleven_setup() function has other goodies we want to keep, rather than rewrite the entire function, we create our own function to <a href="http://codex.wordpress.org/Function_Reference/unregister_default_headers" title="Function Reference/unregister default headers &laquo; WordPress Codex" target="_blank">unregister_default_headers</a>, and add it to the same after_theme_setup hook with a higher priority (the default is 10) so it will run after than the parent function.</p>
<p>Here we edit (or create) our child theme&#8217;s <strong>functions.php</strong></p>
<pre class="brush:php;">
&lt;?php
function remove_default_headers() {
        unregister_default_headers(
                array(
                        'wheel',
                        'shore',
                        'trolley',
                        'pine-cone',
                        'chessboard',
                        'lanterns',
                        'willow',
                        'hanoi'
                )
        );
}

add_action( 'after_setup_theme', 'remove_default_headers', 11 );
?&gt;
</pre>
<p><strong>Note: </strong> If you are uncertain of which action is best to hook into, you should refer to the <a href="http://codex.wordpress.org/Plugin_API/Action_Reference" title="Plugin API/Action Reference &laquo; WordPress Codex" target="_blank">Plugin API/Action Reference</a> at the <a href="http://codex.wordpress.org/" title="Wordpress Codex" target="_blank">WordPress Codex</a>.</p>
<p>Now, when you browse the header section in the dashboard, you should be greeted with the following<br />
<a href="http://iamtgc.com/wp-content/uploads/2011/08/child-twentyeleven-no-headers.jpg"><img src="http://iamtgc.com/wp-content/uploads/2011/08/child-twentyeleven-no-headers-1024x458.jpg" alt="" title="child-twentyeleven-no-headers" width="640" height="286" class="aligncenter size-large wp-image-520" /></a></p>
<p>Now that all of the default headers are gone, we can edit our child theme&#8217;s <strong>functions.php</strong> to add our own header.  In this example, we&#8217;ve copied our header and a thumbnail, into images/headers under the child theme&#8217;s directory.<br />
i.e.<br />
<strong>twentyeleven-child/images/headers/header.jpg</strong><br />
and<br />
<strong>twentyeleven-child/images/headers/header-thumbnail.jpg</strong></p>
<pre class="brush:php;">
&lt;?php
function remove_default_headers() {
    unregister_default_headers(
        array(
            'wheel',
            'shore',
            'trolley',
            'pine-cone',
            'chessboard',
            'lanterns',
            'willow',
            'hanoi'
        )
    );
    register_default_headers( array(
        'tgcheader' => array(
            'url' => get_stylesheet_directory_uri() . '/images/headers/header.jpg',
            'thumbnail_url' => get_stylesheet_directory_uri() . '/images/headers/header-thumbnail.jpg',
            /* translators: header image description */
            'description' => __( 'tgcheader', 'twentyeleven-child' )
        )
    ) );
}

add_action( 'after_setup_theme', 'remove_default_headers', 11 );
?&gt;
</pre>
<p>You should also note how we&#8217;re using <a href="http://codex.wordpress.org/Function_Reference/get_stylesheet_directory_uri" title="Function Reference/get stylesheet directory uri &laquo; WordPress Codex" target="_blank">get_stylesheet_directory_uri()</a> to refer to our child theme&#8217;s path, instead of <strong>%s</strong>, which would reference the parent theme&#8217;s path.</p>
]]></content:encoded>
			<wfw:commentRss>http://iamtgc.com/2011/08/12/remove-default-header-images-from-twentyeleven-child-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding the sidebar to a Twentyeleven child theme</title>
		<link>http://iamtgc.com/2011/07/15/adding-the-sidebar-to-a-twentyeleven-child-theme/</link>
		<comments>http://iamtgc.com/2011/07/15/adding-the-sidebar-to-a-twentyeleven-child-theme/#comments</comments>
		<pubDate>Sat, 16 Jul 2011 00:48:04 +0000</pubDate>
		<dc:creator>tgc</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://iamtgc.com/?p=371</guid>
		<description><![CDATA[Twentyeleven offers a lot of cool features, one of my favorites is the Showcase template. However one of the downsides in my opinion (and probably yours, if you&#8217;ve found this article) is lack of a sidebar on your single posts &#8230; <a href="http://iamtgc.com/2011/07/15/adding-the-sidebar-to-a-twentyeleven-child-theme/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Twentyeleven offers a lot of cool features, one of my favorites is the Showcase template.  However one of the downsides in my opinion (and probably yours, if you&#8217;ve found this article) is lack of a sidebar on your single posts and pages.</p>
<p><a href="http://surminski.eu/2011/07/06/add-sidebar-to-single-post-in-the-wordpress-3-2-twentyeleven-theme/" target="_blank">Others</a> have pointed out viable solutions, however I wanted to stick to best practices and keep my parent theme unmodified.</p>
<p>Here I will explore how to add the sidebar to a twentyeleven child theme in only half a dozen lines of code.<br />
<span id="more-371"></span><br />
<strong>Note:</strong> More information on creating a child theme can be found <a href="http://codex.wordpress.org/Child_Themes" title="Child Themes">here</a>.</p>
<p>We&#8217;ll begin by adding the sidebar back to your posts, by copying <strong>single.php</strong> to our child theme and modifying it.</p>
<pre class="brush:html;">
            &lt;/div&gt;&lt;!-- #content --&gt;
        &lt;/div&gt;&lt;!-- #primary --&gt;

&lt;?php get_footer(); ?&gt;
</pre>
<p>Add the <strong>get_sidebar()</strong> function directly above <strong>get_footer()</strong> like so</p>
<pre class="brush:html;">
            &lt;/div&gt;&lt;!-- #content --&gt;
        &lt;/div&gt;&lt;!-- #primary --&gt;

&lt;?php get_sidebar(); ?&gt;
&lt;?php get_footer(); ?&gt;
</pre>
<p>The same can be done for <strong>page.php</strong> if you want the sidebar to appear on your pages as well.</p>
<p>Now, the other tutorials I&#8217;ve seen advise you to edit twentyeleven&#8217;s <strong>functions.php</strong> and comment out the <strong>remove_twentyeleven_body_classes()</strong> function and it&#8217;s accompanying <strong>add_action()</strong>.  You can certainly do so, but it goes against best practices, and you risk losing your modifications if you update twentyeleven.</p>
<p>In your child theme, create or modify your <strong>functions.php</strong> to contain the following.</p>
<pre class="brush:php;">
&lt;?php
function remove_twentyeleven_body_classes() {
    remove_filter( 'body_class', 'twentyeleven_body_classes' );
}
add_action( 'after_setup_theme', 'remove_twentyeleven_body_classes' );
?&gt;
</pre>
<p>Here we are removing the filter that is added in twentyeleven&#8217;s <strong>functions.php</strong>, but since the child theme&#8217;s files are processed prior to the parents, simply removing the filter is not adequate and would be overridden by the parent function.  As a result we need to add an <a href="http://codex.wordpress.org/Function_Reference/add_action" target="_blank">action</a> to remove the filter during the <a href="http://codex.wordpress.org/Plugin_API/Action_Reference" target="_blank"><strong>after_setup_theme</strong></a> action.</p>
<p>Save your files, and assuming it wasn&#8217;t already, activate the theme.<br />
That&#8217;s it.  Now you have your sidebar.</p>
]]></content:encoded>
			<wfw:commentRss>http://iamtgc.com/2011/07/15/adding-the-sidebar-to-a-twentyeleven-child-theme/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Add Google +1 to your WordPress blog</title>
		<link>http://iamtgc.com/2011/07/13/add-google-plus-one-to-your-wordpress-blog/</link>
		<comments>http://iamtgc.com/2011/07/13/add-google-plus-one-to-your-wordpress-blog/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 13:42:16 +0000</pubDate>
		<dc:creator>tgc</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://iamtgc.com/?p=336</guid>
		<description><![CDATA[Google&#8217;s +1 buttons have been popping up left and right, and according to Google &#8230; +1’s from friends and contacts can be a useful signal to Google when determining the relevance of your page to a user’s query. This is &#8230; <a href="http://iamtgc.com/2011/07/13/add-google-plus-one-to-your-wordpress-blog/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Google&#8217;s +1 buttons have been popping up left and right, and according to Google</p>
<blockquote><p>&#8230; +1’s from friends and contacts can be a useful signal to Google when determining the relevance of your page to a user’s query. This is just one of many signals Google may use to determine a page’s relevance and ranking &#8230;</p></blockquote>
<p>and if that isn&#8217;t enough, consider the <em>limited Field Trial</em> of <a href="https://plus.google.com/" title="Google+" target="_blank">Google+</a> already reaching an estimated user base between 10 and 20 million, adding a +1 button to your content becomes even more important.</p>
<p>While there are plugins that exist to add +1 buttons to your WordPress blog, I will explain how to modify your theme and add the +1 button without using plugins.<br />
<span id="more-336"></span></p>
<p><strong>Note:</strong> If you are modifying themes, you should do so using <a href="http://codex.wordpress.org/Child_Themes" title="Child Themes">child themes</a>.  Child themes help to preserve your modifications during upgrades, and make backing out your changes easier if you break something.</p>
<p>Begin by adding the script tag, just prior to your closing body tag in <strong>footer.php</strong>.</p>
<pre class="brush:html;">
&lt;script type="text/javascript" src="https://apis.google.com/js/plusone.js"&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Next, if you want to add the +1 button to your single posts, edit <strong>loop-single.php</strong>, you&#8217;ll want to decide where to place the button, in this example it will appear immediately to the right of the post title.  </p>
<pre class="brush:html;">
&lt;div id="post-&lt;?php the_ID(); ?&gt;" &lt;?php post_class(); ?&gt;&gt;
&lt;h1 class="entry-title"&gt;&lt;?php the_title(); ?&gt; &lt;g:plusone&gt;&lt;/g:plusone&gt;&lt;/h1&gt;

&lt;div class="entry-meta"&gt;
&lt;?php twentyten_posted_on(); ?&gt;
&lt;/div&gt;&lt;!-- .entry-meta --&gt;
</pre>
<p>Note the added plusone tag</p>
<pre class="brush:html;">
&lt;g:plusone&gt;&lt;/g:plusone&gt;
</pre>
<p>As WordPress (<a href="http://wordpress.org/news/2009/12/wordpress-2-9/" title="WordPress 2.9" target="_blank">since 2.9</a>) provides a <a href="http://www.google.com/support/webmasters/bin/answer.py?answer=139394" title="canonical link element" target="_blank">canonical link element</a> it is not necessary to include the href attribute.  </p>
<p>However, if you want to include +1 outside of a single post/page, like in <strong>loop.php</strong>, where the canonical link is not helpful, you can use the following.</p>
<pre class="brush:html;">
&lt;?php /* How to display all other posts. */ ?&gt;

        &lt;?php else : ?&gt;
                &lt;div id="post-&lt;?php the_ID(); ?&gt;" &lt;?php post_class(); ?&gt;&gt;
                        &lt;h2 class="entry-title"&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;" title="&lt;?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?&gt;" rel="bookmark"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt; &lt;g:plusone href="&lt;?php the_permalink(); ?&gt;" &gt;&lt;/g:plusone&gt;&lt;/h2&gt;

                        &lt;div class="entry-meta"&gt;
                                &lt;?php twentyten_posted_on(); ?&gt;
                        &lt;/div&gt;&lt;!-- .entry-meta --&gt;
</pre>
<p>Note the added plusone tag</p>
<pre class="brush:html;">
&lt;g:plusone href="&lt;?php the_permalink(); ?&gt;" &gt;&lt;/g:plusone&gt;
</pre>
<p>For further customization, such as button size and the exclusion of counts, please refer to the <a href="http://www.google.com/+1/button/" title="Google +1 documentation">Google +1 documentation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://iamtgc.com/2011/07/13/add-google-plus-one-to-your-wordpress-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrating a Google Custom Search Engine into your WordPress blog</title>
		<link>http://iamtgc.com/2011/07/10/integrating-a-google-custom-search-engine-into-your-wordpress-blog/</link>
		<comments>http://iamtgc.com/2011/07/10/integrating-a-google-custom-search-engine-into-your-wordpress-blog/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 23:54:45 +0000</pubDate>
		<dc:creator>tgc</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://iamtgc.com/?p=232</guid>
		<description><![CDATA[It has been a while since I last had a need to integrate a Google Custom Search Engine into a WordPress blog, but it seems a lot has changed. The layout options have changed, and the IFrame option I was &#8230; <a href="http://iamtgc.com/2011/07/10/integrating-a-google-custom-search-engine-into-your-wordpress-blog/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It has been a while since I last had a need to integrate a Google Custom Search Engine into a WordPress blog, but it seems a lot has changed.  The <a href="http://code.google.com/intl/en/apis/customsearch/docs/ui.html#layout" title="Google Custom Search layout options" target="_blank">layout options</a> have changed, and the IFrame option I was used to using has been deprecated.</p>
<p>Fortunately, this has allowed me to discover one of the more useful options, the <em><strong>results only</strong></em> layout.  With this option and a few minor modifications, you will be able to leverage Google&#8217;s search with your existing WordPress search box.</p>
<p>So to begin, if haven&#8217;t done so already, <a href="http://google.com/cse" title="Google Custom Search Engine">create your own custom search engine</a>.  I&#8217;ll leave it to you to decide on the name, description, sites to index, etc. and focus on the settings that impact you integrating your custom search into WordPress.<br />
<span id="more-232"></span><br />
First, when you&#8217;re creating (or editing) the look and feel of your custom search, you will want to chose the <strong><em>results only</em></strong> layout.  Here you can also customize your style or chose from one on those Google provides.<br />
<a href="http://iamtgc.com/wp-content/uploads/2011/07/cse-look-and-feel.jpg"><img src="http://iamtgc.com/wp-content/uploads/2011/07/cse-look-and-feel.jpg" alt="" title="cse-look-and-feel" width="1028" height="629" class="alignnone size-full wp-image-284" /></a></p>
<p>Next you&#8217;ll want to get the code necessary to display the search results in your blog.  While there is probably little reason to change the <strong>query parameter name</strong> from the default of <strong>q</strong>, if you do, make sure you don&#8217;t use <strong>s</strong> as it&#8217;s used for WordPress&#8217; built in search. Copy your generated code into the clipboard.<br />
<a href="http://iamtgc.com/wp-content/uploads/2011/07/cse-get-code.jpg"><img src="http://iamtgc.com/wp-content/uploads/2011/07/cse-get-code.jpg" alt="" title="cse-get-code" width="900" height="695" class="alignnone size-full wp-image-319" /></a></p>
<p>Next, you will want to add a new page to your blog.  Here the title is less significant than the permalink, which for this example will be named <strong>google-cse</strong>.  Paste the generated code into this page, disable comments, and publish it.<br />
<a href="http://iamtgc.com/wp-content/uploads/2011/07/wordpress-cse-page.jpg"><img src="http://iamtgc.com/wp-content/uploads/2011/07/wordpress-cse-page.jpg" alt="" title="wordpress-cse-page" width="780" height="548" class="alignnone size-full wp-image-323" /></a></p>
<p><strong>Note:</strong> You may want to <a href="http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates" title="Wordpress - Create You Own Page Template" target="_blank">create your own page template</a> for the search results page to remove the title, authorship, etc.<br />
<strong>Note 2:</strong> If you have auto-generated menus that include your pages, you will likely want to customize them to exclude your search results page.</p>
<p>Finally, you will want to edit your WordPress theme&#8217;s <strong>searchform.php</strong>.  If this does not exist, you can create it.  I removed theme specific function calls for this example, but you can adjust this as you see fit.  The most important parts are the <strong>action</strong>, which must point to the permalink of the search results page we just created, and the <strong>name</strong> and <strong>id</strong> which must match the query parameter name we previously chose, in this case Google&#8217;s default <strong>q</strong>.</p>
<pre class="brush:html;">
&lt;form method="get" id="searchform" action="/google-cse/"&gt;
&lt;label for="q" class="assistive-text"&gt;Search&lt;/label&gt;
&lt;input type="text" class="field" name="q" id="q"/&gt;
&lt;input type="submit" class="submit" id="searchsubmit"/&gt;
&lt;/form&gt;
</pre>
<p><strong>Note 3:</strong> Since we are now using the query parameter of <strong>q</strong>, if your theme decorates the search form with css (as <a href="http://theme.wordpress.com/themes/twentyeleven/" title="twentyeleven">twentyeleven</a> does) some modifications may be necessary.  CSS entries referencing #s will have to be changed to #q.  For exmaple</p>
<pre class="brush:css;">
input#s {
    background: url(images/search.png) no-repeat 5px 6px;
    -moz-border-radius: 2px;
    border-radius: 2px;
    font-size: 14px;
    height: 22px;
    line-height: 1.2em;
    padding: 4px 10px 4px 28px;
}
</pre>
<p>Will have to be modified to</p>
<pre class="brush:css;">
input#q {
    background: url(images/search.png) no-repeat 5px 6px;
    -moz-border-radius: 2px;
    border-radius: 2px;
    font-size: 14px;
    height: 22px;
    line-height: 1.2em;
    padding: 4px 10px 4px 28px;
}
</pre>
<p><strong>Note 4:</strong> If you are modifying themes, you should do so using <a href="http://codex.wordpress.org/Child_Themes" title="Child Themes">child themes</a>.  Child themes help to preserve your modifications during upgrades, and make backing out your changes easier if you break something.</p>
]]></content:encoded>
			<wfw:commentRss>http://iamtgc.com/2011/07/10/integrating-a-google-custom-search-engine-into-your-wordpress-blog/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

