WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need this for menu "red car", "blue car", "green car".

Information is retrieving from a single category (cars). But the output on pages depending on the values ​​in the metaboxes (colors). On the page with blue cars shouldn't be a green cars.

Cars and colors for illustrative purposes only.

How can I do this?

share|improve this question
What sort of data are "red", "blue", and "green"? If "car" is the Category, are "red", "blue", and "green" Categories? Tags? Some Custom Taxonomy? Post Custom Meta? – Chip Bennett Oct 18 '11 at 16:14

Make 1 template, and do a conditional on the meta info to either include a different stylesheet, or a entire different file altogether.

$colour = get_post_meta(the_ID(), 'color');
switch($color) {
     case 'red':
         include('category-car-red.php'); // or just different CSS

     case 'green':
         include('category-car-green.php'); // or just different CSS
     // etc
share|improve this answer
up vote 0 down vote accepted

I did it with $_REQUEST help. This is not very pretty solution because of ugly url, but it works.


Something like:

if ( $_REQUEST['key'] == 'value' ) {

    $additional_args = array(

    $args = $args + $additional_args;


$query = new WP_Query ( $args );
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.