Welcome to ArgainBay ArgainBay.com  
Welcome to ArgainBay.com
 
  Home     About Us     Contact Us     Policies     Gallery     Blog    

December 31, 2005

Word Press 1.5 - Show One Category on homepage!

On this site, I feel that it is important to only show posts on the Blog home page that are relevant to the site. My Blog entries, however, are rarely related to scrapbooking. Thus, I wanted to find a way to filter the blog posts on the home page to specific categories - namely, excluding mine.

After sifting through the spaghetti archives in both the Support Forums and Codex at Wordpress.org, I found there were quite a few different ways other people have tried to do this. Many of the suggestions didn’t quite work; and some didn’t seem like “good” ways to go about it. First of all, I didn’t want to install a plug-in for something so trivial. Secondly, I wanted to add this feature in the Theme Template that I created rather than modifying code of WordPress files. Finally, I created some test code to try out on my server at home, so that I could see what was going on behind the scenes. After doing so, I found the following code to work well; and it satisfies my requirements stated above — no plug-in and no editing of wordpress files.

Code:
< ?php if(is_home()) { query_posts('cat=1&showposts=10'); } //Set Category for Blog Home ?>

The above code is in my index.php template file in my theme directory. The code can be anywhere in the file, but it MUST be before “The_Loop”!!! Basically, you’re re-setting the $WP_Query object before The_Loop is run.

Following are some reasons why other code examples to solve this problem don’t work (or didn’t adhere to my requirements).

The most frequently used bit of code I found that doesn’t work is this:
< ?php if(!isset($cat) { then do something - i.e. set the category ; } ?>

This code is checking to see if the $cat variable is set or not; and if it isn’t set then it should do something. Well, from my observations, this variable is always set, even if it is an empty string. So, when you request index.php with no query string - you might think that the $cat variable isn’t set. However, the variable IS set and is equal to an empty string. Thus, the above code inside the IF block never executes.

I replaced that bit of code with:
<?php if($cat == "") { do something; ?>

This checks to see if the string value of $cat is empty; and if so, do something. However, this code ‘breaks’ on other pages. So, not a good solution either.

Another bit of code I found said that if the $cat isn’t what you want it to be, you could change it by doing this:
$cat = '1';

Well sure, you can change the value in the $cat variable like that, but it does you no good once Query has already been created. If you want to change the query used in The_Loop, you have to use ‘query_posts()’ like this:
query_posts('cat=1');

Then, when The_Loop executes, it will use the new query information that you just set using ‘query_posts()’. There are many variables that can be set using query_posts(), but that is beyond the scope of this discussion. Check the Wordpress Codex for more information regarding query_posts().

Finally, the best way to change the information or layout of your Blog’s homepage is to use the is_home() function tag. This tag is a wrapper for a variable in the $WP_Query object. Upon looking at the code of the Class Object, it can be determined that the is_home() variable is changed when a new query is run and that it is only TRUE when all the other possible page types are FALSE. i.e. the page is NOT an ‘archive’ or ’single post’ or ‘ page’ or ’search’ or ‘feed’ or ‘trackback’ or ‘404′ or ‘admin’ or ‘comments-popup’. Thus, whenever you change the Query, you must realize that the is_home value might change as well.

I hope that this information is useful. Please keep in mind that everything that I have discussed here is regarding WordPress 1.5.2 only! I have no idea how these snippets of code work in earlier (and/or future) versions.


December 28, 2005

Come and gone…

Well, it takes 364 days to build up to Christmas and then it’s over so fast, it just doesn’t seem right. We had a wonderful Christmas this year and I think Sam did too. At almost 2 years old, he still didn’t really “get” it but he still had fun. He got a Montana Classic Tricycle with a wagon which is much to big for him, but it was definetly his favorite gift. We got some great pictures of Sam riding it and opening and playing with his other gifts. Other than his new tricycle, I think Sam liked his new Tonka 4×4. Eric took over 200 pictures on Christmas day and he got some really great pictures of Sam playing and having fun with Grandma, Grumpa and his Great Aunt Terry. He was hilarious to watch. I can’t wait to get copies of all those pictures for scrapbooking!


December 26, 2005

Dr. Seuss and more

Last Friday Eric and I did a photo session to take pictures of the almost 100 new products that we’re adding to the website. We got some really great new products from EK Success that isn’t being released until January in the stores, but we already have it! There are quite a few new Disney products including, Classic Embroidered Movie Titles like Peter Pan, Lady and the Tramp, Dumbo etc., Disney Mickey Mouse and Princess ribbons and matching “belt” loops, Mickey Mouse sticky brads etc. We also got some new staples for the Fastenator; new Jolee’s Boutique embellishments and of course the Dr. Seuss papers! These might be my favorite new product. The papers feature five of the most popular Dr. Seuss books including, The Cat in the Hat, One Fish Two Fish, The Grinch, Green Eggs and Ham and The Places You’ll Go. There are also coordinating alphabet and flat stickers. They are awesome, take a look!


December 23, 2005

Artist Trading Cards (ATC)

Artist Trading Cards are created and traded by artists, like baseball cards. They are small works of mixed media. There are two rules for making ATC’s. First, the cards must measure 2 1/2 by 3 1/2 inches (the same dimensions of traditional trading cards). Second, they must never be sold, they can only be exchanged. This has become a great way for artists to network and connect with one another. These mini works of art can combine a few or several products. For example, assorted papers, pictures, words and phrases, fibers, and also techniques like stamping and painting. This is a great way for scrapbookers to use up their scraps.


December 22, 2005

I’m drowning….

Well, it is two days before Christmas and I haven’t wrapped one gift, made the Christmas cookies, cleaned the house or finished the shopping. Tomorrow afternoon Eric and I are going to be photographing the new Dr. Suess paper and stickers that we just received from EK Success (they are awesome!) and then tomorrow night I have to go back over to the office to help with the database, entering the product long descriptions. Man, this is rotten timing. I really wanted to bake cookies with Sam tomorrow so we could frost them on Christmas Eve and leave them out for Santa. On Saturday, Christmas Eve, we’ll be at Cliff’s sisters celebrating Christmas with his family. Then we spend Christmas Day with my family. We also try to make time every year right before Christmas to drive around and look at Christmas lights while listening to Christmas music. Another thing we try to do is go the the Christmas Eve barn service in Loveland. There are so many things we still want to do and I just don’t know how we’ll fit it all in…….I’m drowning!


December 21, 2005

The Bookmark is finished!

So, I made the bookmark last night. I used a thin piece of cardboard and then attatched paper to that. I chose to use the Twilight Flower Fairies stickers so I picked a coordinating paper from Creative Imaginations. I think it turned out really well. I found a metal “L” that I adhered to the bookmark also, and that really looked sharp. I also made two gift tags for presents that were made like Artist Trading Cards (ATC’s) and they turned out great. I can’t believe how easy they were to make.


December 19, 2005

Christmas Bookmark

I have decided to make a bookmark for my friend Leslie for Christmas. She reads all the time so I think that she’ll really like this gift. I got the idea in a scrapbooking magazine that I was browsing through. I am going to use some of Cicely M. Barkers Flower Fairy designs for the project. I haven’t decided which Flower Fairies I am going to use yet but, it will either be the Amber Glow or Twilight series. I love her work! Colorbok has a line of layered sentiments featuring Cicely’s Flower Fairies that we carry in our scrapbooking web store argainbay.com. They are beautiful and I can hardly wait to start this project! I’ll definetly post pictures on the website when I finish the bookmark.


December 18, 2005

One week to go…..

Well, it is exactly one week until Christmas and I’m not ready! Is that surprise? Not really. Usually Cliff and I are still working on Chrsitmas presents on Christmas Eve and a few times during the wee hours of Christmas morning. Of course, those were the years when Cliff made the reindeer and Santa and Mrs. Claus yard decorations and the sleigh. Wow, those were huge projects.

So, I guess that it is no surprise that I’m so far behind. I haven’t wrapped one gift and I just put the tree up last night, with Cliff’s help and finished decorating the house. I still don’t put up all of my decorations because of Sam but, I think that next year Sam will be old enough that I won’t have to worry about it.

Sam and I went to do some last minute shopping yesterday and we had a good time. On our way home I remembered I wanted to check Sams Club again to see if the price on the tricycle had gone down any more so, I turned the jeep around and headed back to Sams Club. It’s a good thing that we did go and check because there were only four trikes left. Guess what? I bought it. I have been watching the price on it for over a month now and I decided that it was now or never. I think Sam is really going to like it…..he tried to ride it in the store while one of the employees was unhooking the wagon (so that I could fit it in the jeep). When we got home and Sam realized that I wasn’t going to let him bring it in the house—he had a major tantrum. I am really tired of those and am really hoping that it doesn’t last the whole 2nd year!!! Especially since he hasn’t even turned two yet. Anyway, back to the trike, I can hardly wait to see his face on Christmas morning when he gets up and sees it by the tree. Those pictures will make for great scrapbook pages.

This morning Cliff took Sam to the store to shop for me. I wonder what Sam picked out???? Probably some kind of ball! Ha ha. Anyway, it was great to have the house to myself for a couple of hours and Cliff said that he and Sam had a good time. They even stopped at Wendy’s to get some lunch. Apparently Sam got to be a big boy and carry the napkins to the table. He’s so cute.

Well, I guess that I should take advantage of Sam’s napping and get busy doing something.


Lorem Ipsum…

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Mauris nec metus luctus lacus tincidunt suscipit. Mauris lorem arcu, mattis et, molestie vel, molestie quis, tellus. Duis dapibus elementum enim. Suspendisse in quam. Vestibulum venenatis lacinia mauris. Sed metus dolor, pharetra mollis, posuere vel, vulputate eget, diam. Fusce dolor tortor, molestie nec, auctor vitae, ultrices lacinia, elit. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Fusce vitae mi a est sollicitudin fringilla. Cras mattis, mi eget venenatis egestas, sapien elit sagittis mi, ac ultricies purus mi sodales ligula. In vel ante. Integer auctor turpis id nunc. Cras iaculis.


December 16, 2005

Big Day

Sam and I are going to Greeley this morning to see two of my college roomates and their kids before the holidays get too much crazier. It is always fun to see them, our friendships are so strong that it doesn’t seem like it’s been ten years since I graduated! We always seem to just pick back up where we left off. I am so grateful for that. Sam is the youngest of all the kids, but Suzi’s youngest is only about 5 months older than Sam so they play pretty well together and Suzi’s daughter (the only girl in the group–poor thing) always takes really good care of Sam. Payten is sooooo sweet and beautiful too.

Tonight Dena and I are going to the new Metrolux theater in Loveland. It’s a girls night out–yippee! We still haven’t decided what we’re going to see, it just depends what time Cliff gets home from work. Whatever we see doesn’t really matter, I’m sure we’ll just have a great time getting out of the house :)

Next Page »

 
Store Home   |    About Us   |    Contact Us   |    Store Policies