Cross referencing categories (5 posts)

  1. zandercent
    Posted 4 years ago #

    I have an events category on my site (lets say category 1) - the client has the ability to to categorise posts under another category (say a list of project types - category 2) and events.

    When the user is on the category page for events - I would like them to be able to select from a list of projects (ideally only ones which have events) and then show the resulting posts - so essentially they will be taken to a page showing ?cat=1&cat=2

    Now I could code this by hand - but I'd ideally like wordpress to detect and link those additional categories and create the filter - so If new categories are created they will be added to the list.

  2. RavanH
    Posted 4 years ago #

    Hi, are you saying you want to see a list of posts limited to those that belong to BOTH categories instead of at least ONE of the categories?

    If so, I'm looking for exactly the same...

  3. RavanH
    Posted 4 years ago #

    ... for which a custom query like

    query_posts( array( 'category__and' => array(1,2) ) );

    should work but I'd need to create a separate template file for that, I suppose. Maybe taking one category ID from the referring category, combining it with a second category so that I get a cross section list...

  4. zandercent
    Posted 4 years ago #

    Its really hard to be clear when describing these things!! Sorry
    I guess there are 2 steps to what I need to do:
    1- create a list of child categories (easy enough)
    2 - when I click on one of these categories wordpress will append the query to retrive posts from the current AND the clicked on category

    It can be done by hand - but I'd like it to automatically happen - if you see what I mean..

    Is that any clearer?! Im not sure!!

    thanks for your help

  5. RavanH
    Posted 4 years ago #

    I wonder if http://wordpress.org/extend/plugins/wp-custom-queries/ might be of help...

    Have not tested it but is sounds promising. A bit like http://wordpress.org/extend/plugins/query-posts/ but then for main content instead of sidebar widget content.

Topic Closed

This topic has been closed to new replies.

About this Topic