Using More than One Category Index

Discussion in 'WordPress' started by travoholic, Feb 5, 2008.

  1. #1
    Hello,

    I'm kind of new to Wordpress and still not sure what's possible and what isn't.

    I have a travel blog type site and I'd like to allow people to browse posts by country but also by topic. I want to keep these two lists separate though. So I'd have alist of all the countries I have posts involving and then underneath have another list of topics. So each post will be assigned two categories.

    How can I do this? Is it even possible? I see with widgets you can have more than one category list but when I add two, they're exactly the same and I don't see any way to change that.

    Thanks!
    Kirsty
     
    travoholic, Feb 5, 2008 IP
  2. mizaks

    mizaks Well-Known Member

    Messages:
    2,066
    Likes Received:
    126
    Best Answers:
    0
    Trophy Points:
    135
    #2
    There is only one set of categories. What you could do is exclude certain catgeories from each list. This example shows only categories 1,3,5,7 and 9:

    <?php
    wp_list_categories('orderby=name&include=1,3,5,7,9'); ?>
    Code (markup):
    Then in the other list show the previously excluded categories:

    <?php
    wp_list_categories('orderby=name&include=2,4,6,8,10'); ?>
    Code (markup):
    You can get the category id# from admin -> manage -> categories
     
    mizaks, Feb 6, 2008 IP
  3. Moncal

    Moncal Active Member

    Messages:
    423
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Probably the easiest thing to do would be to use tags. Suppose you have a post about Guam and your post focuses on food. You would put it in the Guam category and then type Food in the tag box. Then add the Tag Cloud widget.
     
    Moncal, Feb 6, 2008 IP
  4. amberhall

    amberhall Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi mizaks,

    I understood what you said but I don't know where to put this code that excludes the categories. Is there a plugin that will do this easily?

    Thanks,

    Amber
     
    amberhall, Apr 18, 2008 IP
  5. mizaks

    mizaks Well-Known Member

    Messages:
    2,066
    Likes Received:
    126
    Best Answers:
    0
    Trophy Points:
    135
    #5
    There are two things you can do:

    1. Goto your sidebar.php or footer.php or wherever you want the categories to be displayed and paste the code into it and resave.

    2. Download and activate the PHP Code Widget. Create a php widget, paste the code and you're all set.

    Personally, I use option two.
     
    mizaks, Apr 18, 2008 IP