20i Domains

Really dumb wordpress query

Discussion in 'Content Management Systems' started by jwm, Feb 16, 2011.

Thread Status:
Not open for further replies.
  1. jwm United Kingdom

    jwm Active Member

    Joined:
    Apr 2007
    Posts:
    407
    Likes Received:
    5
    This is probably really simple but I can't find the answer anywhere so hoping someone can help.

    I have set up a WP site and have a number of categories about 8 of these are brand names and about 8 are price categories (ie £0-£50, £50 to £100 etc).

    I want to arrange the sidebar so I have a title 'Search by Price' which then has the price categories below it (no brand categories included). Then below that have a title 'Search by Brand' which has the brand name categories below it but not the price categories.

    I thought this would be simple enough but in WP I only seem to have the option to display all categories or none! Driving me mad trying to split them up. Can anyone help?
     
  2. Domain Forum

    Acorn Domains Elite Member

    Joined:
    1999
    Messages:
    Many
    Likes Received:
    Lots
    articles.co.uk
     
  3. AssetDomains

    AssetDomains Well-Known Member

    Joined:
    Feb 2010
    Posts:
    3,075
    Likes Received:
    74
    PHP:
    <?php wp_list_categories('orderby=name&include=3,5,9,16'); ?>
    Change the 3,5,9,16 for your relevant category id's
     
  4. aaclapham

    aaclapham Active Member

    Joined:
    Oct 2010
    Posts:
    67
    Likes Received:
    0
    Just create two categories 'Search by Price' & 'Search by Brand' . Then create the others as sub categories of the above two.

    Drop the Categories widget into your sidebar and remember in options to tick Show hierarchy.
     
  5. peter_w United Kingdom

    peter_w Active Member

    Joined:
    Nov 2008
    Posts:
    558
    Likes Received:
    18
    You'd be better of creating custom taxonomies rather than trying to do it with categories. It would give you far more control over the way you can display things.
     
  6. jwm United Kingdom

    jwm Active Member

    Joined:
    Apr 2007
    Posts:
    407
    Likes Received:
    5
    Thanks, could you explain what this means in a non techie way?
     
  7. peter_w United Kingdom

    peter_w Active Member

    Joined:
    Nov 2008
    Posts:
    558
    Likes Received:
    18
    To be honest probably not as it means editing the functions.php file and doing custom query post strings!

    This article by Justin Tadlock is an excellent introduction: http://justintadlock.com/archives/2009/05/06/custom-taxonomies-in-wordpress-28
     
Thread Status:
Not open for further replies.