Home › Forum › Plugin e temi di WP › si può creare single-1.php per mantenere il tema di categoria sul singolo art?
-
AutorePost
-
-
27 Febbraio 2008 alle 14:27 #5929bildworterPartecipante
Ciao a tutti,
vorrei sapere come modificare un tema di un articolo che appartine ad una categoria con un tema differente. Lasciare il tema della categoria, insomma. Si può creare, ad esempio, un single-1.php come per le categorie?
Grazie per la vostra disponibilità in anticipo
meneceo
-
27 Febbraio 2008 alle 20:21 #51131ondapiPartecipante
qui forse trovi qualcosa http://www.wpitaly.it/wiki/Main/TagCondizionali
-
28 Febbraio 2008 alle 11:06 #51150bildworterPartecipante
grazie, è molto utile per capire un po’ di cose. Però, scusami neofita, non ho capito come dare un tamplate diverso ad una sola tipologia di articoli. Cioè, posso creare un single.php in più e poi usare le info che mi hai indicato?
Grazie
-
28 Febbraio 2008 alle 11:28 #51153ondapiPartecipante
qui forse trovi altre info http://www.wpitaly.it/wiki/Main/TemplateCategoria
-
28 Febbraio 2008 alle 11:33 #51154bildworterPartecipante
sempre gentilissimo e pronto. Ma ancora non risolvo. Scusami. Provo a darti un esempio chiarificatore. Forse non riesco a spiegarmi bene.
Se tu segui questo link http://www.chematek.biz/?cat=10
vedrai che ho impostato un template per quella categoria. Se clicchi sul post, ad esempio questo, http://www.chematek.biz/?p=51 vedrai che ritorna il template della home, che è quello di single.php, che è quello che mi serve per i singoli articoli delle altre catecorie.
Non riesco a trovare una soluzione. Sono due giorni che mi aggiro tra forum e wiki.
Ancora grazie per la tua disponibilità .
-
28 Febbraio 2008 alle 11:59 #51156SteveAglAmministratore del forum
Devi farti un single.php con tante if o meglio un case che per ogni categoria che vuoi personalizzare crea la pagina come preferisci. Siccome potrebbe essere molto grosso come file puoi prendere le parti che generano le vari pagine singole e metterle in tanti file di cui poi farai un include.
Ovviamente occorre un minimo di conoscenza di PHP… o che qulcuno te lo faccia per te (magari una microassistenza a piccolo prezzo)
-
28 Febbraio 2008 alle 12:01 #51157ondapiPartecipante
penso sia possibile intervenendo nel loop di single.php
dovresti aggiungere dei tag condizionali tipo is_category(‘6’)
un po’ quello che succede il sidebar.php del tema di default dove la funzione ricerca e il tasto login compaiono solamente in certe pagine, settate dai tag condizionali
tipo
if ( is_home() || is_page() )
potresti creare qualcosa di simile in single
non l’ho mai testato ma penso…
-
28 Febbraio 2008 alle 12:04 #51158bildworterPartecipante
grazie. Mi sa che mi rivolgerò al mio informatico di fiducia. Pensavo fosse più semplice come per la personalizzazione delle categorie.
Ancora grazie.
A presto
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.