Archive for September, 2007

Comic Links #5

Friday, September 28th, 2007

http://web.mac.com/aaronandpatty/iWeb/What%20the%20Duck/Comic%20Strips/3450C89A-A230-484D-89ED-FE5E17F18EBC.html

http://www.penny-arcade.com/comic/2007/09/28

http://xkcd.com/322/

http://thingpart.livejournal.com/12754.html

http://web.mac.com/aaronandpatty/iWeb/What%20the%20Duck/Comic%20Strips/F73FB31B-0129-4939-9B94-C898DBED9B77.html

http://xkcd.com/320/

I am seriously considering trying the sleep schedule from the last xkcd post…

Sphere: Related Content

How to customize your WordPress category pages, an easier way

Thursday, September 27th, 2007

If you have the desire to customize your WordPress blog, and have attempted it, you surely know that it is a pain sometimes.

I was trying to cutomize my category pages to show the most recent post for that category, and only posts for that category.

  • Create a file called category.php in your theme’s directory.
    • This will default WordPress to use this page for categories from now on.
  • For showing only the most recent post with this category: Use this code:

<?php
get_header();
//the following gets an array of the categories for this post

$get_cat = get_the_category();

//the following will get the first category for your post and create a WordPress query that uses “The Loop” to show the most

// recent post from that category

$q = ‘cat=’.$get_cat[0]->cat_ID.’&showposts=1′;
$my_query = new WP_Query($q);
//the rest is just like everywhere else that you show posts on your blog

if($my_query->have_posts()){
while ($my_query->have_posts()) : $my_query->the_post();
?>
<h2>
<?php the_title(); ?>
</h2>
<?php
the_content(’Read the rest of this entry »’); ?>
<?php
endwhile;
}else{
?>
<h2 class=”center”>Not Found</h2>
<p class=”center”>Sorry, but you are looking for something that isn’t here.</p>
<?php
}

get_footer();
?>

  • For showing the only post with this category or showing the titles only if there are multiple posts: Use this code:

<?php
get_header();
$get_cat = get_the_category();
$q = ‘cat=’.$get_cat[0]->cat_ID.’&showposts=1′;
$my_query = new WP_Query($q);
if($my_query->have_posts()){
while ($my_query->have_posts()) : $my_query->the_post();
?>
<h2>
<?php the_title(); ?>
</h2>
<?php
//this is all I added to the previous one, it checks to see how many posts there are
if(count($posts) > 1){
the_content(’Read the rest of this entry »’);
}
?>

<?php
endwhile;
}else{
?>
<h2 class=”center”>Not Found</h2>
<p class=”center”>Sorry, but you are looking for something that isn’t here.</p>
<?php
}

get_footer();
?>

Now you can add the other normal wordpress template tags in these, just place them and try it out.

Note: The best Codex page I found for templating is here: The WordPress Loop

Sphere: Related Content

Add custom fields to your wordpress write page

Monday, September 24th, 2007

How to Use This Plugin

Custom Fields Plugin for Wordpress

I wanted to show you how to set up your conf.ini file so that you can have the fields you need for your wordpress blog’s write page.

Note: Titles should not have spaces in them.

Radio/Checkbox/Select:

[ItemTitle]

type: {either use “radio”, “select”, or “checkbox”}

value: Yes#No#Maybe#Sometimes#Jumping Dolphins <–separate multiple items with the # sign

default: Jumping Dolphins <–This must be spelled the same as the one above that you want defaulted

description: Type the description of the custom field here.

Textfield:

[ItemTitle]

type: textfield

value: Thanks for all the fish

description: Type the description of the custom field here.

TextArea:

[ItemTitle]

type: textarea

value: text text text, more text

description: Type the description of the custom field here.

Custom Fields Plugin for Wordpress


Updates

I have talked previously about the rc_custom_field_gui plugin and how I modified it to fit the WordPress write page styles, and I added a few other features to it. I posted on the original author’s plugin page about the changes that I made to his plugin, and at last check he had not responded.

I have now updated it again.

Previously, if you made an element that had a value or default of “Yes” or “No” it would not work, because PHP’s parse_ini_file function will parse those as 1&0, respectively. This is good when you are using this as an actual ini file, but this is a sort of hack, so we need to figure something out.

Now, just enter your yes/no values as ‘yes’ or ‘no’ with the quotes. The parse_ini_file function will ignore them as yes/no and the plugin will strip the quotes out, and use the text.

Note: You can use any capitalization of the letters in the words ‘yes’ or ‘no’, it will take care of any of them.

Other updates:

I standardized where the descriptions show, which is under the field element for which they are defined.

I made the checkbox a loop like the radio elements, so now you enter them exactly the same as radio and select elements.

Compatible with WordPress 2.2.3!!

Custom Fields Plugin for Wordpress

Sphere: Related Content

A shameless plug

Saturday, September 22nd, 2007

From here on out, whenever you see the word basecamp on my site you will notice that it is linked to my referral page on their website.  I am plugging basecamp because I love their product, and I would love to get it for free.

Basically, if you click my link, and then sign up, there is a chance that I would get a credit towards my payments.  Right now I am using the $12/month account, but would love to bump it up to the $24/month, I just can’t afford it right now.

My version of what basecamp is:

It is a web based project management software.  It has Milestones, ToDo lists, and client management.  You can give your clients access to their projects so they can see what you are working on for them.  It lets them realize that you are working on their project.  Also, they can leave you todo items and messages.  If you get the more expensive accounts, you get a free chat program that is built in a logs your conversations.

If you need something like this, sign up for the free account, and check it out.  You will only get one project for free, but I guarantee you will get hooked.  I am.

Sphere: Related Content

Comic Links #4

Friday, September 21st, 2007

http://web.mac.com/aaronandpatty/iWeb/What%20the%20Duck/Comic%20Strips/F0D9F922-216D-4292-B8B8-7FA0ECB9E2AE.html

http://web.mac.com/aaronandpatty/iWeb/What%20the%20Duck/Comic%20Strips/07DA7183-C49E-4CB0-B95D-4246929A4434.html

http://www.basicinstructions.net/2007/09/how-to-tell-your-spouse-about-your-day.html

http://www.basicinstructions.net/2007/09/how-to-fight-peer-pressure.html

http://www.basicinstructions.net/2007/09/how-to-seem-smart.html

http://www.basicinstructions.net/2007/09/how-to-avoid-going-dancing.html

http://www.basicinstructions.net/2007/09/how-to-deal-with-rash.html

http://thingpart.livejournal.com/12325.html

wow, apparently I really liked the last couple basic instructions comics…

Sphere: Related Content