<?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>jc-designs.net &#187; WordPress</title>
	<atom:link href="http://jc-designs.net/blog/category/web-development/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://jc-designs.net/blog</link>
	<description>jc-designs blog</description>
	<lastBuildDate>Mon, 16 Jan 2012 15:30:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Adventures In Adding Large Video Files In WordPress</title>
		<link>http://jc-designs.net/blog/2012/01/adventures-in-adding-large-video-files-in-wordpress/</link>
		<comments>http://jc-designs.net/blog/2012/01/adventures-in-adding-large-video-files-in-wordpress/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 23:38:26 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=1058</guid>
		<description><![CDATA[Adding video to WordPress seems easy, right? Why am I writing this post? Because if you have followed this blog for a while, you know I like not only passing what I&#8217;ve learned along to up and coming web developers, but I use this as a reference sometimes. I recently completed a freelance project that [...]]]></description>
			<content:encoded><![CDATA[<h3>Adding video to WordPress seems easy, right?</h3>
<p>Why am I writing this post? Because if you have followed this blog for a while, you know I like not only passing what I&#8217;ve learned along to up and coming web developers, but I use this as a reference sometimes. I recently completed a freelance project that involved moving very large video files into a new WordPress install, and I came across multiple problems that were hard to find answers to. Adding video looks like it would be easy, right? Just click that little Upload/Insert button, drag/drop the file onto the page, and BAM! Video file is in the media library. What could POSSIBLY go wrong? I&#8217;ll start with the background to the project, and go over how I solved the issue.<br />
<span id="more-1058"></span></p>
<h3>Transfer a WordPress blog please!</h3>
<p>It all started with an email from my website asking if I could transfer his WP blog from wordpress.com, to a self hosted WP install. The site&#8217;s main feature was the video clips on the site. If I couldn&#8217;t get the video over, then it was a no go. After some chatting, the client asked if I could honestly tell him if wordpress.com&#8217;s guided transfer was something he should look at, since it was cheaper than what I was charging. I told him that I have no idea, as I don&#8217;t know anyone that had paid for that. Blah, blah, blah&#8230;.I got the job, and started transferring his blog over.</p>
<h3>It always seems easy in the beginning</h3>
<p>As it turns out, getting the data out of a WP.com hosted site is pretty damn easy. Under tools, they have a nifty little Export option, that will download an xml file for you. At that point, everything was going well. Wow, got the file, now how do I get it into a self hosted WP site? Simple, install the WordPress Importer plugin. It easily imports the data file into the new install! You click import, and then use the WordPress option. That is about as far as I got without any problems, because there is a checkbox asking if you want to import all of the media files attached to the data. Why the hell wouldn&#8217;t I want to do that? This seemed like a dream come true! I would be done with this little project in a couple of hours! So I checked the box and clicked import&#8230;</p>
<p>And the shit hit the fan.</p>
<h3>What do you mean memory limit?</h3>
<p>I kid you not, five seconds into the import and I got an error saying &#8220;Fatal error: Allowed memory size of &#8230;&#8221;. What? Google then tells me it is because the memory limit in the host&#8217;s php.ini file is set at 64Megs, all I have to do is ask my host to increase it. Soooo, I get the host (hostgator by the way &#8211; and they do indeed rock) to increase my limit temporarily after I explain what I was trying to do. THANK YOU! So they tell me, try again, which I do. Unfortunately this produces the same error. They then increase it to 300 and something for me, import again, and same error. At which point he asks me how large the video files are.</p>
<p>I didn&#8217;t really look, which was my fault. I did now though, and to my astonishment, the first file it is trying to import is a massive 687 megs. HOLY @#$%! That is huge. After a while, I realize this isn&#8217;t going to work. Quick thinking on my part, I say &#8220;Jeremy, why don&#8217;t we try using the file manager and upload them through the host itself?&#8221; Quick, yes. Stupid? Yes. I should have skipped this step, but don&#8217;t worry, I quickly found out why that was not going to work. Unfortunately it made me assume something that wasn&#8217;t true. The host&#8217;s file manager has a 500Mg single file limit, but I didn&#8217;t find that out until I had tried uploading the file though, which took about ten minutes. </p>
<h3>Let&#8217;s look at a different approach</h3>
<p>This is where I called the client and told him, this is probably not the best way to do video. Let&#8217;s look at hosting them on YouTube? WordPress has a very easy way of getting video from YouTube into a post. Looking into at first brought a smile to my face. YouTube&#8217;s limit for a single file is one gig. Awesome, none of the video is larger than that. Oh, but wait&#8230;how long are these videos minutes wise? See, YouTube limits it to 15 minutes. Some of these videos are over twenty. No good there, and after a brief conversation the client concludes that he doesn&#8217;t want to cut the videos up. Fine. Back to the drawing board.</p>
<h3>Determination wins the day</h3>
<p>At that point, I was up for trying anything. Enter FileZilla, which I should have done right from the start. I uploaded the videos into WordPress&#8217; uploads folder, fully expecting it to die when it hit the 500 mark. To my astonishment though, it went through. All the way. Why? No idea. The host&#8217;s file manager has a limit, but using ftp didn&#8217;t. I was happy though because now I got the video up on the server.</p>
<p>I then login to WordPress, go to the media library, and&#8230;.nothing is there. Shiznit. More searching with Google, and I find that there is a plugin called Add From Server. This little thing takes files you uploaded onto the server, and places them into the library for you. That was what I needed. I puts a nice little button in the Media tab that says Add From Server, and a list of all the files shows up when you click it. You then check all the boxes of the files you want in the library, and it moves them over for you. I was then free to insert them into the post at will!</p>
<h3>Conclusion</h3>
<p>Why was this so hard to figure out? Because apparently not many people have uploaded files this large into WordPress. I found tons on uploading 4Meg files, but nothing in the 500+ range. Google didn&#8217;t help me there. Large video files like that are not the best way of handling things, but I had to figure out how to do it. Doing that again would only take me a couple of hours total, but because I had never done it, and most others haven&#8217;t either made the process a bitch.</p>
<p>Wondering how the client got his files up on WP.com? Easy&#8230;he paid for an extension called Video Press that allows you to upload large video files into WordPress. Hell if I could find the same kind of thing though for a self hosted version.</p>
<p>So, if you need to do something like this follow this guideline:</p>
<ul>
<li>Import the WP data file with the WordPress Importer plugin</li>
<li>Don&#8217;t transfer the media if you have large files like what I talked about. Won&#8217;t happen.</li>
<li>Install the Add From Server Plugin</li>
<li>Use FileZilla, or other ftp software to upload the video</li>
<li>Use the Add From Server button in the Media tab to import the video into the Media Library</li>
<li>Insert the video into the post</li>
</ul>
<p><strong>NOTE</strong>: <em>If you use FileZilla, make sure you have the most up-to-date version. I originally tried with an older one I had installed and it truncated the files by a few thousand bytes or so. The files were then unusable. Once I updated FileZilla to the current version, this stopped happening.</em></p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-" rel="nofollow"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=1058" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2012/01/adventures-in-adding-large-video-files-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Displaying Menus On Specific Pages In WordPress</title>
		<link>http://jc-designs.net/blog/2011/06/displaying-menus-on-specific-pages-in-wordpress/</link>
		<comments>http://jc-designs.net/blog/2011/06/displaying-menus-on-specific-pages-in-wordpress/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 22:12:49 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=932</guid>
		<description><![CDATA[WordPress is pretty damn cool It&#8217;s been a while since I&#8217;ve written a post (mostly because of life happening and a freelance project), and I thought I would get back into the swing of things by writing something on WordPress. I&#8217;ve been doing more work in it lately and have had the pleasure of seeing [...]]]></description>
			<content:encoded><![CDATA[<h3>WordPress is pretty damn cool</h3>
<p>It&#8217;s been a while since I&#8217;ve written a post (mostly because of life happening and a freelance project), and I thought I would get back into the swing of things by writing something on WordPress. I&#8217;ve been doing more work in it lately and have had the pleasure of seeing some cool things done by my manager. One of which is to get different menus, using WordPress&#8217; Menu Manager, to display on different pages. For instance, you have a Services page that you want to display a services menu in the sidebar, and a portfolio page with a different menu. It is stuff like this, and the amount of support you can find on the web that makes me really like WordPress. Aside from it being relatively easy to theme.</p>
<p><span id="more-932"></span></p>
<h3>Create your menus</h3>
<p>This isn&#8217;t a tutorial on how to create menus using WordPress, so I am going to assume that you the reader already know how to do that. The menu manager is under Appearance>Menus, and there are probably plenty of other tutorials on how to do that. Once you have your menus set up, like mine are in the image below, you are just a step away from getting a specific menu to display on a specific page.</p>
<div class="center"><img src="http://www.jc-designs.net/newimages/blogImages/wpMenu.jpg" alt="WordPress Menu Manager" /></div>
<h3>If and else come to the rescue</h3>
<p>Really, there is not much to explain. The first line of the if/elseif tells WordPress what page to assign the menu, the second prints out a title for the menu, and the third tells it what menu to use. The else statement says, if the above conditions are not true, use this menu instead. All YOU have to do is place this code where you want the menu(s) to display, change the page, menu, and title names, and you are ready to go. Here is the code:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;color: #439AD0; font-weight: bold;">&lt;?php
if (is_page(array('services-for-you'))) { //what page
	print(&quot;&lt;h3&gt;My Services&lt;/h3&gt;&quot;); //prints title
	wp_nav_menu('menu=services-menu'); //what menu
}
elseif (is_page(array('my-portfolio'))) {
	print(&quot;&lt;h3&gt;My Portfolio&lt;/h3&gt;&quot;);
	wp_nav_menu('menu=portfolio-menu'); 
}
else {
	print(&quot;&lt;h3&gt;More Info&lt;/h3&gt;&quot;);
	wp_nav_menu ('menu=info-menu');
}
?&gt;</pre></div></div>

<p>And that is all there is to it. You can obviously have as many &#8216;elseif&#8217; statements in there as you want. Got any cool chunks of code that make WordPress do some cool stuff? Comment and let me know!</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-" rel="nofollow"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=932" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2011/06/displaying-menus-on-specific-pages-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Using Custom Post Types As CMS Editable Slots in WordPress</title>
		<link>http://jc-designs.net/blog/2011/03/using-custom-post-types-as-cms-editable-slots-in-wordpress/</link>
		<comments>http://jc-designs.net/blog/2011/03/using-custom-post-types-as-cms-editable-slots-in-wordpress/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 03:04:24 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=831</guid>
		<description><![CDATA[Using WordPress as a fully functional CMS UPDATE 6/1/11: Added one line to the end of the second chunk of code (wp_reset_query). If you do not have this and place that block above the loop, the id does not get reset and will display the wrong content. Worked if after the loop, but probably a [...]]]></description>
			<content:encoded><![CDATA[<h3>Using WordPress as a fully functional CMS</h3>
<p><strong>UPDATE 6/1/11: Added one line to the end of the second chunk of code (wp_reset_query). If you do not have this and place that block above the loop, the id does not get reset and will display the wrong content. Worked if after the loop, but probably a bad idea no to include it.</strong></p>
<p><em>NOTE: Added one line of code to exlude this content block from search (&#8216;exclude_from_search&#8217; => true,).</em></p>
<p>There are plenty of ways to use WordPress as a CMS (content management system). There are different plugins that allow you to do it, like <a href="http://wordpress.org/extend/plugins/pagely-multiedit/">MultiEdit</a>, but recently I have been working on building the new corporate site for work, and saw something that my manager did to make WordPress into a very powerful CMS. Normally I build sites in WordPress so that the client can make changes to the main content and widget areas themsevles. That doesn&#8217;t require any additional code or tinkering. But what if you need additional areas that the client has to be able to edit themselves as well?</p>
<p>In come &#8220;custom post types&#8221; to the rescue. I will show you how to easily do this to your own WordPress site, and it only takes a few minutes. I don&#8217;t know where my manager got the code for it, but I was impressed with how easy it is.</p>
<p><span id="more-831"></span></p>
<h3>The functions page</h3>
<p>You will need to open the functions page (functions.php) and add this code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #666666; font-style: italic;color: #439AD0;">//This is the custom content block</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">function</span> post_type_customContent<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #009900;color: #439AD0;">&#123;</span>
     register_post_type<span style="color: #009900;color: #439AD0;">&#40;</span>
                     <span style="color: #0000ff;">'customContent'</span><span style="color: #339933;color: #439AD0;">,</span>
                     <span style="color: #990000;color: #439AD0;">array</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #0000ff;">'label'</span> <span style="color: #339933;color: #439AD0;">=&gt;</span> __<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #0000ff;">'Custom Content'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">,</span>
                             <span style="color: #0000ff;">'public'</span> <span style="color: #339933;color: #439AD0;">=&gt;</span> <span style="color: #009900; font-weight: bold;color: #439AD0;">true</span><span style="color: #339933;color: #439AD0;">,</span>
                             <span style="color: #0000ff;">'show_ui'</span> <span style="color: #339933;color: #439AD0;">=&gt;</span> <span style="color: #009900; font-weight: bold;color: #439AD0;">true</span><span style="color: #339933;color: #439AD0;">,</span>
                             <span style="color: #0000ff;">'exclude_from_search'</span> <span style="color: #339933;color: #439AD0;">=&gt;</span> <span style="color: #009900; font-weight: bold;color: #439AD0;">true</span><span style="color: #339933;color: #439AD0;">,</span>
                             <span style="color: #0000ff;">'supports'</span> <span style="color: #339933;color: #439AD0;">=&gt;</span> <span style="color: #990000;color: #439AD0;">array</span><span style="color: #009900;color: #439AD0;">&#40;</span>
                                                  <span style="color: #0000ff;">'title'</span><span style="color: #339933;color: #439AD0;">,</span>
                                                  <span style="color: #0000ff;">'editor'</span><span style="color: #339933;color: #439AD0;">,</span>
                                        <span style="color: #0000ff;">'post-thumbnails'</span><span style="color: #339933;color: #439AD0;">,</span>
                                        <span style="color: #0000ff;">'custom-fields'</span><span style="color: #339933;color: #439AD0;">,</span>
                                        <span style="color: #0000ff;">'revisions'</span><span style="color: #009900;color: #439AD0;">&#41;</span>
                                <span style="color: #009900;color: #439AD0;">&#41;</span>
                      <span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
     register_taxonomy_for_object_type<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #0000ff;">'post_tag'</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #0000ff;">'customContent'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
<span style="color: #009900;color: #439AD0;">&#125;</span>
add_action<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #0000ff;">'init'</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #0000ff;">'post_type_customContent'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

<p>Anywhere you see the word &#8220;customContent&#8221;, you may replace with whatever you want to call it. This just made sense to me, because that is exactly what I am doing. Where you see the words &#8220;Custom Content&#8221;, can be replaced with what you want the added section in the admin panel to be called. Once you have added that code and uploaded the file, you should see the additional section like the image below.</p>
<div class="center">
<img src="http://jc-designs.net/newimages/blogImages/customPostImage.jpg" alt="WordPress Dashboard showing custom content block added" />
</div>
<h3>How do you get it to display?</h3>
<p>First, you will see in the image, that under &#8220;Custom Content&#8221;, you have the option to &#8220;Add New.&#8221; By clicking new, you are adding a new post like you would for any regular post. But you need to be able to get it to display where you want it. Let&#8217;s say you have a small section in your header, that has text  the client wants to be able to change. In the div, or whatever tag you want this to appear, you place this code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #000000; font-weight: bold;">&lt;?</span> query_posts<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #0000ff;">'post_type=contentblock&amp;page_id=22'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
                <span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;color: #439AD0;">if</span> <span style="color: #009900;color: #439AD0;">&#40;</span>have_posts<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #339933;color: #439AD0;">:</span> <span style="color: #b1b100;color: #439AD0;">while</span> <span style="color: #009900;color: #439AD0;">&#40;</span>have_posts<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #339933;color: #439AD0;">:</span> the_post<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
                    <span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> the_content<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
                <span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #b1b100;color: #439AD0;">endwhile</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #b1b100;color: #439AD0;">endif</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
                <span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> wp_reset_query<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Take special note of the &#8220;page_id=22&#8243; because the number is what you have to change. After you have created the new content, publish it and get the id number by hitting the &#8220;Preview&#8221; button. You will see the number in the url that opens up. Put that number, where the &#8217;22&#8242; is in my example. Now anything that put in that new custom post will display in the desired spot.</p>
<h3>Final Thoughts</h3>
<p>This opens up WordPress to a whole new level. You can add as many different posts and place the second chunk of code wherever you want it (just changing the post id number when you do). WordPress goes from a blogging system with a small level of editable spots for main content or widgets, to one that is complete. I have absolutely no reason now to not use WordPress on any project.</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-" rel="nofollow"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=831" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2011/03/using-custom-post-types-as-cms-editable-slots-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Display Recent Posts From Your WordPress Blog</title>
		<link>http://jc-designs.net/blog/2010/11/display-recent-posts-from-your-wordpress-blog/</link>
		<comments>http://jc-designs.net/blog/2010/11/display-recent-posts-from-your-wordpress-blog/#comments</comments>
		<pubDate>Tue, 02 Nov 2010 07:21:38 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=627</guid>
		<description><![CDATA[Put it on your static home page My main site is static since I am the only one who works on it. Just didn&#8217;t seem to be any point to creating in it WordPress. That doesn&#8217;t mean though that I don&#8217;t want some things from my blog showing up on my home page. I wanted [...]]]></description>
			<content:encoded><![CDATA[<h3>Put it on your static home page</h3>
<p>My main site is static since I am the only one who works on it. Just didn&#8217;t seem to be any point to creating in it WordPress. That doesn&#8217;t mean though that I don&#8217;t want some things from my blog showing up on my home page. I wanted the recent blog posts showing up in my sidebar, and after a bunch of searching (wasn&#8217;t quick like I thought it would be) I &#8216;kind of&#8217; found what I was looking for, but had to modify it. If you are looking to do the same kind of thing though, it is actually quite easy. There are two small chunks of code that you need: the first is to open the database connection that your blog is linked to, and the second is to actually display the posts.</p>
<h3>You don&#8217;t even need to know PHP!</h3>
<p>Indeed you don&#8217;t, that is how easy this is. The first part is to put this code at the top of your page:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> 
<span style="color: #990000;color: #439AD0;">define</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #0000ff;">'WP_USE_THEMES'</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #009900; font-weight: bold;color: #439AD0;">false</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
<span style="color: #b1b100;color: #439AD0;">require</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #0000ff;">'blog/wp-blog-header.php'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><span id="more-627"></span><br />
The &#8216;wp-blog-header.php&#8217; file is not to be confused with your &#8216;header.php&#8217; file that you use to put all the&#8230;well, the header information in your blog. The file you are really looking for is going to be in the root of your WordPress installation, whose path is probably going to be like it is shown in the example code above. Obviously change it to what you need it to be if it is different.</p>
<p>Here is the second part, which you would place wherever you want the &#8216;recent posts&#8217; to display (usually the sidebar or footer):</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: #439AD0; font-weight: bold;">&lt;ul&gt;
<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> query_posts<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #0000ff;">'showposts=3'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> <span style="color: #b1b100;color: #439AD0;">while</span> <span style="color: #009900;color: #439AD0;">&#40;</span>have_posts<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #339933;color: #439AD0;">:</span> the_post<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> <span style="color: #b1b100;color: #439AD0;">echo</span> <span style="color: #0000ff;color: #439AD0;">&quot;&lt;li&gt;&quot;</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #b1b100;color: #439AD0;">echo</span> <span style="color: #0000ff;color: #439AD0;">&quot;&lt;span class=<span style="color: #000099; font-weight: bold;">\&quot;</span>date<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span> <span style="color: #339933;color: #439AD0;">;</span> the_date<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #b1b100;color: #439AD0;">echo</span> <span style="color: #0000ff;color: #439AD0;">&quot;&lt;/span&gt;&quot;</span> <span style="color: #339933;color: #439AD0;">;</span> <span style="color: #b1b100;color: #439AD0;">echo</span> <span style="color: #0000ff;color: #439AD0;">&quot; - &quot;</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;a href=&quot;<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> the_permalink<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; rel=&quot;bookmark&quot; title=&quot;<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> the_title<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> the_title<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt; <span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> <span style="color: #b1b100;color: #439AD0;">echo</span> <span style="color: #0000ff;color: #439AD0;">&quot;&lt;/li&gt;&quot;</span><span style="color: #339933;color: #439AD0;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>  	
<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span>
<span style="color: #b1b100;color: #439AD0;">endwhile</span><span style="color: #339933;color: #439AD0;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/ul&gt;</pre></div></div>

<p>The &#8216;ul&#8217; I added because I wanted them to display in a list, so you of course do not have to add that. If you want to change the number of posts shown, it is pretty obvious which number to change (the &#8217;3&#8242; if you don&#8217;t). I then added &#8216;li&#8217; tags around each one by echoing them out, and added a class of &#8216;date&#8217; around the date code so I could target that seperately. Then you have the &#8216;a&#8217; tag which wraps the title with the corresponding link, and the title code again to print out the actual title. And that is it! Pretty simple, but a very common thing web developers have to do. If you want to see it actually working, you can <a href="http://www.jc-designs.net/index2010.php" target="_blank">view it here</a>, where I have a copy of my site redesign going.</p>
<h3>With a little thought&#8230;</h3>
<p>I have been told by some programmers that I work with, that the actual code that WordPress is built on is crap. If it is, I don&#8217;t care because of its ease of use. I don&#8217;t really know PHP, but by just looking at some sample code I can figure out how to do most of what I want in WP. This wasn&#8217;t that hard, I just didn&#8217;t like how deep I had to search to actually get what I wanted. I love the simplicity and ability to take this or that out of a WordPress site and stick it wherever you want. It is perfect for what I need to do. When I see stuff like this I think &#8220;Man, PHP doesn&#8217;t seem all that hard!&#8221; Of course I know this is example is really nothing. Besides, I&#8217;ve picked Ruby as my starting point so I can&#8217;t switch over. Maybe when I get that down, PHP will be a lot easier to understand. We shall see.</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-" rel="nofollow"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=627" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/11/display-recent-posts-from-your-wordpress-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Review of WPBids WordPress Theme</title>
		<link>http://jc-designs.net/blog/2010/09/review-of-wpbids-wordpress-theme/</link>
		<comments>http://jc-designs.net/blog/2010/09/review-of-wpbids-wordpress-theme/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 05:43:36 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=551</guid>
		<description><![CDATA[I bought a theme Yes I bought a theme, stop your yelling please, it is hurting my ears. I&#8217;ve bought WordPress themes from themeforest.net before, but it was to see how they did their admin panel. Worst idea ever, because they were obviously created by people who knew their PHP very well. So why in [...]]]></description>
			<content:encoded><![CDATA[<h3>I bought a theme</h3>
<p>Yes I bought a theme, stop your yelling please, it is hurting my ears. I&#8217;ve bought WordPress themes from <a href="http://themeforest.net/">themeforest.net</a> before, but it was to see how they did their admin panel. Worst idea ever, because they were obviously created by people who knew their PHP very well. So why in the name of all that is good, why I purchase a theme when I could very well have created a custom one that did the same thing for me? Time. I could have easily created something similar and more to my liking, but I had sent out an email to someone that responded back to send them a proposal. I wanted it to look good, and I wanted to have it out quickly so that the idea of redesigning her website didn&#8217;t leave her head.</p>
<p>If I had decided to create the theme myself, it might have taken me a couple of weeks because of how picky I am with my own designs. Designing for yourself, as you all know, is way different than designing for a client. By the title of this post, you know I purchased the <a href="http://wpbids.com/">WPBids</a> theme, so let&#8217;s get on with the review.</p>
<p><span id="more-551"></span></p>
<h3>Price</h3>
<p>The damn thing costs $59! Ya, you read that right. This is a theme that thousands of others are going to be using, so why would anyone pay that amount? Because while the design is simple, it does exactly what you need it to do. Oh, and you can do it quickly. I figure that price is worth it because one project gained by it already covered the cost. It then became a no brainer.</p>
<h3>Look and style</h3>
<p>There are 4 different stylesheets to choose from: Teal (which I am using), Red, Black, and Blue. Red is ok but not great, and Blue is just plain bad. I did like the Black but some of the text was gray on top of the black, which made it very difficult to read. Teal had a more professional feel to it, and every thing was very clear.</p>
<p>This theme is built to do one thing: proposals. Don&#8217;t expect anything fancy, cause you won&#8217;t find it. No sliders, no crazy navigation &#8211; because there is really only one page for clients to see. It doesn&#8217;t need any of that anyway. Sure, you could spruce it up with whatever you want, but then you are taking away from what you are trying to do with it. I think in this regard, this theme is brilliiant. Get a nice looking online proposal to the client quickly &#8211; nothing more, nothing less.</p>
<h3>The home page</h3>
<p>There is a home page, but I would recommend what one of their videos say to do, which is make it private. Why? Because the home page is really for you. It is just a list of all the different proposals you have written up. You don&#8217;t want clients seeing what you are charging other clients, because that could cause some awkward situations. It is really easy to do this.</p>
<ul>
<li>Create a page called Home, and set it to the Root Template</li>
<li>Go to your Settings and change the home page of the site to be that new page</li>
<li>Go back to the Home page, and on the right side under Publish, click on Edit next to the Visibility option</li>
<li>Set the visibility to private</li>
<li>Go to Appearance &#8211; WPBids comes with its own options section there &#8211; and enter a url for the site to redirect to</li>
</ul>
<p>After doing that, anyone who is not logged into the admin section, will be redirected to the url you entered if they try going to the home page. This is a must if you have multiple proposals.</p>
<p>The list on the home page also shows the url you will give to the client. I refuse to say URI by the way, its just a thing of mine.</p>
<h3>The themes options</h3>
<p>Besides being able to change stylesheets, there are a bunch of other options to edit. From what contact information to put in, adding a logo, what goes in the footer&#8230;stuff I would normally do manipulating a theme&#8217;s actual PHP files, but with this type of theme this is all you really need. I&#8217;m not sure what other options you would want other than what they give you, so I give them an A for this.</p>
<h3>The proposal itself</h3>
<p>The proposal is just a custom post type with a couple of additional fields. The title is what your are proposing to do for the client, but everything else works like a normal post. There are two fields added for the client&#8217;s name, and the company&#8217;s name. The main topic points that you would write about, like Goals and Objectives, you set to h2 tags, which all line up on the left. The content for each then lines up on the right. Very simple and quick. I like it.</p>
<h3>Final thoughts</h3>
<p>WPBids is a theme for exactly one purpose &#8211; sending out an online proposal. Would I use this for anything else? Hell no, but that is the point and why I think it will be successful, if it isn&#8217;t already. It isn&#8217;t meant for anything else. I bought it for the ease of use, the professional look, and quick deployment. If you do freelance work, I highly recommend buying this theme.</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=551" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/09/review-of-wpbids-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adding A Sidebar For Specific Pages In WordPress</title>
		<link>http://jc-designs.net/blog/2010/08/adding-a-sidebar-for-specific-pages-in-wordpress/</link>
		<comments>http://jc-designs.net/blog/2010/08/adding-a-sidebar-for-specific-pages-in-wordpress/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 02:47:42 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=526</guid>
		<description><![CDATA[Widgets are actually pretty damn cool I used to think they were stupid, which is why I hard coded the sections pulling data for this blog. If you read my last post though, you will know I am building a theme for work and I had to use widgets. I gotta say, these things are [...]]]></description>
			<content:encoded><![CDATA[<h3>Widgets are actually pretty damn cool</h3>
<p>I used to think they were stupid, which is why I hard coded the sections pulling data for this blog. If you read my last post though, you will know I am building a theme for work and I had to use widgets. I gotta say, these things are handy. Now the client will be able to stick whatever he wants wherever he wants it. I did run into a problem though, which took me a while to solve.</p>
<p>I needed to get a widgetized sidebar onto a specific page, without showing up on any of the other pages. Luckily it was the blog page, which uses the index.php file within your theme folder, and not something where I would have to create a custom page for. I started the theme off of &#8216;TwentyTen&#8217;, and pretty much deleted all the content in all the theme files, meaning all I had left was the php that calls the header, footer, and sidebar. The function file remained the same other than adding the code to call jQuery from Google&#8217;s server, and renaming all the function names from &#8216;twentyten&#8217; to &#8216;mythemename&#8217; (not posting what it was really called, because it is irrelevant). </p>
<p><span id="more-526"></span></p>
<h3>The functions page</h3>
<p>You only need to do a few things, the first of which is to register the sidebars. Place the following code within your functions page (I dropped it all the way at the bottom):</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #b1b100;color: #439AD0;">if</span> <span style="color: #009900;color: #439AD0;">&#40;</span> <span style="color: #990000;color: #439AD0;">function_exists</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #0000ff;">'register_sidebar'</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #009900;color: #439AD0;">&#41;</span>
register_sidebar<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #990000;color: #439AD0;">array</span><span style="color: #009900;color: #439AD0;">&#40;</span>
		<span style="color: #0000ff;">'name'</span> <span style="color: #339933;color: #439AD0;">=&gt;</span> __<span style="color: #009900;color: #439AD0;">&#40;</span> <span style="color: #0000ff;">'Blog Widget Area'</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #0000ff;">'intmedreps'</span> <span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">,</span>
		<span style="color: #0000ff;">'id'</span> <span style="color: #339933;color: #439AD0;">=&gt;</span> <span style="color: #0000ff;">'first-blog-widget-area'</span><span style="color: #339933;color: #439AD0;">,</span>
		<span style="color: #0000ff;">'description'</span> <span style="color: #339933;color: #439AD0;">=&gt;</span> __<span style="color: #009900;color: #439AD0;">&#40;</span> <span style="color: #0000ff;">'The first blog widget area'</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #0000ff;">'intmedreps'</span> <span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">,</span>
		<span style="color: #0000ff;">'before_widget'</span> <span style="color: #339933;color: #439AD0;">=&gt;</span> <span style="color: #0000ff;">'&lt;li id=&quot;%1$s&quot; class=&quot;widget-container %2$s&quot;&gt;'</span><span style="color: #339933;color: #439AD0;">,</span>
		<span style="color: #0000ff;">'after_widget'</span> <span style="color: #339933;color: #439AD0;">=&gt;</span> <span style="color: #0000ff;">'&lt;/li&gt;'</span><span style="color: #339933;color: #439AD0;">,</span>
		<span style="color: #0000ff;">'before_title'</span> <span style="color: #339933;color: #439AD0;">=&gt;</span> <span style="color: #0000ff;">'&lt;h3 class=&quot;widget-title&quot;&gt;'</span><span style="color: #339933;color: #439AD0;">,</span>
		<span style="color: #0000ff;">'after_title'</span> <span style="color: #339933;color: #439AD0;">=&gt;</span> <span style="color: #0000ff;">'&lt;/h3&gt;'</span><span style="color: #339933;color: #439AD0;">,</span>
	<span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

<h3>Create a new php file</h3>
<p>Pay attention to the id, because you will need that. Create a new php file, and call it &#8216;sidebar-whatever.php&#8217;. I called mine -blog.php because that is what it relates to. Within that new file, paste this code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: #439AD0; font-weight: bold;">&lt;div id=&quot;firstBlog&quot; class=&quot;widget-area&quot; role=&quot;complementary&quot;&gt;
			&lt;ul class=&quot;xoxo&quot;&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span>
	<span style="color: #666666; font-style: italic;color: #439AD0;">/* When we call the dynamic_sidebar() function, it'll spit out
	 * the widgets for that widget area. If it instead returns false,
	 * then the sidebar simply doesn't exist, so we'll hard-code in
	 * some default sidebar stuff just in case.
	 */</span>
	<span style="color: #b1b100;color: #439AD0;">if</span> <span style="color: #009900;color: #439AD0;">&#40;</span> <span style="color: #339933;color: #439AD0;">!</span> dynamic_sidebar<span style="color: #009900;color: #439AD0;">&#40;</span> <span style="color: #0000ff;">'first-blog-widget-area'</span> <span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #339933;color: #439AD0;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
			&lt;li id=&quot;search&quot; class=&quot;widget-container widget_search&quot;&gt;
				<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> get_search_form<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
			&lt;/li&gt;
&nbsp;
			&lt;li id=&quot;archives&quot; class=&quot;widget-container&quot;&gt;
				&lt;h3 class=&quot;widget-title&quot;&gt;<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> _e<span style="color: #009900;color: #439AD0;">&#40;</span> <span style="color: #0000ff;">'Archives'</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #0000ff;">'intmedreps'</span> <span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h3&gt;
				&lt;ul&gt;
					<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> wp_get_archives<span style="color: #009900;color: #439AD0;">&#40;</span> <span style="color: #0000ff;">'type=monthly'</span> <span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
				&lt;/ul&gt;
			&lt;/li&gt;
&nbsp;
			&lt;li id=&quot;meta&quot; class=&quot;widget-container&quot;&gt;
				&lt;h3 class=&quot;widget-title&quot;&gt;<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> _e<span style="color: #009900;color: #439AD0;">&#40;</span> <span style="color: #0000ff;">'Meta'</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #0000ff;">'intmedreps'</span> <span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h3&gt;
				&lt;ul&gt;
					<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> wp_register<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
					&lt;li&gt;<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> wp_loginout<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/li&gt;
					<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> wp_meta<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
				&lt;/ul&gt;
			&lt;/li&gt;
&nbsp;
		<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> <span style="color: #b1b100;color: #439AD0;">endif</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #666666; font-style: italic;color: #439AD0;">// end first blog widget area ?&gt;</span>
			<span style="color: #339933;color: #439AD0;">&lt;/</span>ul<span style="color: #339933;color: #439AD0;">&gt;</span>
		<span style="color: #339933;color: #439AD0;">&lt;/</span>div<span style="color: #339933;color: #439AD0;">&gt;&lt;!--</span> <span style="color: #666666; font-style: italic;">#firstBlog .widget-area --&gt;</span></pre></div></div>

<p>Copy the id of the sidebar you registered in the functions.php page, and paste over the &#8216;first-blog-widget-area&#8217; in the above code. Change the initial div id from &#8216;firstBlog&#8217; to whatever you want it to be., then look at the comments on the bottom of the page and change those to whatever you want. The code above have the words &#8216;first blog&#8217; in them, but they relate to your sidebar.</p>
<h3>Where do you want it?</h3>
<p>Last item to take care of. Open the file that pertains to the page you want to add the new sidebar to. Mine was the blog page, so index.php, but you might be adding a sidebar to a custom page, or the default pages of the blog&#8230;whatever it is, I can&#8217;t help you there, because I don&#8217;t know what page you will be affecting. What you will have to do is paste this code where you want the new sidebar to appear:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> <span style="color: #b1b100;color: #439AD0;">include</span> <span style="color: #009900;color: #439AD0;">&#40;</span>TEMPLATEPATH <span style="color: #339933;color: #439AD0;">.</span> <span style="color: #0000ff;">'/sidebar-blog.php'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Change the -blog.php to whatever you called the new sidebar page. That is it!</p>
<h3>Conclusion</h3>
<p>Main thing to remember is to remember what you are calling things, and change them in the appropriate places. Once you have that all finished, the new sidebar will only appear on the page(s) you placed the last bit of code on. In your admin section you will have a new sidebar ready to be widgetized. See below for how it will appear, which in reality, is no different than the other widget sections, it will just have your new name. You can easily add more sidebar areas by repeating this process, and adding them to whatever sidebar file you want.</p>
<div class="center">
<img src="http://www.jc-designs.net/newimages/blogImages/wpWidget.jpg" alt="Widget Area image" />
</div>
<p>Once I figured out how to do this, I am no longer afraid of adding widgetized sidebars to my themes. If you have any problems, let me know and I&#8217;ll help you work through it.</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
<div class="jBox">
<h2 class="jq">jQuery junkBox</h2>
<p><strong>(:header)</strong><br />
This selects all elements that are headers&#8230;h1, h2, h3&#8230;Below, would select all header elements with the class &#8216;allRed&#8217; and change them all to have a font-weight of normal</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;">$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'.allRed:header'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'font-weight'</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #3366CC;color: #439AD0;">'normal'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=526" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/08/adding-a-sidebar-for-specific-pages-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Learning While Building A Theme In WordPress 3.0</title>
		<link>http://jc-designs.net/blog/2010/08/learning-while-building-a-theme-in-wordpress-3-0/</link>
		<comments>http://jc-designs.net/blog/2010/08/learning-while-building-a-theme-in-wordpress-3-0/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 02:59:59 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=524</guid>
		<description><![CDATA[I plugged it in, but it didn&#8217;t go to 11 Today I was going to write about an awesome plugin a coworker found and is using, which I tried out. The problem is, that it didn&#8217;t work for me, but I don&#8217;t believe it is the plugin&#8217;s fault. We deal with a lot of custom [...]]]></description>
			<content:encoded><![CDATA[<h3>I plugged it in, but it didn&#8217;t go to 11</h3>
<p>Today I was going to write about an awesome plugin a coworker found and is using, which I tried out. The problem is, that it didn&#8217;t work for me, but I don&#8217;t believe it is the plugin&#8217;s fault. We deal with a lot of custom things at my work place, and I believe something could have been interfering with it. Not sure though. I did see it in action though and it worked incredibly well for him. It&#8217;s called <a href="http://wordpress.org/extend/plugins/pagely-multiedit/">Page.ly MultiEdit</a> and works with 2.9 and higher.</p>
<p>Ever need multiple places for a customer to be able to edit, that uses the same editor for posts and such? With this plugin it really makes WordPress a great CMS for regular sites, not just blogs. Not that it wasn&#8217;t before, this just makes it easier. To see screens, and instructions, <a href="http://blog.page.ly/multiedit-plugin/">visit there site</a>. It was easy to install, and place the code, I just don&#8217;t think the environment I am working in played well with it. I&#8217;ll have to test it out in the project theme I am building.</p>
<p><span id="more-524"></span></p>
<h3>It&#8217;s a learning process</h3>
<p>So while I am building this theme, which is my first real jump into 3.0, I got to see the differences under the hood. The new navigation editor is actually really well done. Very simple to use, and get running on your site. The only problem, and this might or might not be for you, is that the drop down part of the menu, does not work in IE6. Did some searching, and found that with some scripts you actually can get it to work, but I didn&#8217;t feel the need for it, and I&#8217;m going to be using jQuery to display a full nav else where if the it detects IE6 as the browser being used. Other than that, it works great.</p>
<p>I am also working with widgets for the first time. I&#8217;ve used them once before, but on my blog here, I used other code to get what I wanted to display. The widgets seem a lot easier to use than before, but I could be wrong. If you start with the TwentyTen theme as a base, then you have a ton of widgetized sections to work with. There are two in the sidebar, and four in the footer. There is base code in the theme that displays things like Blogrolls, Categories and other such things if there are not any widgets being used. This might have been available in earlier versions, but again, I always used other code for that.</p>
<p>I learned a lot today by building through some of this theme, on what makes a good theme to be able to sell. Such as, if you haven&#8217;t widgetized your theme, it is probably not going to work well with someone&#8217;s site that is. I feel much better now to be able to create a WordPress theme for sale knowing how this works. Very easy to create more widget spots, too, if you need them.</p>
<p>One thing to note is that I upgraded to 3.0.1 from 2.7 code, and it worked well. All I did was turn off the plugins, delete the wp-admin and wp-includes directories (go and actually read the instructions, don&#8217;t follow what I am saying here, because I don&#8217;t know your setup), upload all the new files, re-activate the plugins, and everything was fine. I am now not so paranoid with upgrading The Web Machine to 3.0.1, since I am at 2.9.2.</p>
<h3>Holy great amounts of CSS Batman!</h3>
<p>Ok, so it is now using Eric Meyer&#8217;s CSS reset, which is good, but dear lord the TwentyTen CSS file just seems bloated as hell. I believe next time I am going to dump a ton of it and go from there. I saw a bunch of stuff that made it obvious IE6 wouldn&#8217;t be happy, like the &#8216;>&#8217; selector and the :hover pseudo class being used on elements other than &#8216;a&#8217; tags. If someone would care to explain why I would do this:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;">ul li <span style="color: #00AA00;color: #439AD0;">&gt;</span> a <span style="color: #00AA00;color: #439AD0;">&#123;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">color</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>Over this:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;">ul li a <span style="color: #00AA00;color: #439AD0;">&#123;</span>
<span style="color: #000000; font-weight: bold;color: #439AD0;">color</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc00cc;">#ffffff</span><span style="color: #00AA00;color: #439AD0;">;</span>
<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>That would be great. I&#8217;m just not sure when you would use one over the other.</p>
<h3>All in all, I am very impressed</h3>
<p>It is a slow process right now, because I&#8217;m learning a little while I go, but overall I would highly recommend 3.0.1 to anyone. Seems tighter, and a little easier to read. Oh, and the TwentyTen theme is commented really well, so changing it up to a custom theme is easy. Not that I don&#8217;t know what I am doing, but there is some stuff I have to do in this site, that I am not sure how to accomplish.</p>
<p>Anyone have any experience with 3.0? Let&#8217;s hear how you like it!</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
<div class="jBox">
<h2 class="jq">jQuery junkBox</h2>
<p><strong>$(&#8216;A ~ B&#8217;)</strong><br />
This selector with match the &#8216;B&#8217; elements that follow and have the same parent as the &#8216;A&#8217; element. So below, it will find all the &#8216;p&#8217; tags that follow &#8216;ul&#8217; tags that have the same parent, and give them the class &#8216;blueHighlight&#8217;.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;">$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'ul ~ p'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">addClass</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'blueHighlight);</span></pre></div></div>

</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=524" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/08/learning-while-building-a-theme-in-wordpress-3-0/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress Custom Fields, plus Compass/Sass tip: CSS inline images</title>
		<link>http://jc-designs.net/blog/2010/07/wordpress-custom-fields-plus-compasssass-tip-css-inline-images/</link>
		<comments>http://jc-designs.net/blog/2010/07/wordpress-custom-fields-plus-compasssass-tip-css-inline-images/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 03:56:43 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[Sass/Less/Compass]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Compass]]></category>
		<category><![CDATA[sass]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=435</guid>
		<description><![CDATA[Set out to learn something&#8230;and I did. Now its your turn I wanted to create images that I could use for each post showing that it belonged to a certain type of category. You look at the image, and without reading the title, you would say &#8220;Oh, this post relates to WordPress.&#8221; Same with jQuery, [...]]]></description>
			<content:encoded><![CDATA[<h3>Set out to learn something&#8230;and I did. Now its your turn</h3>
<p>I wanted to create images that I could use for each post showing that it belonged to a certain type of category. You look at the image, and without reading the title, you would say &#8220;Oh, this post relates to WordPress.&#8221; Same with jQuery, Blogging in general, or whatever category I come up with. Something my readers would come to recognize over time. I also wanted to be able to do it without having to stick it in manually in the post like I do with the other images I stick in articles. If you are on the home page you will already see this. That is the one I came up with for articles relating to WordPress.</p>
<p>Now, I can&#8217;t take credit for what I am about to show you. I learned how to do this from<a href="http://justintadlock.com/archives/2007/10/27/wordpress-custom-fields-adding-images-to-posts">Justin Tadlock&#8217;s blog</a>, but I wanted to spread the love. This was the best tutorial I found on the subject.</p>
<h3>Just 10 Easy Steps!</h3>
<p>Here is my quick and dirty paraphrasing of it. Meaning, do EXACTLY AS IT SAYS BELOW.</p>
<p><span id="more-435"></span><br />
1) Create awesome post.<br />
2) Scroll down in post editor, under Custom Fields,  create a Key named “Thumbnail.”<br />
3) The Value should be the url to the image: (Example: wp-content/themes/yourThemeName/images/imageName.jpg)</p>
<p>NOTE: It took me a while to understand where it was pulling the images from &#8211; images folder in your theme. I was trying to get it to load from somewhere outside the theme. I&#8217;m sure you can, but this was easier.</p>
<p>4) Click Add Custom Field. Ya! Part 1 is done.<br />
5) Add another, by clicking Enter New. This time make the Key be Thumbnail Class<br />
6) Make the Value thumbnail-class<br />
7) Open the template you want the image to show on (index.php, single.php, category.php, archive.php, etc.)<br />
8- Find this code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #b1b100;color: #439AD0;">if</span><span style="color: #009900;color: #439AD0;">&#40;</span>have_posts<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #339933;color: #439AD0;">:</span> <span style="color: #b1b100;color: #439AD0;">while</span><span style="color: #009900;color: #439AD0;">&#40;</span>have_posts<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #339933;color: #439AD0;">:</span> the_post<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

<p>Post the following code directly AFTER it:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #000088;">$thumb</span> <span style="color: #339933;color: #439AD0;">=</span> get_post_meta<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;color: #439AD0;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #0000ff;">'Thumbnail'</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #000088;">$single</span> <span style="color: #339933;color: #439AD0;">=</span> <span style="color: #009900; font-weight: bold;color: #439AD0;">true</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
<span style="color: #000088;">$thumb_class</span> <span style="color: #339933;color: #439AD0;">=</span> get_post_meta<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;color: #439AD0;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #0000ff;">'Thumbnail Class'</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #000088;">$single</span> <span style="color: #339933;color: #439AD0;">=</span> <span style="color: #009900; font-weight: bold;color: #439AD0;">true</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>
<span style="color: #000088;">$thumb_alt</span> <span style="color: #339933;color: #439AD0;">=</span> get_post_meta<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;color: #439AD0;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #0000ff;">'Thumbnail Alt'</span><span style="color: #339933;color: #439AD0;">,</span> <span style="color: #000088;">$single</span> <span style="color: #339933;color: #439AD0;">=</span> <span style="color: #009900; font-weight: bold;color: #439AD0;">true</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

<p>9) Find this code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> the_content<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>  <span style="color: #000000; font-weight: bold;">?&gt;</span>
//OR THIS CODE, EITHER ONE
<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> the_excerpt<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span>  <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>And add this code BEFORE it:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> <span style="color: #666666; font-style: italic;color: #439AD0;">// if there's a thumbnail</span>
<span style="color: #b1b100;color: #439AD0;">if</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #000088;">$thumb</span> <span style="color: #339933;color: #439AD0;">!==</span> <span style="color: #0000ff;">''</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #009900;color: #439AD0;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;img src=&quot;<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> <span style="color: #b1b100;color: #439AD0;">echo</span> <span style="color: #000088;">$thumb</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;
	class=&quot;<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> <span style="color: #b1b100;color: #439AD0;">if</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #000088;">$thumb_class</span> <span style="color: #339933;color: #439AD0;">!==</span> <span style="color: #0000ff;">''</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #009900;color: #439AD0;">&#123;</span> <span style="color: #b1b100;color: #439AD0;">echo</span> <span style="color: #000088;">$thumb_class</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #009900;color: #439AD0;">&#125;</span> <span style="color: #b1b100;color: #439AD0;">else</span> <span style="color: #009900;color: #439AD0;">&#123;</span> <span style="color: #b1b100;color: #439AD0;">echo</span> <span style="color: #0000ff;color: #439AD0;">&quot;left&quot;</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #009900;color: #439AD0;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;
	alt=&quot;<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> <span style="color: #b1b100;color: #439AD0;">if</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #000088;">$thumb_alt</span> <span style="color: #339933;color: #439AD0;">!==</span> <span style="color: #0000ff;">''</span><span style="color: #009900;color: #439AD0;">&#41;</span> <span style="color: #009900;color: #439AD0;">&#123;</span> <span style="color: #b1b100;color: #439AD0;">echo</span> <span style="color: #000088;">$thumb_alt</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #009900;color: #439AD0;">&#125;</span> <span style="color: #b1b100;color: #439AD0;">else</span> <span style="color: #009900;color: #439AD0;">&#123;</span> <span style="color: #b1b100;color: #439AD0;">echo</span> the_title<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #009900;color: #439AD0;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;
	/&gt;
<span style="color: #000000; font-weight: bold;color: #439AD0;">&lt;?php</span> <span style="color: #009900;color: #439AD0;">&#125;</span> <span style="color: #666666; font-style: italic;color: #439AD0;">// end if statement</span>
<span style="color: #666666; font-style: italic;color: #439AD0;">// if there's not a thumbnail</span>
<span style="color: #b1b100;color: #439AD0;">else</span> <span style="color: #009900;color: #439AD0;">&#123;</span> <span style="color: #b1b100;color: #439AD0;">echo</span> <span style="color: #0000ff;">''</span><span style="color: #339933;color: #439AD0;">;</span> <span style="color: #009900;color: #439AD0;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p><strong>NOTE ADDED 7/30/10: If you read this post previously, I wrote a note here originally that was pretty much me being stupid.</strong></p>
<p>10) Open your CSS file and add this class:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #6666ff;color: #439AD0;">.thumbnail-class</span> <span style="color: #00AA00;color: #439AD0;">&#123;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">float</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #000000; font-weight: bold;color: #439AD0;">left</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">width</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">height</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">100px</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #000000; font-weight: bold;color: #439AD0;">margin</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #cc66cc;color: #439AD0;">0</span> <span style="color: #933;">15px</span> <span style="color: #cc66cc;color: #439AD0;">0</span> <span style="color: #cc66cc;color: #439AD0;">0</span><span style="color: #00AA00;color: #439AD0;">;</span>
	<span style="color: #00AA00;color: #439AD0;">&#125;</span></pre></div></div>

<p>Done. Of course, you still have to create the images though. Note the size of the image is actually controlled through the CSS. Meaning, even if the image you created is 300 by 300, whatever you put in the css is what it will display at. You can also call the class, and Key names whatever you wish, just be sure to change them in the php code as well.</p>
<p>For a more detailed explanation, you will want to read the article I linked to above. I searched for quite a while before I found his tutorial and it rocks. I just had to read more to accomplish it. He also gives hints on what else you can do with it. Very good read though.</p>
<h3>Compass&#8217; inline image function</h3>
<p>I am not recommending you do this, I am just showing you how. Let&#8217;s say you have a bunch of sprites, they are all small, and you don&#8217;t want the extra http requests on your website. Pretty understandable, which is why I use minify on my main site for the css and javascript files. Compass has a built in function that lets you actually embed an image into the CSS file. &#8220;Holy HELL! That&#8217;s insane!&#8221; That is what your head is screaming at the screen, right? That is what I said too when I saw it. I wish I could remember where, but I forgot to paste the url in my Evernote&#8230;just the code.</p>
<p>In your .sass file (yes Sass&#8230;I highly recommend it),you make a style like so:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;color: #439AD0; font-weight: bold;"><span style="color: #6666ff;color: #439AD0;">.mySprite</span>
  <span style="color: #000000; font-weight: bold;color: #439AD0;">background-image</span><span style="color: #00AA00;color: #439AD0;">:</span> inline-image<span style="color: #00AA00;color: #439AD0;">&#40;</span><span style="color: #ff0000;color: #439AD0;">&quot;images/mySprite.png&quot;</span><span style="color: #00AA00;color: #439AD0;">&#41;</span> <span style="color: #808080; font-style: italic;color: #439AD0;">/* ! */</span>
  <span style="color: #000000; font-weight: bold;color: #439AD0;">height</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">35px</span>
  <span style="color: #000000; font-weight: bold;color: #439AD0;">width</span><span style="color: #00AA00;color: #439AD0;">:</span> <span style="color: #933;">35px</span></pre></div></div>

<p>Compass then embeds the image into the CSS file. You can obviously think ahead on why this could be bad if you do this a lot. You are adding weight to the actual CSS file. Which of course this is why you would only do it with some small file size sprites. I can see this being good for small sites, but probably not anything of substantial size. Just use your head before you actually use this.</p>
<p><strong>NOTE ABOUT THIS TRICK:</strong> IE6 and 7 do NOT support this. You will have to include the style the normal way for those browsers, if you are supporting them.</p>
<h3>Last thoughts</h3>
<p>Hope you learned something! I know I did today, which is what I strive for every day. If you are using Custom Fields for WordPress, I would love to know about how you are using them, and the code for doing it! Share the love people!</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
<div class="jBox">
<h2 class="jq">jQuery junkBox</h2>
<p><strong>.after();</strong><br />
This method inserts the specified content after each matched element. Below adds a paragraph tag with text after any element with the class &#8216;myClass&#8217; on it.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;">$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'.myClass'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">after</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'&lt;p&gt;Even more content to read!&lt;/p&gt;'</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=435" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/07/wordpress-custom-fields-plus-compasssass-tip-css-inline-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#8217;ll show you my WordPress plugins if you show me yours</title>
		<link>http://jc-designs.net/blog/2010/06/ill-show-you-my-wordpress-plugins-if-you-show-me-yours/</link>
		<comments>http://jc-designs.net/blog/2010/06/ill-show-you-my-wordpress-plugins-if-you-show-me-yours/#comments</comments>
		<pubDate>Wed, 16 Jun 2010 03:11:29 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=351</guid>
		<description><![CDATA[I thought sharing what plugins we all use in WordPress would make a good post. So as the title says, I&#8217;ll show you my plugins, if you show me yours. Let&#8217;s start with the most important: Akismet - If you are NOT using this plugin, you are&#8230;not&#8230;smart. That is the least insulting I can be [...]]]></description>
			<content:encoded><![CDATA[<p>I thought sharing what plugins we all use in WordPress would make a good post. So as the title says, I&#8217;ll show you my plugins, if you show me yours.</p>
<p>Let&#8217;s start with the most important:</p>
<p><strong>Akismet </strong>- If you are NOT using this plugin, you are&#8230;not&#8230;smart. That is the least insulting I can be with that. This thing has caught more spam than you can imagine. I mean a LOT. 488 spam comments to be exact. I&#8217;m talking viagra, porn, random crazy&#8230;you name it, it has caught it.</p>
<p><strong>WP-Spam Free</strong> &#8211; Along the same lines as the above. Guess how many this one has caught? 511 as of this post. Insane right? I highly recommend these two more than you can know.</p>
<p><strong>Login LockDown</strong> &#8211; This is a security plugin. Two things: if you login with admin as the username&#8230;you are again, an idiot. Create a new admin account with a different user name, then delete that one. Google it for more info. This plugin adds another step of security. It restricts the number of failed logins that can be attempted from a given IP range. Mine is set very low. I&#8217;m paranoid about this kind of thing, but I recommend it.</p>
<p><span id="more-351"></span></p>
<p><strong>Feed Statistics </strong> &#8211; This one just tells me how many rss subscribers I have, among some other stats (31 if you are interested).</p>
<p><strong>Google XML Sitemaps</strong> &#8211; Creates an XML sitemap that helps search engines.</p>
<p><strong>Light SEO</strong> &#8211; Says it all, SEO plugin.</p>
<p><strong>TweetMeme Retweet Button</strong> &#8211; This creates the green retweet button on each of my posts. Not really doing much at the moment, but it might later.</p>
<p><strong>WordPress Database Backup</strong> &#8211; I am at a point now, where I have a lot of data on this blog that I do not want to ever lose. This lets me perform timely backups, that can be emailed to you, downloaded, or stored on your server. I chose download, cause I don&#8217;t want that stuff just sitting on my server.</p>
<p>(Just stupid note&#8230;watching Deadliest Catch&#8230;sad that the one captain is dead)</p>
<p><strong>WP-Syntax and WP-Syntax Colorizer</strong> &#8211; These allow me to drop in code to show you stuff, and to change the style colors of it. It is a bit tricky to set the styles, and a couple of them I couldn&#8217;t figure out. But awesome plugins none the less.</p>
<p>That is all of mine. I try not to add frivolous plugins. I don&#8217;t want it cluttered up. If it isn&#8217;t of any real use, then I don&#8217;t want it. There are literally thousands out there, and I am very curious what everyone else is using. Post what you have, and lets see if there isn&#8217;t something out there I&#8217;m missing.</p>
<div class="gator">
<a  href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=jcDesigns-"><img src="http://tracking.hostgator.com/img/Shared/468x60.gif" border=0></a></p>
<p>Coupon Code: webmachine</p>
</div>
<div class="jBox">
<h2 class="jq">jQuery junkBox</h2>
<p><strong>.slideToggle();</strong><br />
Here is a method I had no idea about. It will display or hide the matched elements with a sliding motion. Pretty damn cool!</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;color: #439AD0; font-weight: bold;">$<span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #3366CC;color: #439AD0;">'.killerClassName'</span><span style="color: #009900;color: #439AD0;">&#41;</span>.<span style="color: #660066;">slideToggle</span><span style="color: #009900;color: #439AD0;">&#40;</span><span style="color: #CC0000;color: #439AD0;">2000</span><span style="color: #009900;color: #439AD0;">&#41;</span><span style="color: #339933;color: #439AD0;">;</span></pre></div></div>

</div>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=351" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/06/ill-show-you-my-wordpress-plugins-if-you-show-me-yours/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Had issues with my blog&#8230;.WordPress theme scare</title>
		<link>http://jc-designs.net/blog/2010/04/had-issues-with-my-blog-wordpress-theme-scare/</link>
		<comments>http://jc-designs.net/blog/2010/04/had-issues-with-my-blog-wordpress-theme-scare/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 03:30:09 +0000</pubDate>
		<dc:creator>jcDesigns</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://jc-designs.net/blog/?p=236</guid>
		<description><![CDATA[I was making some changes to my blog, and one of them was to change the version of jQuery I was using. I wanted to go to 1.4.2, but to make sure I had the most updated copy of my functions page (cause I do stuff to it on multiple computers), I downloaded the page. [...]]]></description>
			<content:encoded><![CDATA[<p>I was making some changes to my blog, and one of them was to change the version of jQuery I was using. I wanted to go to 1.4.2, but to make sure I had the most updated copy of my functions page (cause I do stuff to it on multiple computers), I downloaded the page. I was using Dreamweaver to do the ftp, cause it was a quick thing. Well the formatting was off in code, but I didn&#8217;t think anything of it. I made my change, and re-uploaded it.</p>
<p>BAD IDEA. REALLY, <strong>REALLY</strong> BAD.</p>
<p>Because when i logged in, instead of going to dashboard, I got redirected to a completely blank page. This has happened to others apparently. I renamed my theme so it would it would load the default one. That worked, so I knew it was within the Web Machine theme. Then uploaded my old copy of the functions page, with the original formatting, and bam everything was fixed. But how do you know it was not something you coded? Because all I changed was a number, and after I figured out the formatting thing, I again changed the number and it was fixed. Scared the hell out of me though.</p>
 <img src="http://jc-designs.net/blog/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=236" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://jc-designs.net/blog/2010/04/had-issues-with-my-blog-wordpress-theme-scare/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

