Home › Forum › Installazione WP › Tag condizionali
-
AutorePost
-
-
4 Giugno 2008 alle 9:05 #6869webnicolaPartecipante
Sto cercando in rete se c’è un modo di usare un tag condizionale per esempio “if is_category” non tanto per una pagina di archivio per una determinata categoria ma per tutti gli articoli di quella categoria.In pratica vorrei che ogni volta che viene visualizzato un articolo “singolo” di una determinata categoria mi visualizzi una porzione di codice personale. Qualcuno ha mai usato niente del genere?
-
4 Giugno 2008 alle 9:14 #54311wollyAmministratore del forum
nel wiki ci sono guide ad hoc ed esempi, idem se ben ricordo nelle faq e nel forum se ne parla spessissimo.
Usando il box cerca mettento is_category o is_single o is_page o is_home troverai moltissimi 3d e moltissimi esempi.
-
4 Giugno 2008 alle 9:56 #54315webnicolaPartecipante
Forse non mi sono spiegato bene, io cercavo un tag condizionale che riconoscesse tutti gli articoli singoli di una determinata categoria, il wiki, il forum lo avevo rivoltato come un calzino, ma per scrupolo sono andato a fare altre ricerche come da te consigliato ma nulla, sembra non ci sia la possibilità .In compenso ho trovato la soluzione intervenendo sul file single.php, grazie per la risposta comunque.
-
4 Giugno 2008 alle 10:09 #54320ArturoPartecipante
ma per avere la lista dei post per categoria esiste la funzione wp_list_cats() che ti stampa la lista delle categorie, cliccando su una di queste ti apre l’archivio per categoria dove vengono visualizzate tutti gli articoli con quella data categoria.
-
4 Giugno 2008 alle 10:19 #54321wollyAmministratore del forum
allora non ho capito quello che vuoi fare.
io ho capito che tu vuoi che nella visualizzazione di un singolo articolo (single.php) se è inserito in una determinata categoria (is_category) vnga scritto qualcosa di particolare. Se è cosଠquello che ti ho detto di cercare è corretto.
-
4 Giugno 2008 alle 11:45 #54332SteveAglAmministratore del forum
Sto cercando in rete se c’è un modo di usare un tag condizionale per esempio “if is_category” non tanto per una pagina di archivio per una determinata categoria ma per tutti gli articoli di quella categoria
-
4 Giugno 2008 alle 13:26 #54343webnicolaPartecipante
Esatto mrbrown, ho risolto proprio con “in_category” editando single.php, come avevo detto ho risolto trovando altrove, ma sempre wordpress è! Grande mrbrown, mi hai capitooo!Una cosa in più in wp-it!
-
4 Giugno 2008 alle 18:11 #54366SteveAglAmministratore del forum
bene, ne ho piacere
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.