<?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>Stranger Studios Blog</title>
	<atom:link href="http://www.strangerstudios.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.strangerstudios.com/blog</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 05 Aug 2010 13:24:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Tips and Tricks for Stranger Studios-coded Themes</title>
		<link>http://www.strangerstudios.com/blog/2010/08/tips-and-tricks-for-stranger-studios-coded-themes/</link>
		<comments>http://www.strangerstudios.com/blog/2010/08/tips-and-tricks-for-stranger-studios-coded-themes/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 18:42:15 +0000</pubDate>
		<dc:creator>kim</dc:creator>
				<category><![CDATA[Client Work]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.strangerstudios.com/blog/?p=164</guid>
		<description><![CDATA[If you&#8217;re a Stranger Studios client using one of our custom WordPress themes, these special formatting options may be available to you. If these tricks aren&#8217;t working as intended on your theme, contact us and we will troubleshoot! Controlling Page Menus Main Navigation Menu: The pages that appear in your site&#8217;s main menu have a [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re a Stranger Studios client using one of our custom WordPress themes, these special formatting options may be available to you. If these tricks aren&#8217;t working as intended on your theme, <a href="/contact/">contact us</a> and we will troubleshoot!</p>
<h3>Controlling Page Menus</h3>
<ul>
<li><strong>Main Navigation Menu:</strong> The pages that appear in your site&#8217;s main menu have a custom field with the name &#8220;mainmenu&#8221; and the value &#8220;true&#8221;.</li>
<li><strong>Footer Navigation Menu:</strong> The pages that appear in your site&#8217;s footer menu have a custom field with the name &#8220;footermenu&#8221; and the value &#8220;true&#8221;.</li>
<li><strong>Mini-Navigation Menu:</strong> Some sites we have coded have a third menu, generally floated in the upper right header space. The pages that appear in your site&#8217;s mini menu have a custom field with the name &#8220;minimenu&#8221; and the value &#8220;true&#8221;.</li>
<li><strong>The order in which the pages appear</strong> within the menu is controlled by the page&#8217;s  &#8220;Order&#8221; attribute (found in the right hand column of the Edit Page screen within the admin).</li>
</ul>
<h3>Changing the Page title on the page vs. within a menu</h3>
<p>Add a custom field with the name &#8220;longtitle&#8221; and the value of the longer page title. The custom field value will show up within the H2 tag on the page, but the shorter WordPress title will be used within navigation menus.</p>
<h3>Hiding pages from the site map / sidebar menus</h3>
<p>Add a custom field with the name &#8220;hide&#8221; and the value &#8220;true&#8221; to exclude it from your site map and other menus/navigation.</p>
<h3>Controlling the content of the 404/Page Not Found</h3>
<p>Rather than use the WordPress default content for a 404 page error, your theme has special functionality allowing you to control the text shown on this page. The page can be edited as any other WordPress page within the /wp-admin/ panel under Pages -> Edit Page. If you have a site with a lot of pages, do a page search for &#8220;404&#8243; to help locate this page.</p>
<h3>Horizontal/Divider Line</h3>
<p>I generally use a lot of thin grey lines to break up content and divide page or post content into meaningful chunks. This is the code for that thin line:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;line&quot;&gt;&lt;/div&gt;</pre></div></div>

<p><strong>Here&#8217;s the HTML code above rendered as it would appear on your site:</strong></p>
<div class="line"></div>
<h3>Clearing DIVs</h3>
<p>If you are preparing a page with a lot of floating images, you may find the content is rendering funky below the image. In order to clear out that floating image and make the new text render within the full page width, you want to insert a clearing div using this code:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;</pre></div></div>

<h3>Show excerpts from subpages on a Parent Page</h3>
<p>We have written a special shortcode allowing you to display excerpts from the children of a parent page. The order in which these subpage excerpts display is controlled by the subpage&#8217;s  &#8220;Order&#8221; attribute (found in the right hand column of the Edit Page screen within the admin). The shortcode will show the subpage title (linked), the excerpt (all content before the subpage&#8217;s &#8220;<a href="http://codex.wordpress.org/Customizing_the_Read_More" target="_blank">more</a>&#8221; quicktag), and a link to &#8220;Continue Reading More About (subpagetitle) &raquo;.</p>
<p>The shortcode that will display subpage excerpts is:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[subpagelist]</pre></div></div>

<p>To exclude any child pages from showing up in the list, write down a comma-separate list of subpage ids to exclude and use this shortcode:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[subpagelist exclude=&quot;1,2,3&quot;]</pre></div></div>

<h3>Same Page As shortcode</h3>
<p>Some clients have asked that one page have the same exact content as another page, just navigated to and titled in a different way. This could be useful if you are running landing page campaigns for the same content with a different styling or special meta data. Thus, we have written a special shortcode making one WordPress page dynamically pull in content from another page.</p>
<p>The shortcode that will display the same content as another page is:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[samepageas id=&quot;x&quot;]</pre></div></div>

<p>Where x is the id of the page you wish to pull in the content from.</p>
<h3>SS-Downloads</h3>
<p>If your site is equipped with the SS-Downloads plugin, <a href="http://www.strangerstudios.com/blog/2010/07/ss-downloads-wordpress-plugin/">click here for a tutorial on how to use that functionality</a>. The basic jist is that you add a shortcode with the file name and optional title for download link like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">[download file=&quot;http://path_to_file&quot; title=&quot;optional title&quot;]</pre></div></div>

<p>The <a href="http://www.strangerstudios.com/blog/2010/07/ss-downloads-wordpress-plugin/">SS-Downloads plugin</a> allows you to hide a downloadable file behind a required email capture on your site pages or blog posts. This would be useful for a White Paper download or other private content that you are using to generate a mailing list, track downloads, or simply block from mass-distribution.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.strangerstudios.com/blog/2010/08/tips-and-tricks-for-stranger-studios-coded-themes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SS-Downloads WordPress Plugin</title>
		<link>http://www.strangerstudios.com/blog/2010/07/ss-downloads-wordpress-plugin/</link>
		<comments>http://www.strangerstudios.com/blog/2010/07/ss-downloads-wordpress-plugin/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 21:25:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Client Work]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.strangerstudios.com/blog/?p=133</guid>
		<description><![CDATA[Testing our new SS-Downloads plugin. It basically will require an email address before serving a specified file. Right now, I&#8217;m using a zip of the pre-release plugin for testing. I will update this to point to the latest version once it&#8217;s ready. Should see a form or download link here. Future plans: Option to require [...]]]></description>
			<content:encoded><![CDATA[<p>Testing our new SS-Downloads plugin. It basically will require an email address before serving a specified file. Right now, I&#8217;m using a zip of the pre-release plugin for testing. I will update this to point to the latest version once it&#8217;s ready.</p>
<p>Should see a form or download link here.</p>
<div id="ss-downloads">
	<h3>Enter your email address to download <em>ss-downloads.zip</em></h3>
        
    <form action="http://www.strangerstudios.com/blog/wp-content/plugins/ss-downloads/services/addemail.php" method="post">
        <input class="input-text" size="50" placeholder="Enter your email address..." type="text" name="email" value="" />
        <input type="submit" value="SUBMIT" />
        <input type="hidden" name="postid" value="133" />
    </form>
</div>
<p>Future plans:</p>
<ul>
<li>Option to require account creation (instead of just an email address).</li>
<li>Option to email file as attachment instead of showing a link.</li>
<li>Icons for files in template.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.strangerstudios.com/blog/2010/07/ss-downloads-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Make One Category Display Full Posts in Thesis Theme</title>
		<link>http://www.strangerstudios.com/blog/2010/07/make-one-category-display-full-posts-in-thesis-theme/</link>
		<comments>http://www.strangerstudios.com/blog/2010/07/make-one-category-display-full-posts-in-thesis-theme/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 17:42:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Client Work]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.strangerstudios.com/blog/?p=126</guid>
		<description><![CDATA[Got a request from a client to have a specific category page on their WordPress blog running the Thesis theme show full posts (vs. excerpts) for just one category. So I&#8217;m going to figure it out and write the steps here for the benefit of humanity. First, to be clear, I&#8217;m not talking about changing [...]]]></description>
			<content:encoded><![CDATA[<p>Got a request from a client to have a specific category page on their WordPress blog running the Thesis theme <strong>show full posts (vs. excerpts) for just one category</strong>. So I&#8217;m going to figure it out and write the steps here for the benefit of humanity.</p>
<p>First, to be clear, I&#8217;m not talking about changing ALL CATEGORY PAGES from excerpts to full posts. That can be done easily through the Thesis Display Options. You would change the &#8220;Posts&#8221; display options to &#8220;display full content&#8221; and the &#8220;Archives&#8221; display options to &#8220;same as home page&#8221;.</p>
<p>What I want to do is <strong>show excerpts on every category page except one</strong>. You do this by settings up a custom category theme, and Thesis has its own <a href="http://snipplr.com/view/14524/thesis-custom-page-template-with-category-posts/">way to do that</a>. A custom category theme wasn&#8217;t optimal for this install, so I need to do something different. It&#8217;s good to have different ways of doing things. Maybe my method below works for you too.</p>
<p>Here&#8217;s what we&#8217;re going to do.</p>
<ol>
<li>Use the &#8220;thesis_hook_before_post_box&#8221; hook to check the current category and if it is the &#8220;Quick Takes&#8221; category, change the $thesis['display']['archives']['style'] value to &#8220;content&#8221;.</li>
<li>Use the &#8220;thesis_hook_after_post_box&#8221; hook to change the $thesis['display']['archives']['style'] value back to what it was before we tweaked it.</li>
</ol>
<p>Sounds complicated, but it&#8217;s only a few lines to add to the /custom/custom_functions.php file in your Thesis theme folder.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> quicktakes_fullpost_setup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$target_category</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Quick Takes&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//saving the global archives display setting so we can revert later</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$thesis</span><span style="color: #339933;">,</span> <span style="color: #000088;">$saved_thesis_display_archives_style</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$saved_thesis_display_archives_style</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$thesis</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'display'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'archives'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'style'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">//checking the category, if it's the target category, then set the display to full post</span>
	<span style="color: #000088;">$current_category</span> <span style="color: #339933;">=</span> single_cat_title<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$current_category</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$target_category</span><span style="color: #009900;">&#41;</span>
		<span style="color: #000088;">$thesis</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'display'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'archives'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'style'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;content&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> quicktakes_fullpost_cleanup<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">//we're setting the display archives style back to what it was before we tweaked it</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$thesis</span><span style="color: #339933;">,</span> <span style="color: #000088;">$saved_thesis_display_archives_style</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$thesis</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'display'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'archives'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'style'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$saved_thesis_display_archives_style</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'thesis_hook_before_post_box'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'quicktakes_fullpost_setup'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'thesis_hook_after_post_box'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'quicktakes_fullpost_cleanup'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Be sure to change the $target_category variable to the title of the category you want to change.</p>
<p>If you want to do the inverse of this, which would be to show the excerpt on just one category page and update show the full post on all others, you would:</p>
<ol>
<li>Change the Thesis Display Options for posts to &#8220;display full post content&#8221;</li>
<li>Change the Thesis Display Options for archives to &#8220;same as your homepage&#8221;</li>
<li>Then adjust line 12 in the code above to set the style to &#8220;excerpts&#8221; instead of &#8220;content.</li>
</ol>
<p>I hope this helps. Let me know if you have any questions about this or similar customizations for Thesis.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.strangerstudios.com/blog/2010/07/make-one-category-display-full-posts-in-thesis-theme/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress get_the_content_after_more() Function</title>
		<link>http://www.strangerstudios.com/blog/2010/07/wordpress-get_the_content_after_more-function/</link>
		<comments>http://www.strangerstudios.com/blog/2010/07/wordpress-get_the_content_after_more-function/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 21:49:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.strangerstudios.com/blog/?p=90</guid>
		<description><![CDATA[In WordPress, if you want to get just the excerpt of a post, you can use the built-in functions the_excerpt or get_the_excerpt. And if you want all of the content, you can of course use the the_content or get_the_content functions. But what if you want to get everything BUT the excerpt? The Code Here is [...]]]></description>
			<content:encoded><![CDATA[<p>In WordPress, if you want to get just the excerpt of a post, you can use the built-in functions <a href="http://codex.wordpress.org/Template_Tags/the_excerpt">the_excerpt</a> or <a href="http://codex.wordpress.org/Function_Reference/get_the_excerpt">get_the_excerpt</a>. And if you want all of the content, you can of course use the <a href="http://codex.wordpress.org/Function_Reference/the_content">the_content</a> or <a href="http://codex.wordpress.org/Function_Reference/get_the_content">get_the_content</a> functions. <strong>But what if you want to get everything BUT the excerpt?</strong></p>
<h3>The Code</h3>
<p>Here is a function that will do that: get_the_content_after_more()</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> get_the_content_after_more<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$content</span> <span style="color: #339933;">=</span> get_the_content<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$moretag</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/\&lt;span id=&quot;</span>\<span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>more<span style="color: #339933;">-</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">9</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">*</span>\<span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>\<span style="color: #0000ff;">&quot;&gt;\&amp;lt;\/span\&amp;gt;/&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$moretag</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$morespan</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$matches</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$morespan_pos</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #000088;">$morespan</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$newcontent</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #339933;">,</span> <span style="color: #000088;">$morespan_pos</span> <span style="color: #339933;">+</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$morespan</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$content</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$morespan</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$newcontent</span> <span style="color: #339933;">=</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_content'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$newcontent</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$newcontent</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">else</span>
		<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h3>How to Use This</h3>
<p>Notice that this is a &#8220;get_&#8221; version of the function. So you will get to echo the results or save them to a variable for future use. Just plop an <strong>echo get_the_content_after_more()</strong> into your LOOP and you&#8217;re good to go.</p>
<h3>How it Works</h3>
<p>The function works by getting the post content through &#8220;get_the_content&#8221; (and so will give you the content for the current post in your loop) and looking (preg_match) for the span tag that WordPress puts at the more break. (If older versions of WordPress don&#8217;t add this tag, this function won&#8217;t work. But this works in 2.9-3.0 at least.)</p>
<p>If a more tag is found, I create a variable $newcontent holding everything after the more tag. Then I run it through apply_filters to all of your plugins/etc that work on the_content will work on this.</p>
<p>If a post doesn&#8217;t have an excerpt (no excerpt or more tag in the post), the function returns an empty string.</p>
<p>The function could easily be called get_the_inverse_excerpt or get_the_content_after_excerpt or get_the_content_minus_excerpt. Let me know if you have a better idea for this&#8230; or tell me what you searched for to figure this out.</p>
<h3>Why Would I Use This?</h3>
<p>Kim was updating our portfolio page, which is really a list of WordPress posts. She wanted to style the &#8220;excerpt&#8221; differently from the rest of the content. Notice how the top section (&#8220;WineLog is&#8230;&#8221;) is in a gradient box on the <a href="http://www.strangerstudios.com/2009/07/winelog-net/">WineLog portfolio item</a>&#8230; and then the rest is styled as written in the post content. We used code like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;div class=&quot;excerpt&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>    
    the_excerpt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>     	
    <span style="color: #b1b100;">echo</span> get_the_content_after_more<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>			
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>When we decided to do this, I first checked if WordPress was adding some tag around the excerpt that we could piggy back on. Nope. All that is added is a span like <span class="more-222"> </span> at the point where the more break is. Then I looked for a buit-in function or some parameter of the_content that could be used to do this. No luck. (Let me know if there is a built-in way to do this.)</p>
<h3>If I Were Updating WordPress&#8230;</h3>
<p>&#8230; and it&#8217;s open source. So maybe I will. One could add a parameter to the_content/get_the_content functions to exclude the excerpt. The code would be largely the same, though they could look for the more tag itself since they won&#8217;t have that stripped out yet. That feels clunky to me. Let me know if you have better ideas.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.strangerstudios.com/blog/2010/07/wordpress-get_the_content_after_more-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On Ustream: WordPress Plugin to Capture Email Addresses in Exchange For a File Download</title>
		<link>http://www.strangerstudios.com/blog/2010/06/on-ustream-wordpress-plugin-to-capture-email-addresses-in-exchange-for-a-file-download/</link>
		<comments>http://www.strangerstudios.com/blog/2010/06/on-ustream-wordpress-plugin-to-capture-email-addresses-in-exchange-for-a-file-download/#comments</comments>
		<pubDate>Wed, 30 Jun 2010 18:58:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Client Work]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Constant Contact]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Plugin Directory]]></category>

		<guid isPermaLink="false">http://www.strangerstudios.com/blog/?p=61</guid>
		<description><![CDATA[Update: No longer streaming. The plugin works great. Kim is going to make it pretty, then I&#8217;ll post to WordPress and do a right up. I&#8217;m streaming live right now while I work on a WordPress plugin. Follow me at ustream.tv/channel/stranger-studios. I&#8217;ll be working on a plugin for a feature that we&#8217;ve done a million [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> No longer streaming. The plugin works great. Kim is going to make it pretty, then I&#8217;ll post to WordPress and do a right up.</p>
<p>I&#8217;m <a href="http://www.ustream.tv/channel/stranger-studios">streaming live</a> right now while I work on a WordPress plugin. Follow me at <a href="http://www.ustream.tv/channel/stranger-studios">ustream.tv/channel/stranger-studios</a>.</p>
<p>I&#8217;ll be working on a plugin for a feature that we&#8217;ve done a million different ways: asking for a user&#8217;s email address in exchange for a link to a file download. A solid plugin for this will save us a lot of time. If it turns out well, I&#8217;ll put it in the WP plugin directory and link to it from here.</p>
<p>Here are the requirements/specs I have for this plugin:</p>
<ul>
<li>Should use a short code of the form [filedownload: /path/to/file.txt] to define where the form should go and what file.</li>
<li>The form will submit to the current page, log the email entered, add a session flag.</li>
<li>If an email is in $_POST, the post/page will show the download link instead of the email form.</li>
<li>Files will be hidden behind a script to obscure the path to the file. The script will check for the session flag before returning the file.</li>
<li>Should use a template to make it easy to change the HTML/CSS for the form.</li>
<li>Should be easy to adjust the addEmail code to work with Constant Contact/etc.</li>
</ul>
<p>That&#8217;s it. Please join me. Post questions to the chat. Again, if this code comes out clean, I hope to share it.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=d354f9b6-a336-4f12-8416-77025c673772" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.strangerstudios.com/blog/2010/06/on-ustream-wordpress-plugin-to-capture-email-addresses-in-exchange-for-a-file-download/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unit of Measure PHP Class</title>
		<link>http://www.strangerstudios.com/blog/2010/02/unit-of-measure-php-class/</link>
		<comments>http://www.strangerstudios.com/blog/2010/02/unit-of-measure-php-class/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 03:17:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[New Projects]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.strangerstudios.com/blog/?p=52</guid>
		<description><![CDATA[For a recent project, we developed a php class that made it easier to work with units of measure. I was surprised that there wasn&#8217;t anything like this available out there, so we decided to open source the code once it was in a good state. That day has come. We will be updating this [...]]]></description>
			<content:encoded><![CDATA[<p>For a recent project, we developed a php class that made it easier to work with units of measure. I was surprised that there wasn&#8217;t anything like this available out there, so we decided to open source the code once it was in a good state. That day has come.</p>
<p>We will be updating this code (and this blog post) over the next few days and likely down the road as well. But in the meantime, here is a link to the GitHub repository: <a href="http://github.com/strangerstudios/phpUOM">phpUOM on GitHub</a>.</p>
<p>(If this goes well, we&#8217;ll hopefully be open sourcing a bit more of our code in the future.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.strangerstudios.com/blog/2010/02/unit-of-measure-php-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hidden 404 Errors with WordPress Plugin Pages</title>
		<link>http://www.strangerstudios.com/blog/2009/08/hidden-404-errors-with-wordpress-plugin-pages/</link>
		<comments>http://www.strangerstudios.com/blog/2009/08/hidden-404-errors-with-wordpress-plugin-pages/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 18:01:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://www.strangerstudios.com/blog/?p=46</guid>
		<description><![CDATA[After a couple hours, I've tracked down and fixed a bug I was having with some of our Wordpress plugins. I believe that there are a few people out there having the same problem. I think there may be another solution online, but it is one of those issues that is difficult to pare down to a good search query.

Anyway here is a solution for "404 issues with plugin pages" or "lynx shows a 404, but the page still loads", or "Google Webtools says there is a 404, but I can get to the page", or "setting status to 200:OK still results in 404", or "I get a 404 in IE, but refreshing the page brings it up", or "I get random 404 errors in IE", or "I'm getting an <em style="font-weight: bold; font-style: normal;">HTTP</em>/<em style="font-weight: bold; font-style: normal;">1.1 404</em><span> </span>Not Found error but the page still loads".]]></description>
			<content:encoded><![CDATA[<p>After a couple hours, I&#8217;ve tracked down and fixed a bug I was having with some of our WordPress plugins. I believe that there are a few people out there having the same problem. I think there may be another solution online, but it is one of those issues that is difficult to pare down to a good search query.</p>
<p>Anyway here is a solution for &#8220;404 issues with plugin pages&#8221; or &#8220;lynx shows a 404, but the page still loads&#8221;, or &#8220;Google Webtools says there is a 404, but I can get to the page&#8221;, or &#8220;setting status to 200:OK still results in 404&#8243;, or &#8220;I get a 404 in IE, but refreshing the page brings it up&#8221;, or &#8220;I get random 404 errors in IE&#8221;, or &#8220;I&#8217;m getting an <em style="font-weight: bold; font-style: normal;">HTTP</em>/<em style="font-weight: bold; font-style: normal;">1.1 404</em><span> </span>Not Found error but the page still loads&#8221;.</p>
<p>You may <a href="#finalsolution">skip ahead to the Final Solution code</a>, but it is probably a good idea to read everything below to make sure that you are indeed having the same issue I had&#8230; and that this will actually fix your problem.</p>
<h3>The Context</h3>
<p>I have some WordPress plguins (Stranger Products, Stranger Events) that generate pages outside of the core WordPress system (i.e. they are not &#8220;wordpress pages&#8221; in the WP DB, they are web pages generated by our plugin script). To serve these pages, I add a bunch of rules to the .htaccess file to redirect stuff like /products/1/ to a product info page.</p>
<p>Some gallery plugins or other plugins that generate new pages may have a similar setup/issue.</p>
<h3>The Problem</h3>
<p>While the mod rewrite works fine, and the page loads fine, WordPress doesn&#8217;t find a WP page or post for the query string and so sends a &#8220;HTTP/1.1 404 File Not Found&#8221; status in the header. Most web browsers will ignore this and show the content that comes after the header. It seems that IE will sometimes choke on this status, and other times show the page. Funny IE!</p>
<p>Google&#8217;s crawler however will not crawl that page and will let you know in a web toolkit report. Also, I noticed that the lynx command line browser for Linux would show the 404 error and then load the page.</p>
<p>The big issue here is that Google is not going to crawl our page.</p>
<h3>The Fix</h3>
<p>I spent a lot of time tracking down where in the WordPress code the 404 status is set. Ideally, there would be a plugin &#8220;hook&#8221; near this that we could use to prevent the 404 status from reaching the browser.</p>
<p>The function that makes the 404 decision is handle_404(), which can be found in the /wp-includes/classes.php file. Here is the code (for WordPress 2.8.4, similar for previous versions I looked at too):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> handle_404<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_query</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span> <span style="color: #339933;">==</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">posts</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>is_404<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>is_search<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">did_permalink</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'QUERY_STRING'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">false</span> <span style="color: #339933;">===</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'?'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// Don't 404 for these queries if they matched an object.</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> is_tag<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> is_category<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> is_author<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$wp_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_queried_object</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>is_404<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
				status_header<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">200</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">return</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000088;">$wp_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_404</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		status_header<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">404</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		nocache_headers<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>is_404<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		status_header<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">200</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>This would be the ideal place to say, &#8220;Hey, don&#8217;t 404 this page&#8221;, but there is no hook in here. I tried setting the $wp->did_permalink flag to FALSE, which worked sometimes, but sometimes WordPress would write that back to TRUE after I reset it. And I&#8217;m not even sure what that flag is doing; so playing with it might cause some bugs elsewhere.</p>
<p>The next place to check is the status_header() function called by handle_404. This function is found in the /wp-includes/functions.php file. Here is the code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> status_header<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$header</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> get_status_header_desc<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$header</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">empty</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$text</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$protocol</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;SERVER_PROTOCOL&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'HTTP/1.1'</span> <span style="color: #339933;">!=</span> <span style="color: #000088;">$protocol</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #0000ff;">'HTTP/1.0'</span> <span style="color: #339933;">!=</span> <span style="color: #000088;">$protocol</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #000088;">$protocol</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'HTTP/1.0'</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$status_header</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">$protocol</span> <span style="color: #006699; font-weight: bold;">$header</span> <span style="color: #006699; font-weight: bold;">$text</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'apply_filters'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
		<span style="color: #000088;">$status_header</span> <span style="color: #339933;">=</span> apply_filters<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'status_header'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$status_header</span><span style="color: #339933;">,</span> <span style="color: #000088;">$header</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #339933;">,</span> <span style="color: #000088;">$protocol</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #339933;">@</span><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$status_header</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #000088;">$header</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Tada! This function uses the &#8220;status_header&#8221; hook/filter before updating the header. So we can create a function in our plugin to check the status for a 404 and then return false/NULL if we know that there really is a page to load. Here&#8217;s how I did it.</p>
<p><a name="finalsolution"></a><br />
<h3>The Final Solution</h3>
<p>In PHP code for my pages, I created a global variable called $isapage and set it to true. So at the very top of any page that is giving the 404 errors, add this code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$isapage</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$isapage</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now I add the following function and filter to my plugin code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//this function checks if we have set the $isapage variable, and if so prevents WP from sending a 404</span>
<span style="color: #000000; font-weight: bold;">function</span> ssp_status_filter<span style="color: #009900;">&#40;</span><span style="color: #000088;">$s</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$isapage</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$isapage</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$s</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;404&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>	<span style="color: #666666; font-style: italic;">//don't send the 404</span>
	<span style="color: #b1b100;">else</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$s</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'status_header'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ssp_status_filter'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>I hope this helps some people out there. </p>
<p>Feel free to critique this solution. Let me know if I missed something or if there are better ways to do this. </p>
<p>Feel free to post related issues. I may have found solutions to those along the way&#8230; or maybe a commenter can help you out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.strangerstudios.com/blog/2009/08/hidden-404-errors-with-wordpress-plugin-pages/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Editing the StudioPress Lifestyle Theme</title>
		<link>http://www.strangerstudios.com/blog/2009/06/editing-the-studiopress-lifestyl-theme/</link>
		<comments>http://www.strangerstudios.com/blog/2009/06/editing-the-studiopress-lifestyl-theme/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 19:43:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Client Work]]></category>
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://www.strangerstudios.com/blog/?p=45</guid>
		<description><![CDATA[A client contracted us to make some updates to the StudioPress Lifestyle WordPress theme. I&#8217;m documenting the changes here so our client can possibly do this work themselves in the future, and it may also help others out there looking to tweak the StudioPress (or really any) premium theme. Changing the Menu Colors Changing the [...]]]></description>
			<content:encoded><![CDATA[<p>A client contracted us to make some updates to the <a href="http://www.studiopress.com/themes/lifestyle">StudioPress Lifestyle WordPress theme</a>. I&#8217;m documenting the changes here so our client can possibly do this work themselves in the future, and it may also help others out there looking to tweak the StudioPress (or really any) premium theme.</p>
<h3>Changing the Menu Colors</h3>
<p>Changing the color scheme involves updating the style.css stylsheet and creating new versions of various images. I did a rough mockup of the color changes in Photoshop, and then went to work on the images.</p>
<p>To change the header and headline elements from blue to orange, I did the following steps to these files:  header.png, header_blank.png, logo_blank.png, headline.png, and topnav.png.</p>
<ol>
<li>Open the image in Photoshop.</li>
<li>Goto Image &#8211;&gt; Mode &#8211;&gt; RGB Color to change the mode.</li>
<li>Create a new layer on top of the background.</li>
<li>Use the paint can tool to fill the new layer with your new color.</li>
<li>Change the layer type from &#8220;Normal&#8221; to &#8220;Color&#8221;.</li>
<li>(optional) If the brightness of the image is off now, create a new layer filled with the new color and change the layer type to &#8220;Luminosity&#8221;.</li>
<li>Save the image for web as a PNG 24.</li>
</ol>
<p>To change the background color of the higlighted/active submenu item, I changed the background color of line 381 (the &#8220;#subnav li a:hover, #subnav li:active&#8221; declaration).</p>
<p>You can also edit the navbar.png and navhov.png files to change the main menu.</p>
<h3>Changing the Header</h3>
<p>To change the logo from an image to plaintext, in the WP admin goto Appearance &#8211;&gt; Lifestyle Theme Options and change the Header Blog Title setting from &#8220;Image&#8221; to &#8220;Text&#8221;.</p>
<p>You can also edit the file in the /images/psds folder to use an Image logo in the header.</p>
<h3>Changing the Body/Page Background Colors</h3>
<p>I used the Firebug plugin for Firefox to inspect the original website to find out where certain colors and styles were set in the style.css file.</p>
<p>Using Firebug, I learned that the body&#8217;s background color is set on line 19. I changed this color from #E2DDCB to #1462A6.</p>
<p>You could also do a search and replace, but this color was only used in one spot in the style.css file.</p>
<p>Moving inward from the background, the next band of color is actually the border of the &#8220;wrap&#8221; element. I changed the color of the border declaration on line 35 to #6595BF.</p>
<h3>Changing Link and Text Colors</h3>
<p>The hyperlink colors are declared between lines 40 and 60.  The lifestyle theme uses the same color for links and visited links. I wanted a different visited color, so I changed that section of code to look like this:</p>
<blockquote><p>a {<br />
color: #1462A6;<br />
text-decoration: none;<br />
}</p>
<p><span> </span></p>
<p>a:visited {<br />
color: #6595BF;<br />
}</p>
<p>a:hover {<br />
color: #6595BF;<br />
text-decoration: underline;<br />
}</p>
<p><span> </span></p>
<p>a img {<br />
border: none;<br />
}</p>
<p><span> </span></p>
<p>a:focus, a:hover, a:active {<br />
outline: none;<br />
}</p></blockquote>
<p>To change the article heading link colors, search for &#8220;#content h1 a, #content h1 a:visited&#8221; and &#8220;#content h1 a:hover&#8221;. (I changed the colors around lines 586 and 595.)</p>
<h3>Hiding the Post Meta (&#8220;by&#8221;, &#8220;posted on&#8221;, &#8220;filed under&#8221;, &#8220;tags&#8221;, etc)</h3>
<p>I hid these using CSS. I added a &#8220;display: none;&#8221; line to the .date  declarations in style.css on line 779. To hide the tags (postmeta2) section, I add these lines under the .postmeta2 declaration around line 841:</p>
<blockquote><p>.postmeta p,  .postmeta2 p {<br />
display: none;<br />
}</p></blockquote>
<p>This will hide everything inside the postmeta2 section, but will still show the bottom border and bottom margin.</p>
<h3>Changing the Sidebar</h3>
<p>I removed the Blog Roll and Admin sections by commenting out lines 9 through 25 of the sidebar_right.php file in the theme directory.</p>
<p>I then added the following widgets:</p>
<ul>
<li>I added a &#8220;text&#8221; widget to &#8220;Sidebar Top&#8221; with some Google Adsense code for a 300&#215;250 ad.</li>
<li>I added a &#8220;text&#8221; widget to &#8220;Sidebar Top&#8221; with the title &#8220;Featured Video&#8221; and some embed code from YouTube. (Note: it didn&#8217;t seem to matter that the YouTube embed width was greater than 300 pixels. YouTube must size it to fit the page.)</li>
<li>I added a &#8220;recent posts&#8221; widget to &#8220;Sidebar Top&#8221; with the default settings.</li>
<li>I added a &#8220;text&#8221; widget to &#8220;Sidebar Bottom Right&#8221; with the title &#8220;Advertisement&#8221; and some code for a custom 120px x 600px ad.</li>
</ul>
<h3>Updating the Homepage</h3>
<p>The first thing we need to do is enable the home.php file as a template for our pages. We need to change this line in home.php:</p>
<blockquote><p>&lt;?php get_header();  ?&gt;</p></blockquote>
<p>to:</p>
<blockquote><p>&lt;?php<br />
/*<br />
Template Name: Homepage<br />
*/<br />
get_header();<br />
?&gt;</p></blockquote>
<p>Save and upload the file. Now edit the &#8220;Home&#8221; page in WP and choose &#8220;Homepage&#8221; as the page template. Save the page.</p>
<p>To choose which blog categories are used for the featured content areas, in WP Admin goto Appearance &#8211;&gt; Lifestyle Theme Options. Change the appropriate settings.</p>
<p>To get thumbnails to show up in the featured sections, add a custom field called &#8220;thumbnail&#8221; pointing to an image (70&#215;70 pixels is good) to use. You can upload these images to the post first and then copy the src url.</p>
<p>To set the thumbnails for the last (bottom) featured section, use &#8220;hpbottom&#8221; as the name of the custom field.</p>
<h3>Setting up the Featured Gallery (Fading Script)</h3>
<p>The first step here is to install the &#8220;featured content gallery&#8221; plugin. (It wasn&#8217;t included with my install, but it&#8217;s a freely available plugin.) In the WP Admin goto Plugins &#8211;&gt; Add New. Search for &#8220;featured content gallery&#8221;. Install the plugin. Activate the plugin.</p>
<p>Now goto Settings &#8211;&gt; Featured Content Gallery and choose either the category or page/post IDs to use for the gallery. You must also set a height and width and text area height in the next section (I used 588 width, 400 height, 100 height for the text). I left the colors as default. Update the settings.</p>
<p>The last thing you need to do is make sure you upload a picture (mine were 588&#215;400) and set a custom field called &#8220;articleimg&#8221; that points to the URL of the image you want to show up. The gallery will not show up unless you set this custom field.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.strangerstudios.com/blog/2009/06/editing-the-studiopress-lifestyl-theme/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Testing a Plugin</title>
		<link>http://www.strangerstudios.com/blog/2009/02/testing-a-plugin/</link>
		<comments>http://www.strangerstudios.com/blog/2009/02/testing-a-plugin/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 20:46:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[State Education Policy]]></category>

		<guid isPermaLink="false">http://www.strangerstudios.com/blog/?p=42</guid>
		<description><![CDATA[Just testing a plugin. Ignore this.]]></description>
			<content:encoded><![CDATA[<p>Just testing a plugin. Ignore this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.strangerstudios.com/blog/2009/02/testing-a-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing TopWhatever</title>
		<link>http://www.strangerstudios.com/blog/2009/02/introducing-topwhatever/</link>
		<comments>http://www.strangerstudios.com/blog/2009/02/introducing-topwhatever/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 20:43:40 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[New Projects]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.strangerstudios.com/blog/2009/02/05/introducing-topwhatever/</guid>
		<description><![CDATA[A new product from Stranger Studios. TopWhatever will change your life. From the about page: TopWhatever helps you make decisions by walking you through the process of creating a &#8220;decision matrix&#8221;. Using the matrix, you can weigh your options against the criteria that are important to you. Some decisions can get complicated quickly. The decisions [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.topwhatever.com"><img border="0" align="right" style="padding: 0pt 0pt 5px 5px" alt="TopWhatever" src="http://www.strangerstudios.com/blog/wp-content/uploads/2009/02/TopWhatever.gif" /></a>A new product from Stranger Studios. <a href="http://www.topwhatever.com">TopWhatever</a> will change your life. From the about page:</p>
<blockquote><p><span class="Apple-style-span" style="border-collapse: separate; color: #222222; font-family: Verdana; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px" /></p>
<p style="margin: 5px 0px 8px; padding: 0px">TopWhatever helps you make decisions by walking you through the process of creating a &#8220;decision matrix&#8221;. Using the matrix, you can weigh your options against the criteria that are important to you.</p>
<p style="margin: 5px 0px 8px; padding: 0px">Some decisions can get complicated quickly. The decisions you end up making can feel subjective rather than objective. TopWhatever helps you take things step by step. You end up with a decision that is sound, with the math to prove it.</p>
<p style="margin: 5px 0px 8px; padding: 0px">The best way to understand how TopWhatever works is to view<span class="Apple-converted-space"> </span><a style="color: #58b7dd" href="http://www.strangerstudios.com/browse">decisions that have already been made</a>.</p>
</blockquote>
<p>So check it out already. <a title="TopWhatever - Decision Matrix Tool" href="http://www.topwhatever.com">Use TopWhatever to make a decision</a> that has been on your mind lately.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.strangerstudios.com/blog/2009/02/introducing-topwhatever/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
