How to get values from taxonomy and do something
-
Hi,
I am working on a travel agency site and I am trying to add the information about the months when the itinerary is available.My client wants me to present this months visually, as 12 icons, one for each month. Those which are checked should be red, other grey (I think the easiest way would be to have “active” and “inactive” GIF icons).
I have a taxonomy called “period” which stores the names of the months (01-january, 02-february etc.).
$terms = get_the_terms( $idtravel , ‘period’ );
foreach( $terms as $term ) {
$output .= $term->name.’ > ‘;}this will list all the months that are checked.
So I would need the code which will:
1. Look which terms (months) are in the period taxonomy (something like the code above I guess)
2. I was thinking to have 12 queries asking (this is for January): IS 01-january ONE OF THE RESULTS OF THE STEP 1?
3. IF YES SHOW 01-active.gif
4. ELSE SHOW 01-inactive.gifI am not a programmer so I am a bit lost here.
Many thanks.
- The topic ‘How to get values from taxonomy and do something’ is closed to new replies.