<?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>Fourced &#187; Programming</title>
	<atom:link href="http://lohmantrading.com/Fourced/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://lohmantrading.com/Fourced</link>
	<description>Pure Fource !</description>
	<lastBuildDate>Sat, 31 Oct 2009 02:48:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<atom:link rel="next" href="http://lohmantrading.com/Fourced/tag/programming/feed/?page=2" />

		<item>
		<title>How To Create Multiple WordPress Sidebar Columns</title>
		<link>http://lohmantrading.com/Fourced/2009/09/how-to-create-multiple-wordpress-sidebar-columns/</link>
		<comments>http://lohmantrading.com/Fourced/2009/09/how-to-create-multiple-wordpress-sidebar-columns/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 17:02:01 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[CSS and PHP]]></category>
		<category><![CDATA[WordPress Templates & Design]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Templates]]></category>

		<guid isPermaLink="false">http://lohmantrading.com/Fourced/?p=933</guid>
		<description><![CDATA[In this article we are going to take a look at creating and displaying different side columns in different locations of your WordPress blog.  This will be a lot like Creating Multiple Header Files, but we will be modifying the functions file so that we can use widgets in our side column.

 Why do [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-left: 2px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flohmantrading.com%2FFourced%2F2009%2F09%2Fhow-to-create-multiple-wordpress-sidebar-columns%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flohmantrading.com%2FFourced%2F2009%2F09%2Fhow-to-create-multiple-wordpress-sidebar-columns%2F" height="61" width="51" /></a></div><p>In this article we are going to take a look at creating and displaying different side columns in different locations of your WordPress blog.  This will be a lot like <a href="http://lohmantrading.com/Fourced/2009/07/creating-multiple-header-files-in-wordpress/">Creating Multiple Header Files</a>, but we will be modifying the functions file so that we can use widgets in our side column.<br />
<BR><br />
<H3><B> Why do we want to do this ?</b></h3>
<p>The benefits of creating different side columns can be seen right away. You can easily give each &#8220;section&#8221; of your blog a completely fresh and unique look &#8230; especially if you use <a href="http://lohmantrading.com/Fourced/2009/07/how-to-display-subcategories-wordpress-category-templates/" target="_blank">Category Templates</a>.  You may also want to run a thinner or wider side column on certain pages in your blog.  For example, a 300 wide column may be unfeasible on a WordPress page that contains a forum plugin.  For that page you may need extra room for the forum, so cutting the side column down to around 150 may make more sense.<br />
<BR>You will notice that the side column on the index page of this blog ( <a href="http://lohmantrading.com/Fourced/" target="_blank">here</a> ) is quite a bit different then the side column on this page.  Not only is the width about 1/2 the size of the column on this page, but it also displays different widgets.<br />
<BR>There are a couple of different ways to accomplish this feat, I am just going to focus on the method that I used for this blog.<br />
<BR><B>Before we begin, please note that we are creating a SECOND sidebar.  We are not replacing the first sidebar, so do not delete any of the code for your first, original sidebar.</b>  (unless, of course, that is your desire)<br />
<BR><BR></p>
<h3><B>Step 1.  Modifying The Functions File</b></h3>
<p>You do not necessarily need to <i>start</i> with this, but since most of us probably do not modify the <b>functions.php</b> file very often I figure that we will get the &#8220;hard&#8221; stuff out of the way first.<br />
<BR>When viewing your functions.php file ( in your current templates folder ) you should notice  <B> &#8230;. function_exists(&#8217;register_sidebar&#8217;) &#8230; </b>.  That little batch of code registers your CURRENT side bar and allows it to show-up in your appearance > widgets section of admin.  What we need to do is throw-in a new little piece of code to register our new side column.  The code I used for this blog is &#8230;<br />
<BR><B>if ( function_exists(&#8217;register_sidebar&#8217;) )<br />
register_sidebar(array(&#8217;name&#8217;=&gt;&#8217;frontsidebar&#8217;,<br />
&#8216;before_widget&#8217; =&gt; &#8216;&lt;div class=&#8221;widget-front&#8221;&gt;&#8217;,<br />
&#8216;after_widget&#8217; =&gt; &#8216;&lt;/div&gt;&#8217;,<br />
&#8216;before_title&#8217; =&gt; &#8216;&lt;div class=&#8221;widget-title-front&#8221;&gt;&lt;h2 &gt;&#8217;,<br />
&#8216;after_title&#8217; =&gt; &#8216;&lt;/h2&gt;&lt;/div&gt;&#8217;,<br />
));<br />
</b><BR>Basically this little piece of code is a copy-and-paste duplicate of MY original sidebar code.  I just pasted it directly below the code for the first sidebar in my functions.php.  <b>It is suggested that you do the same</b> &#8230; copy your original code and then paste it.<br />
<BR>From that point I just changed the name of the sidebar (frontsidebar) and changed the div classes (widget-front).  Note that you will also need go into your stylesheet (style.css) and create your new div classes shown above.<br />
<BR>Ok &#8230; now swing over to Appearance > Widgets in your WordPress admin.  On the right hand side your new &#8220;mainsidebar&#8221; should appear.  You will be able to add widgets to it later.<br />
<BR><BR></p>
<h3><B>Step 2.  Creating frontsidebar.php</b></h3>
<p>In this step we are going to create the actual sidebar file.  One of the simplest ways to do this is to make an exact copy of your current sidebar file (probably named sidebar.php), save it under the new name &#8220;frontsidebar.php&#8221;, and make the changes noted below.  Make sure to NOT delete your original sidebar file.<br />
<BR>The basic elements of a sidebar file look like:<br />
<BR><B>&lt;div id=&#8221;sidebar-main&#8221;&gt;<br />
&lt;?<br />
global $options;<br />
foreach ($options as $value) {<br />
if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }</p>
<p>}</p>
<p>?&gt;<br />
&lt;div id=&#8221;mini-left&#8221;&gt;<br />
&lt;?php if ( !function_exists(&#8217;dynamic_sidebar&#8217;) || !dynamic_sidebar(<font color="red">frontsidebar</font>) ) : ?&gt;<br />
&lt;?php endif; ?&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;<br />
</b><br />
<BR>Obviously your div classes may have different names then mine. Make sure your names are unique and then go into stylesheet and create those classes.  This is where you will want to create the look of your side column.  Probably make it look different then your main sidebar.<br />
<BR>The important thing here is the name of your dynamic sidebar.  Make sure to change that name to the exact name that you used to create your new sidebar in your functions file (above).  That is the one key element that <b>must</b> be done.<br />
<BR><BR></p>
<h3><B>Step 3.  Call Your New Side Column</b></h3>
<p>Step 3 is definitely the easiest &#8230; place the code to call your new sidebar.<br />
<BR><B>&lt;?php include (TEMPLATEPATH . &#8220;/frontsidebar.php&#8221;); ?&gt;</b><br />
<BR>Make sure the sidebar name that appears in your call matches the name of the PHP file that you created directly above.  Note that it does not need to match the name you used in the functions file.  If you want to use your new side column IN PLACE OF your original side column then just replace the call for the original column.  If you want to use BOTH side columns on the same page then, obviously, leave the call for the first side column and just add the new call in the location you would like it to appear.<br />
<BR><BR></p>
<h3><B>Step 4.  Add Widgets &#038; Div Classes</b></h3>
<p>The final step is kind of a no-brainer.  First, you can now go into Appearance > Widgets in your WordPress admin and add any widgets you would like to your new side column.<br />
<BR>Lastly &#8230; just another reminder &#8230; make sure to go into your stylesheet and add all of your new div classes.  Obviously, if you want your side column to look exactly like your first one, then you can just use all of the same classes.  But, if you want your new column to look differently, then mess around adding new classes and settings to give it a unique look.<br />
<BR>Through the use of your classes &#8230; float right, float left, padding, margin &#8230; you can do a lot of different things with your 2 (or more) different side columns.  </p>
<ul>
<li>You can run a different side column in a different location &#8230; ie: my home page compared to the rest of my site.</li>
<li>You can run 2 side columns on the same page right next to each other.</li>
<li>You can run a left side column and a right side column.</li>
<li>You can run a left side column and 2 right side columns.</li>
<li>And so on &#8230;.</li>
</ul>
<p><BR>Think about this &#8230; if you decorate your blog by the seasons or change the look occationally &#8230; then how easy would it be to create 4 different sidebar columns.  Just change the call in step #3 to a different sidebar to change the look instantly !<br />
<BR>I actually have 3 different side columns on this blog, but I only currently have 2 in use.<br />
<BR><br />
Hopefully this article has been a help to those of us who are not &#8220;code&#8221; addicts.  I like to pass-along tidbits of information that might allow non-programmers the ability to modify their own websites.  Please keep in mind that I am not a professional programmer but I have been building and modifying websites since 1995 using HTML, cgi, perl, MIVA, PHP, and CSS.  Suggestions on other ways to reach the desired goals above are always welcome  &#8230;  please consider leaving a comment !<br />
<BR><b>Always remember to save copies of your original files BEFORE you modify them.  This will allow you to easily revert your web site if the changes do not work.</b><br />
<BR>Comments <i>( <a href="#respond">leave a comment here</a> )</i> and thoughts <B>ALWAYS</B> welcome !<br />
<BR><br />
<img src="http://www.lohmantrading.com/Fourced/graphics/Chris_Signature.jpg"><br />
<UL>
<li>Go ahead and <a href="http://lohmantrading.com/Fourced/rss-subscribe/">STALK ME</a> &#8211; electronically of course &#8211; <a href="http://lohmantrading.com/Fourced/rss-subscribe/">Subscribe Here</a></li>
</ul>
<p><BR><BR></p>
]]></content:encoded>
			<wfw:commentRss>http://lohmantrading.com/Fourced/2009/09/how-to-create-multiple-wordpress-sidebar-columns/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How To Create Mini Photo Albums on WordPress Post Pages</title>
		<link>http://lohmantrading.com/Fourced/2009/08/how-to-create-mini-photo-albums-on-wordpress-post-pages/</link>
		<comments>http://lohmantrading.com/Fourced/2009/08/how-to-create-mini-photo-albums-on-wordpress-post-pages/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 21:29:29 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[Design Techniques]]></category>
		<category><![CDATA[Images and Graphics]]></category>
		<category><![CDATA[WordPress Templates & Design]]></category>
		<category><![CDATA[Graphics and Icons]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Site Design]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://lohmantrading.com/Fourced/?p=888</guid>
		<description><![CDATA[In this article we will be creating mini photo albums on our WordPress post pages in the photography category.  These photo albums will replace our standard &#8220;Related Posts&#8221; link lists on these pages and create a very nice graphic display of related photographs.  Hopefully this will make it easier for your blog visitors [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-left: 2px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flohmantrading.com%2FFourced%2F2009%2F08%2Fhow-to-create-mini-photo-albums-on-wordpress-post-pages%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flohmantrading.com%2FFourced%2F2009%2F08%2Fhow-to-create-mini-photo-albums-on-wordpress-post-pages%2F" height="61" width="51" /></a></div><p><IMG SRC="http://www.lohmantrading.com/Fourced/post-images/PostPage_PhotoAlbums.jpg" hspace="12" img class="alignleft" alt="WordPress post pages photo albums">In this article we will be creating mini photo albums on our WordPress post pages in the photography category.  These photo albums will replace our standard &#8220;Related Posts&#8221; link lists on these pages and create a very nice graphic display of related photographs.  Hopefully this will make it easier for your blog visitors to find related photographs and entice additional page visits.<br />
<BR>In my TimThumb thumbnail article I talked about the wonderful flexibility that timthumb.php offers.  I also stated that my next project with this program would be to create mini photo albums on the post pages in my <B>Art and Photography Category</b>.  Well, I am happy to announce that I have actually completed that project A LOT quicker then I thought I would.<br />
<BR>Before reading this article, it is suggested that you take a look at the following previous articles.  By reading these articles first you will have a much better understanding of the procedure to create the photo albums :<br />
1. <a href="http://lohmantrading.com/Fourced/2009/08/beautiful-and-easy-thumbnails-with-timthumb/">Beautiful and Easy Thumbnails with TimThumb</a><br />
2. <a href="http://lohmantrading.com/Fourced/2009/07/how-to-display-subcategories-wordpress-category-templates/">How To Display Subcategories &#038; WordPress Category Templates</a><br />
3. <a href="http://lohmantrading.com/Fourced/2009/08/wordpress-loop-inside-of-a-loop/">WordPress Loop Inside Of A Loop</a><br />
<BR><br />
You can see an example of the mini photo albums on my <a href="http://lohmantrading.com/Fourced/2009/08/perfectly-pink-irish-clover-flower-blooms/" target="_blank">Clover Flowers post</a>.  The photo album appears below my signature in the &#8220;Related Posts&#8221; section.<br />
<BR><br />
<B>STEP 1.</b><br />
You must have timthumb.php installed on your WordPress blog or this code will not work.  If you need to install timthumb.php, please visit the <a href="http://lohmantrading.com/Fourced/2009/08/beautiful-and-easy-thumbnails-with-timthumb/" target="_blank">Timthumb Page</a> for details.<br />
<BR><br />
<B>STEP 2.</b><br />
The first step is to create a custom field on your &#8220;Add New Posts&#8221; page in WP admin. Click on &#8220;add new&#8221; in the custom field section of the page and add a new field named <B>photoalbum</b>.  You can obviously change the field name to anything you would like.<br />
<BR><br />
<B>STEP 3.</b><br />
Add the following code to your <B> &#8220;single.php&#8221; </b> page. (this page displays your individual posts)<br />
<B><BR>&lt;B&gt;&lt;h3&gt;Related Posts:&lt;/h3&gt;&lt;/B&gt;<br />
&lt;?php $photoalbumlink = get_post_meta($post-&gt;ID, &#8216;photoalbum&#8217;, true);<br />
if ($photoalbumlink) {<br />
?&gt;<br />
Below are more photographs from the same photo album. You can visit the main photo album page if you would like to see all of the photographs from this album.<br />
&lt;BR&gt;<br />
&lt;?php $my_queryphoto = new WP_Query(&#8217;cat=&#8217;.$photoalbumlink.&#8217;&amp;showposts=10&#8242;); ?&gt; &lt;?php while ($my_queryphoto-&gt;have_posts()) : $my_queryphoto-&gt;the_post(); ?&gt;</p>
<p>&lt;?php<br />
$thumbnail = get_post_custom();<br />
$scrap = get_bloginfo(&#8217;wpurl&#8217;) . &#8216;/wp-content/themes/YOUR_THEME_NAME/timthumb.php?&#8217;;<br />
if (empty($thumbnail['thumbnail'][0])) {<br />
$imagpath = $scrap . &#8217;src=&#8217; . get_bloginfo(&#8217;wpurl&#8217;) . &#8216;/wp-content/themes/YOUR_THEME_NAME/images/thumbnail.jpg&#8217; . &#8216;&amp;amp;w=100&amp;amp;h=80&amp;amp;zc=1&#8242;;<br />
} else {<br />
$imagpath = $scrap . &#8217;src=&#8217; . $thumbnail['thumbnail'][0] . &#8216;&amp;amp;w=90&amp;amp;h=70&amp;amp;zc=1&#8242;;<br />
}<br />
?&gt;<br />
&lt;a href=&#8221;&lt;?php the_permalink() ?&gt;&#8221; rel=&#8221;bookmark&#8221; title=&#8221;&lt;?php the_title(); ?&gt;&#8221;&gt;&lt;img src=&#8221;&lt;?php echo $imagpath; ?&gt;&#8221; alt=&#8221;&lt;?php the_title(); ?&gt;&#8221; /&gt;&lt;/a&gt;<br />
&lt;?php endwhile; ?&gt;</p>
<p>&lt;BR&gt; See more photos in the album: &lt;?php wp_list_categories(&#8217;include=&#8217;.$photoalbumlink.&#8217;&amp;style=html&amp;title_li=&#8217;); ?&gt;</p>
<p>&lt;?php } else { ?&gt;<br />
&lt;?php similar_posts(); ?&gt;<br />
&lt;?php } ?&gt;<br />
<BR>&lt;?php rewind_posts(); the_post(); ?&gt;</b> <--- your MIGHT need this snippet<br />
<BR><br />
<b>CODE BREAKDOWN:</b> Here is a breakdown of the above code &#8230;<br />
<BR>First &#8230; in my example, when you want to display the mini photo album on the post page you should enter the <b>cat id</b> (number) of the category you want displayed as the photo album.  Enter this number as the value for your photoalbum custom field when you are adding a new post.  This is especially useful if you post photos to more then one category.<br />
<BR><br />
<font color="red"><B>&lt;?php $photoalbumlink = get_post_meta($post-&gt;ID, &#8216;photoalbum&#8217;, true);<br />
if ($photoalbumlink) {<br />
?&gt;</b></font><br />
This segment of the code checks to see if your post has the &#8220;photoalbum&#8221; custom field specified.  If the photoalbum field has been filled out when you wrote your post (true statement) then it is renamed to <b>photoalbumlink</b>.  If the photoalbum field was not filled out, then we jump down to the <b>else</b> statement further down the page.<br />
<BR><br />
<font color="red"><B>&lt;?php $my_queryphoto = new WP_Query(&#8217;cat=&#8217;.$photoalbumlink.&#8217;&amp;showposts=10&#8242;); ?&gt; &lt;?php while ($my_queryphoto-&gt;have_posts()) : $my_queryphoto-&gt;the_post(); ?&gt;</b></font><br />
We need to create another loop to pull-in the photo thumbnails for the photo album. Since I am already running 2 other loops on the post page  (gallery at top of page <B>and</b> the loop to pull the post info in) I needed to pick a unique term for this loop &#8211; &#8220;queryphoto&#8221;.  See the article link above for <B>&#8220;Loop inside of a Loop&#8221;</b> for more information on this.  In the query I am specifying which category/subcategory to pull the thumbs from using <B>cat=.$photoalbumlink.</b> with the photoalbumlink being the cat id number that we specified in our custom field when we created the post.  I am also requesting that only 10 post thumbnails be shown.<br />
<BR><br />
<font color="red"><B>&lt;?php<br />
$thumbnail = get_post_custom();<br />
&#8230;&#8230;.. THROUGH &#8230;&#8230;.<br />
&lt;a href=&#8221;&lt;?php the_permalink() ?&gt;&#8221; rel=&#8221;bookmark&#8221; title=&#8221;&lt;?php the_title(); ?&gt;&#8221;&gt;&lt;img src=&#8221;&lt;?php echo $imagpath; ?&gt;&#8221; alt=&#8221;&lt;?php the_title(); ?&gt;&#8221; /&gt;&lt;/a&gt;</b></font><br />
All of this code is from <B>timthumb.php.</b>  There is really no sense to go through all of it again in this article.  If you are unfamiliar with any part of this code, please take a look at my article: <a href="http://lohmantrading.com/Fourced/2009/08/beautiful-and-easy-thumbnails-with-timthumb/">Beautiful and Easy Thumbnails with TimThumb</a>.<br />
<BR><br />
<font color="red"><B>&lt;BR&gt; See more photos in the album: &lt;?php wp_list_categories(&#8217;include=&#8217;.$photoalbumlink.&#8217;&amp;style=html&amp;title_li=&#8217;); ?&gt;</p>
<p>&lt;?php } else { ?&gt;<br />
&lt;?php similar_posts(); ?&gt;<br />
&lt;?php } ?&gt;</b></font><br />
There are 2 important parts to this code segment.<br />
<BR><B>1.</b> The &#8220;See more &#8230;&#8221; segment of the code creates a link to to the rest of the pictures in this photo album (category).  The &#8220;include&#8221; requirement is telling WordPress to link ONLY to the category specified in our custom field.  This is the same category that was used in our query posts above.<br />
<BR><B>2.</b> Everything after the &#8220;ELSE&#8221; statement is displayed if you DID NOT specify a cat id in your photoalbum custom field of the &#8220;add new post&#8221; page.  In other words, if you leave it blank the following will display.  You will need this so WordPress will know what to display on post pages that are NOT in the photography category.  In my case above, I am using a &#8220;similar posts&#8221; plugin to display text links to similar posts.  If you look below in the &#8220;related posts&#8221; section on this page you will notice that NO photo album appears, just the related posts links.<br />
<BR><br />
<font color="red"><B>&lt;?php rewind_posts(); the_post(); ?&gt;</b></font><br />
You will need this little piece of code IF you need to return to the original post query.  You will need this for your comments box IF you place this photo album above it.  You may also need it if you have social networking submission links below the photo album.  I am not 100% comfortable with this little code piece, but as far as I can tell is that it is telling WordPress to re-populate the &#8220;query&#8221; with the original query post information.  For example, the permalink and the title from the post that displays on your page.<br />
<BR><br />
<B>WHY AM I DOING IT THIS WAY</b><br />
<BR>When you look at all the above code, you may notice that there may be slightly easier ways to accomplish this task.  Maybe you have seen a &#8220;related posts&#8221; program that would accomplish this.  Maybe a gallery program would.  But I can pretty much guarantee that those will not offer you the type of flexibility that this does.  The above method offers post-by-post flexibility.  I would like to see a standard plug-in offer that.<br />
<BR>This method is very useful for me because I post my photographs in up to three categories.  For a photo of the ocean I may display it in the &#8220;ocean&#8221; category, the &#8220;scenic&#8221; category, and the &#8220;Patrick&#8217;s Point&#8221; category.  For my post page mini photo albums I would like to display related pictures based upon the LOCATION (Patrick&#8217;s Point) so I would select that cat id for my custom field.<br />
<BR>As a side note, my Patrick&#8217;s Point Category is a sub-sub-category.  It is semi-hidden under my &#8220;Photos By Location&#8221; subcategory under the photography category.  This, I suppose, will be yet another article in the near future.  <img src='http://lohmantrading.com/Fourced/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
<BR>The flexibility of this method is endless.  For example, I could display a photo album of flowers on the bottom of this post if I so desired, just by entering the cat id in my custom field.  I think you probably get the picture &#8230;<br />
<BR><br />
Hopefully this article has been a help to those of us who are not &#8220;code&#8221; addicts.  I like to pass-along tidbits of information that might allow non-programmers the ability to modify their own websites.  Please keep in mind that I am not a professional programmer but I have been building and modifying websites since 1995 using HTML, cgi, perl, MIVA, PHP, and CSS.  Suggestions on other ways to reach the desired goals above are always welcome  &#8230;  please consider leaving a comment !<br />
<BR><b>Always remember to save copies of your original files BEFORE you modify them.  This will allow you to easily revert your web site if the changes do not work.</b><br />
<BR>Comments <i>( <a href="#respond">leave a comment here</a> )</i> and thoughts <B>ALWAYS</B> welcome !<br />
<BR><br />
<img src="http://www.lohmantrading.com/Fourced/graphics/Chris_Signature.jpg"><br />
<UL>
<li>Go ahead and <a href="http://lohmantrading.com/Fourced/rss-subscribe/">STALK ME</a> &#8211; electronically of course &#8211; <a href="http://lohmantrading.com/Fourced/rss-subscribe/">Subscribe Here</a></li>
</ul>
<p><BR><BR></p>
]]></content:encoded>
			<wfw:commentRss>http://lohmantrading.com/Fourced/2009/08/how-to-create-mini-photo-albums-on-wordpress-post-pages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Do Follow On The Fuzzy Love Comment Train</title>
		<link>http://lohmantrading.com/Fourced/2009/08/do-follow-on-the-fuzzy-love-comment-train/</link>
		<comments>http://lohmantrading.com/Fourced/2009/08/do-follow-on-the-fuzzy-love-comment-train/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 12:21:54 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[About Blogging]]></category>
		<category><![CDATA[General Thoughts]]></category>
		<category><![CDATA[Give your Opinion]]></category>
		<category><![CDATA[New On Fourced]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[WordPress Plugins]]></category>

		<guid isPermaLink="false">http://lohmantrading.com/Fourced/?p=832</guid>
		<description><![CDATA[If you couldn't tell I completely hate the term "linky love" so, yes, I am making fun of it in the title of this post.  But if you leave a comment on this blog you will receive a do-follow link to your web site.  Get in our "Top Commentators"  section and stay there for 3 months !]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-left: 2px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flohmantrading.com%2FFourced%2F2009%2F08%2Fdo-follow-on-the-fuzzy-love-comment-train%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flohmantrading.com%2FFourced%2F2009%2F08%2Fdo-follow-on-the-fuzzy-love-comment-train%2F" height="61" width="51" /></a></div><p><IMG SRC="http://www.lohmantrading.com/Fourced/post-images/Post_DoFollowComments.jpg" hspace="12" img class="alignleft" alt="Do-Follow Link Love"><br />
If you couldn&#8217;t tell I completely hate the term &#8220;linky love&#8221; so, yes, I am making fun of it in the title of this post.  Even though I hate that term, I do like handing out links &#8230; which you will receive if you leave a comment on this blog.<br />
<BR>The &#8220;Recent Comments&#8221; section in the side column is our newest addition.  Now, every time you leave a comment on this blog it will be displayed not only on the post page, but also in the side column.  This also includes links to your web site or blog.<br />
<BR>You will also notice a &#8220;Top Commentators&#8221; section in the side column that highlights the people who have left the most comments over the last 3 months &#8230; with <B>&#8220;do-follow&#8221;</b> links to your web site or blog.  Constant commentators can easily stay in the top spot and receive a <B>do-follow</b> link for all 3 months !<br />
<BR>You spent the time to type up a thoughtful comment so the least we could do is give you a little &#8220;somethin&#8217;-somethin&#8217;&#8221;.<br />
<BR>So read through the posts on this blog and leave me some comments ! (demanding, huh ?)  I really do like to hear different opinions and different ways to do things &#8230; so you don&#8217;t always have to agree with me.  <img src='http://lohmantrading.com/Fourced/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />    &#8230;.. and I try to reply to most &#8230;..<br />
<BR>Comments <i>( <a href="#respond">leave a comment here</a> )</i> and thoughts <B>ALWAYS</B> welcome !<br />
<BR><br />
<img src="http://www.lohmantrading.com/Fourced/graphics/Chris_Signature.jpg"><br />
<UL>
<li>Go ahead and <a href="http://lohmantrading.com/Fourced/rss-subscribe/">STALK ME</a> &#8211; electronically of course &#8211; <a href="http://lohmantrading.com/Fourced/rss-subscribe/">Subscribe Here</a></li>
</ul>
<p><BR><BR></p>
]]></content:encoded>
			<wfw:commentRss>http://lohmantrading.com/Fourced/2009/08/do-follow-on-the-fuzzy-love-comment-train/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Beautiful and Easy Thumbnails with TimThumb</title>
		<link>http://lohmantrading.com/Fourced/2009/08/beautiful-and-easy-thumbnails-with-timthumb/</link>
		<comments>http://lohmantrading.com/Fourced/2009/08/beautiful-and-easy-thumbnails-with-timthumb/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 08:53:55 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[CSS and PHP]]></category>
		<category><![CDATA[Design Techniques]]></category>
		<category><![CDATA[Images and Graphics]]></category>
		<category><![CDATA[WordPress Templates & Design]]></category>
		<category><![CDATA[Graphics and Icons]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Site Design]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://lohmantrading.com/Fourced/?p=819</guid>
		<description><![CDATA[A few articles back I mentioned that I would do a post about the thumbnail program that this blog uses &#8230; TimThumb.  Without further ado let&#8217;s take a peek at this small php program.

What This Program Does
Timthumb.php will crop, zoom, and resize any and all images and photos on your website.  This program [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-left: 2px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flohmantrading.com%2FFourced%2F2009%2F08%2Fbeautiful-and-easy-thumbnails-with-timthumb%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flohmantrading.com%2FFourced%2F2009%2F08%2Fbeautiful-and-easy-thumbnails-with-timthumb%2F" height="61" width="51" /></a></div><p><IMG SRC="http://www.lohmantrading.com/Fourced/post-images/Post_TimThumb.jpg" hspace="12" img class="alignleft" alt="TimThumb photo thumbnail program">A few articles back I mentioned that I would do a post about the thumbnail program that this blog uses &#8230; TimThumb.  Without further ado let&#8217;s take a peek at this small php program.<br />
<BR><br />
<B>What This Program Does</b><br />
Timthumb.php will crop, zoom, and resize any and all images and photos on your website.  This program will work with .jpg, .png, and .gif images.<br />
<BR><br />
<B>Why Do We Want This Program</b><br />
I like this program because of one thing &#8230; simplicity.  Timthumb came with this theme originally and I have since learned to love it.  There are probably thousands of different WordPress gallery plugins, programs, and thumbnail programs.  Some plugins, by their nature, may be easier to install, but they are not as flexible.<br />
<BR>Timthumb.php runs the following special segments on this blog:  handles all of the article image thumbnailing, runs the mini latest posts gallery at the top of the page (<a href="http://lohmantrading.com/Fourced/2009/08/wordpress-loop-inside-of-a-loop/">article here</a>), and my current adventure of turning my photos category into a gallery.   All of the design and layout is handled by your theme and it&#8217;s stylesheet so it makes it a lot easier to implement timthumb in many different areas of your blog.<br />
<BR>Because only one PHP file is required to do all of that, I have decided to get rid on my photo gallery plugin ( YAPB ) in favor of using timthumb.php.<br />
<BR>The flexibility of timthumb, along with the ease of having only 1 file to look at anywhere thumbnails or galleries are concerned, makes it a win-win for me.<br />
<BR><br />
<B>Installing TimThumb</B><br />
Grab your copy of timthumb for free on the <b><a href="http://code.google.com/p/timthumb/">TimThumb Google Project Page</a></b>.<br />
<BR><BR>1. </b>After you download your copy upload it to your server.  It would probably make the most sense to place it in your current THEME folder like:<br />
<B>MY_WEBSITE/wp-content/themes/MY_THEME/timthumb.php</b><br />
<BR><B>2.</b> On your &#8220;Add Post&#8221; page in WordPress administration you will need to ad a custom field at the lower part of the page.  Let&#8217;s name this custom field &#8220;thumbnail&#8221;.  From now on you can add the URL of the image you want to use as a thumbnail in this field.<br />
<BR><b>3.</b> Add the following code to your theme pages wherever you would like the thumbnail to appear:<br />
<B><BR><br />
&lt;?php<br />
$thumbnail = get_post_custom();<br />
<BR>$scrap = get_bloginfo(&#8217;wpurl&#8217;) . &#8216;/wp-content/themes/<font color="red">YOUR_THEME</font>/timthumb.php?&#8217;;<br />
<BR>if (empty($thumbnail['thumbnail'][0])) { $imagpath = $scrap . &#8217;src=&#8217; . get_bloginfo(&#8217;wpurl&#8217;) . &#8216;/wp-content/themes/<font color="red">YOUR_THEME</font>/images/thumbnail.jpg&#8217; . &#8216;&amp;amp;w=140&amp;amp;h=140&amp;amp;zc=0&amp;amp;q=90&#8242;;<br />
<BR>} else {<br />
 $imagpath = $scrap . &#8217;src=&#8217; . $thumbnail['thumbnail'][0] . &#8216;&amp;amp;w=140&amp;amp;h=140&amp;amp;zc=0&amp;amp;q=90&#8242;;<br />
<BR>}<br />
 ?&gt;<br />
</b><br />
<BR><br />
Now let&#8217;s look at the code piece by piece &#8230;<br />
<BR>The <B>$scrap</b> line &#8230; this is the path to your installation of timthumb &#8230; you will need to change your theme name.  If you installed the file in your theme folder then everything else on this line should be correct, but double check that this path is correct.<br />
<BR>The <b>if empty</b> line tells timthumb what to do if you have not included a thumbnail with your post.  Upload a generic thumbnail to your themes/images/ folder that timthumb can use.  make sure the name of this image is &#8221; thumbnail.jpg &#8221; &#8211; OR &#8211; change the name in the code above.<br />
<BR>The <B>else</b> line creates the thumbnail for your post if you have specified one.<br />
<BR>The settings.  In the above code you will need to change the settings &#8230;<br />
&#8220;w&#8221; stands for the desired width of the thumbnail,<br />
&#8220;h&#8221; stands for the desided height of the thumbnail,<br />
&#8220;zc&#8221; stands for zoom crop (0 is no, 1 is yes),<br />
and &#8220;q&#8221; stands for quality (75 to 100 &#8230; 75 is default).<br />
<BR>Finally, you will probably want to wrap the above code in a <B>div class/id</b> so that you can influence the display.  You can add your new class to your theme&#8217;s stylesheet.<br />
<BR><br />
As you can probably tell from the above code, there is a lot of flexibility here and that is what I like with using this program.  You can run this code anywhere on your page and you can use it as many times as you would like.  In addition, in each and every application of this code you can change the setting to anything you would like.<br />
<BR>My next major project with this code will be developing photo albums to display below below photo posts.  These will contain thumbs of other photos directly related to the original post by category or tag.  I hope to use a new &#8220;Custom Field&#8221; which will allow me to specify which category, tag, or search term to use in gathering the thumbs &#8230; everything else will be automatic.  This, though, is probably still a while away &#8230; <img src='http://lohmantrading.com/Fourced/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
<BR><br />
Hopefully this article has been a help to those of us who are not &#8220;code&#8221; addicts.  I like to pass-along tidbits of information that might allow non-programmers the ability to modify their own websites.  Please keep in mind that I am not a professional programmer but I have been building and modifying websites since 1995 using HTML, cgi, perl, MIVA, PHP, and CSS.  Suggestions on other ways to reach the desired goals above are always welcome  &#8230;  please consider leaving a comment !<br />
<BR><b>Always remember to save copies of your original files BEFORE you modify them.  This will allow you to easily revert your web site if the changes do not work.</b><br />
<BR>Comments <i>( <a href="#respond">leave a comment here</a> )</i> and thoughts <B>ALWAYS</B> welcome !<br />
<BR><br />
<img src="http://www.lohmantrading.com/Fourced/graphics/Chris_Signature.jpg"><br />
<UL>
<li>Go ahead and <a href="http://lohmantrading.com/Fourced/rss-subscribe/">STALK ME</a> &#8211; electronically of course &#8211; <a href="http://lohmantrading.com/Fourced/rss-subscribe/">Subscribe Here</a></li>
</ul>
<p><BR><BR></p>
]]></content:encoded>
			<wfw:commentRss>http://lohmantrading.com/Fourced/2009/08/beautiful-and-easy-thumbnails-with-timthumb/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Executable PHP Widget &#8211; WordPress Plugin</title>
		<link>http://lohmantrading.com/Fourced/2009/08/executable-php-widget-wordpress-plugin/</link>
		<comments>http://lohmantrading.com/Fourced/2009/08/executable-php-widget-wordpress-plugin/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 14:05:10 +0000</pubDate>
		<dc:creator>Christopher</dc:creator>
				<category><![CDATA[CSS and PHP]]></category>
		<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Site Design]]></category>

		<guid isPermaLink="false">http://lohmantrading.com/Fourced/?p=726</guid>
		<description><![CDATA[
I consider the Executable PHP Widget plugin for WordPress a &#8220;must have&#8221; because, frankly, I cannot believe that WordPress doesn&#8217;t include this in the core installation.
This plugin is just like the standard text / HTML widget that comes with WordPress, but it will also allow you to run PHP script in the widget.  For [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-left: 2px;"><a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Flohmantrading.com%2FFourced%2F2009%2F08%2Fexecutable-php-widget-wordpress-plugin%2F"><img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Flohmantrading.com%2FFourced%2F2009%2F08%2Fexecutable-php-widget-wordpress-plugin%2F" height="61" width="51" /></a></div><p><IMG SRC="http://www.lohmantrading.com/Fourced/post-images/MustHave_WordPressPlugins_Thumb.jpg" hspace="12" img class="alignleft" alt="Must have WordPress Blog Plugins"><br />
I consider the <B>Executable PHP Widget</b> plugin for WordPress a &#8220;must have&#8221; because, frankly, I cannot believe that WordPress doesn&#8217;t include this in the core installation.<br />
<BR>This plugin is just like the standard text / HTML widget that comes with WordPress, but it will also allow you to run PHP script in the widget.  For those of us that dabble in tweaking our themes, we know how valuable it can be to be able to place PHP hooks or entire mini-scripts in the side column of our blog.<br />
<BR>On this blog I am using this plugin to run my &#8220;top commentators&#8221; section in the sidebar.  It is easier and a little cleaner then having to hard-code the &#8220;top commentators&#8221; PHP hooks into the side column.  I now use this widget exclusively instead of the text/HTML widget.<br />
<BR>I would highly recommend that you consider installing the <a href="http://wordpress.org/extend/plugins/php-code-widget/" target="_blank">Executable PHP Widget</a> plugin !<br />
<BR>[ <a href="http://wordpress.org/extend/plugins/php-code-widget/" target="_blank">Plugin Site</a> (download) ]<br />
[ Plugin Author: <a href="http://ottodestruct.com/blog/wordpress-plugins/" target="_blank">Otto</a> ]<br />
<BR><br />
Comments <i>( <a href="#respond">leave a comment here</a> )</i> and thoughts <B>ALWAYS</B> welcome !<br />
<BR><br />
<img src="http://www.lohmantrading.com/Fourced/graphics/Chris_Signature.jpg"><br />
<UL>
<li>Go ahead and <a href="http://lohmantrading.com/Fourced/rss-subscribe/">STALK ME</a> &#8211; electronically of course &#8211; <a href="http://lohmantrading.com/Fourced/rss-subscribe/">Subscribe Here</a></li>
</ul>
<p><BR><BR></p>
]]></content:encoded>
			<wfw:commentRss>http://lohmantrading.com/Fourced/2009/08/executable-php-widget-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
