Salve a tutti.
Ho una pagina che visualizza il contenuto di una categoria madre composta da due sottocategorie.
In testata ho un articolo visualizzato in grande della categoria madre e che quindi può appartenere a una o l’altra sottocategoria, estratto con la condizione che sia l’ultimo.
Sotto visualizzo due colonne che contengono gli articoli specifici delle due sottocategorie.
Il problema è che se nella testata l’articolo in grande appartiene a una delle due sottocategorie, nella colonna sottostante relativa alla stessa sottogategoria deve essere bypassato nella visualizzazione.
Quindi mi basterebbe che nel while dell’estrazione dell’articolo in grande potessi impostare una variabile su 1 o su 2 cosà¬, in base al valore assunto da questa variabile, potrei far saltare o meno la visualizzazione dell’articolo nelle due sottocategorie sotto.
Il mio problema quindi si può riassumere cosà¬:
durante l’estrazione con un while di un articolo, come faccio a impostare il valore di una variabile in base all’appartenenza di questo articolo a una categoria piuttosto che ad un’altra?
Tipo: if(l’articolo appartiene ad una categoria){var=1;}
E poi: if (var=1){<?php query_posts(….offset=1′); ?>}
Spero vivamente che possiate aiutarmi, il problema lo saprei risolvere in php puro ma non in WP. Non dovrebbe essere difficile.