WordPress.org

Ready to get started?Download WordPress

Forums

Only show relevant custom fields for a query (2 posts)

  1. domtown
    Member
    Posted 4 years ago #

    Hi there,

    I'm using a combination of the plugins Custom Fields Template and Custom Fields Taxonomies. I use the first one to define CF with each entry and the latter one to query posts using these custom fields.

    One problem I'm running into is that when I call custom fields as a cloud it shows all custom fields in the database when I call it outside a loop OR just the ones for a specific entry when called inside the loop.

    My question: is it possible to show only available and relevant custom fields after doing a query?

    Example:
    for the label Fruit I have the custom fields Apples, Oranges, Bananas and Lemons
    for the label Colour I have the custom fields Green, Red, Yellow, Orange

    Now I would like to query for Apples which shows all posts with the value Apples for label Fruit. At top of these results I want a cloud with all custom fields with Colour related to the current query. In the Apple posts there are red and green apples, NOT yellow and orange. When I call the custom fields for label Colour though I still get Orange and Yellow in the list which don't make any sense.

    Is there a way for solving this issue? The reason for this is I want to use custom fields for filtering displayed posts. i.e. Fruit > Apples > Red which only shows posts wit red apples.

    I've been puzzling for days now, tried dozens of plugins but just can't figure this out.

  2. scribu
    Member
    Posted 4 years ago #

    You'll be able to do something like this using Query Multiple Taxonomies (version 1.1 - not released yet).

Topic Closed

This topic has been closed to new replies.

About this Topic