Home › Forum › Problemi Vari con WP › Abbreviazioni categorie
-
AutorePost
-
-
12 Marzo 2008 alle 16:54 #6021TremisferoPartecipante
Salve a tutti. E’ possibile gestire le categorie specificando nel codice, al posto dell’id, l’abbreviazione della categoria di interesse? Se NO, a che diavolo servono ste abbreviazioni?
-
12 Marzo 2008 alle 17:30 #51514SteveAglAmministratore del forum
Se il marcatore dei template prevede di farlo si.. altrimenti no Le abbreviazioni (nice names) sono la versione detta URL friendly del nome della catgoria, nella quale sono presenti solo caratteri semplici, niente spazi ne lettere accentate o altro, servono per generare le URL dei link ad esempio
Quindi la categoria: “Questa è la mia categoria” diventa questa-e-la-mia-categoria ed ha anche lo scopo di avere nomi univoci per una categoria infatti se crei una categoria o un articolo o altro che usa le abbreviazioni con lo stesso nome l’abbreviazione avrà un numero progressivo aggiunto in automatico per garantirne l’univocità , insomma non sono state inventate per puro divertimento
-
12 Marzo 2008 alle 17:37 #51515TremisferoPartecipante
E come faccio a usarle per il codice? Cioè, quello che dici:
“Se il marcatore dei template prevede di farlo si.. altrimenti no “
che vuol dire?
Grazie!
-
12 Marzo 2008 alle 17:55 #51516SteveAglAmministratore del forum
Che se ad esempio:
http://codex.wordpress.org/Template_Tags/wp_list_categories
nel parametro di esclusione accetta il nome abbreviato delle categorie le puoi usare al posto degli id, in questo caso non lo permette quindi devi continuare ad usare gli ID con questo marcatore. Cosa pure più pratica perchè un conto e scrivere un elenco di numeri un altro un elenco di testi vari con possibili errori di battitura lunghezza del codice etc.
In parole povere, non mi pare nessun marcatore preveda di usare le abbreviazioni (o almeno non mi viene in mente) ed i più usati utilizzano gli ID ergo.. non puoi usarle.
-
12 Marzo 2008 alle 17:58 #51517TremisferoPartecipante
capisco; i problemi che mi facevo erano relativi al cambio server che dovrò fare per pubblicare il mio sito. Sarò quindi costetto a copiare la trusttura del database usato per la beta di test che mi è servita per creare il sito poichè se ricreo le categorie sul nuovo server mi si sfalzeranno gli ID…
-
12 Marzo 2008 alle 20:51 #51519gollum1Partecipante
un paio di settimane fa mi sono trovato nella stessa situazione, l’ho risolta con una funzioncina che ho inserito nel tema, in cui faccio riferimento al nome della categoria nella funziona in_category()…
ora non ho il codice sottomano, ma prova a cercare nei miei post di una o due settimane fa, e dovresti trovare anche il codice che ho postato…
Byez
—
Gollum1
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.