Visualizzazione 1 filone di risposte
Visualizzazione 1 filone di risposte
- Devi essere connesso per rispondere a questo topic.
Email: info@wpitaly.it
Home › Forum › Plugin e temi di WP › AND logico tra categorie
Salve a tutti.
Ho in progetto il porting in WP del mio sito dedicato a Gundam (il cartone animato giapponese).
Sto facendo un ampio uso delle categorie e, in genere, ho trovato diversi plugin che mi stanno rendendo facile la vita (exec php in primis).
Sto usando il plugin “post lists” per poter generare dinamicamente in alcune pagine degli elenchi di articoli.
Ho pero’ la necessita di generare liste di articoli che soddisfino la seguente condizione: cat1 AND cat2 (…and cat99).
Non ho trovato pero’ nessun plugin che faccia questo.
Il “nuovo” sito si trova qui: http://lnx.universalcentury.it (quello “vecchio” e’ su http://www.universalcentury.it).
Ad es. vorrei generare la lista dei modellini cat1=MG dell’anno cat2=1995 e solo quelli che soddisfano ENTRAMBE le condizioni.
Tutti i plugin che sono riuscito a trovare mi tirano fuori tutti gli articoli che soddisfano anche una sola delle condizioni…
Potrei aggirare l’ostacolo creando delle nuove categorie ad hoc (somma delle precedenti, nell’esempio di cui sopra potrei creare cat25=MG-1995 ma mi sembra un lavorone e per di più superfluo…
Any idea?
Thanks!
Si usare query_posts prima del Loop per filtrare secondo i propri criteri (rimando al codex inglese perchè più compelto il nostro è in aggiornamento) se vai su:
http://codex.wordpress.org/Template_Tags/query_posts
vedi il paragrafo intitolato Multiple Category Handling dove c’è la risposta al tuo problema.
WPItaly - Copyright Creative Commons: CC BY-NC-SA 4.0