Most Popular Favorite Posts:

The Mommie designs blogs

my button

The Mommie cooks

strawberries button

the Mommie's Soapboxes:

DSW
Cathy Tibbles’s on Wellsphere
Wellsphere's Health Maven
Wellsphere - Health Knowledge Made Personal

The Mommie looses stuff

Am SO organized



This site designed by sweet & simple design

Showing Off


Show the subcategories of current category.

March 21, 2008

Wordpress Snippets

  1. Show the subcategories of current category.
  2. Show post titles alphabetically
  3. Return child cat’s to parent cat’s template

This snippet copied and pasted into the regular “Category.php” template will produce a list of subcategories for the current category, if they exist. Nothing will show if there are no subcategories. Change the “Narrow Your Search:” text to your own title.

This bit goes into the Category template, after the loop, in the place where you want the subcategories to show:

<?php if (is_category()) {
$this_category = get_category($cat);
if (get_category_children($this_category->cat_ID) != "") {
echo "<h2>Narrow Your Search:</h2>";
wp_list_categories('orderby=name&show_count=0&title_li=
&child_of='.$this_category->cat_ID);
}
} ?>

All the credit for this cool bit of code goes to Joost De Valk.

signature

Return child cat’s to parent cat’s template

March 20, 2008

Wordpress Snippets

  1. Show the subcategories of current category.
  2. Show post titles alphabetically
  3. Return child cat’s to parent cat’s template

This is a bit for the techy mommies out there.  Specifically the Wordpress techy mommies.

For this site, I needed a special template for the recipe category.  So all posts in the Recipe Cat’ are directed to a pretty recipe template (Category-20.php). HOWEVER, since sub-categories like breakfast or desserts are not part of the parent category “recipes”, they are redirected to the regular template.  Darn!

So this piece of code will take the category, and it’s babies and direct them to the special template you’ve created.  See this for more instruction on creating custom templates.

Place the following code in the functions.php file. When this function is called in the category template, it will search for a parent category, and then return the ID, if it exists. If there is no parent, it will return the category’s own ID. (credit to:Sivar)
//returns a category's parent id if there is one
function get_parent_category() {
foreach ((get_the_category()) as $cat) {
if ($cat->category_parent) return $cat->category_parent;
else return $cat->cat_ID;}
}

Then, place the following code into the category.php file. The “20″ is my recipe category’s ID. Insert your custom template’s category ID. (credit to: Otto)

<?php if (get_parent_category() == 20) {
include(TEMPLATEPATH . '/category-20.php');
return;
}
?>

And the coolest thing happens: When someone looks for a recipe, they are directed to my recipe category template. And when they look for a subcategory of recipes - like main meals or beverages, then they are again directed to the recipe template! I feel as though I have mastered fine art when a code bit actually works! woo hoo! :)

You can contact me if you need more help with this and I’ll see what I can do - no promises!

signature

Show post titles alphabetically

This little bit of code entered before the loop as shown, will produce a list of post titles (10 of them)alphabetically.

<?php $posts = query_posts($query_string .
'&orderby=title&order=asc&posts_per_page=10');
if(have_posts()) : while(have_posts()) : the_post(); ?>

signature

Tuesday Tidy, the Perfect Messie!

March 18, 2008

messiesman.jpgThis book was recommended to me some time ago. It is an old book that answers the question, “What kind of messie are you?” I learned that I’m a “perfectionist messie” - the kind that doesn’t pick up that piece of paper off the carpet, because it isn’t time to vacuum yet, and then I think to myself, “I don’t have time to pick up everything so it’ll have to wait.” Well, what if I pick up that one piece of paper that is noticeable in the name of a tidy house? It takes an extra 4 seconds, but then maybe I won’t have to vacuum as often! This has revolutionized the way I do housecleaning. I love this book! She offers other types of messies as well. And the tips are down-to-earth, and helpful - no pressure here. So my tip for you today is,

  • sweep up the visible mess instead of the whole floor! (big sweeps can always be done later)
  • pick up the big categories of toys - all the stuffies!
  • relax! The house doesn’t have to be perfect for you to feel comfortable!

have a great tuesday, ladies,

Cathy

signature

personal hygiene motivation ;)

March 14, 2008

st-ives-oatmeal-and-shea-butter.jpg

Hello Mommies,

The frugal side of me uses baby body wash as it is hypoallergenic and about $2 per bottle.   I got this oatmeal & shea butter body wash as an impulse purchase.  One of those little pick-me-ups.  I used it a couple days ago - and I LOVE IT!!!  It is luxury for $6 a bottle!  It is creamy, smooth, and deliciously scented.  (And this isn’t a paid review. lol)

I hope you try this out next time you’re in the mood for a little pampering.  :)

Hugs,

Cathy

signature