Home › Forum › Plugin e temi di WP › Diversi temi (uno per pagina) su un’unica installazione
-
AutorePost
-
-
22 Marzo 2008 alle 22:51 #6093essezetaPartecipante
Saluti a tutti…
ho un problema, o meglio una necessità e ci sto battendo il capo da un po’ di giorni…
Cerco di spiegarmi:
vorrei avere un tema diverso per ogni pagina del mio WP, ma utilizzando un’unica installazione, in modo da poter avere un CERCA globale, un login utenti globale, un’amministrazione globale, ecc.
Invece ho dovuto fare cosà¬:
-punto il browser su http://www.miosito.org e raggiungo la mia home, creata con WP fissato su una pagina statica…
-da questa pagina il menu (creato da me) punta a sezione_A e sezione_B…
-la sezione_A è creata con un’installazione di WP con un certo tema, la sezione_B utilizza una nuova installazione con un tema differente (o meglio è lo stesso tema di A, ma con i colori invertiti modificando il css)
Ripeto, ho fatto tutto ciò perchè volevo avere un aspetto differente per la mia home page e per le varie sezioni (nelle quali voglio però avere le funzionalità di un blog: post, commenti, registrazione, feed, ecc.), ma con la soluzione descritta sopra, come potrete immaginare, non ottengo ciò che desidero…
Ecco perchè in realtà avevo provato a raggiungere il mio fine utilizzando un tempate di pagina differente per ogni sezione… (ciò mi permetteva di avere un unico blog: e dunque la possibilità di utilizzare il CERCA globalmente; la possbilità di far fare il login una sola volta e una volta per ogni sezione; ecc.).
Il problema è che cosଠfacendo il template che viene utilizzato da ogni pagina, pur modificato, si basa sempre sullo stesso tema…
ho provato a modificare le stringhe <?php get_header() ?> in modo da avere un header dedicato (e dunque un css dedicato), ma non ci sono riuscito: scrivendo <?php get_header_BIS() ?> e creando il file header_BIS.php non ottengo risultati… NB: io ho ragionato come con il comando <? include (“nomefile.estensione”); ?>, con il quale posso includere qualsiasi file voglio, purchè esista nel percorso indicato…
Spero di avervi fatto capire…
ringrazio anticipatamente chiunque prenda in considerazione la mia domanda…
e prometto un monumento a chi mi indica una soluzione…
-
23 Marzo 2008 alle 8:05 #51718SteveAglAmministratore del forum
Non esiste soluzione a meno di non usare le funzione get_header etc e creare pagine che comprendono tutto… parziale soluzione ma che usa le categorie per differenziare i temi è:
-
23 Marzo 2008 alle 11:00 #51720essezetaPartecipante
Grazie del consiglio SteveAgl (+ interessante il tuo blog, l’ho bookmarkato… e ho aggiunto qualcosa ad instapaper che mi hai fatto scoprire)…
ho fatto un rapido test e con il plugin che mi consigli e utilizzando le categorie (invece delle pagine) per distinguere le mie sezioni riesco a venirne a capo (quasi) come volevo…
…volevo però sapere qualcosa in più sul tuo dire a meno di non usare le funzione get_header etc e creare pagine che comprendono tutto…
cosa intendi di preciso? perchè secondo me la soluzione adatta per ciò che vorrei fare è lଅ non sono espertissimo, ma riesco anche a lavorare di modifica con metodo e allora quel tuo creare pagine che comprendono tutto potrei riuscire a farlo… quando/se trovi un po’ di tempo ti va di approfondire qulla tua ipotesi con qualche dettaglio in più?
Grazie comunque…
Mi chiedevo poi: esiste un modo per fare GET e richiamare un modulo personalizzato (ma naturalmente rispettoso degli “standard” dei moduli di WP)?
Una cosa tipo get_header e get_sidebar che mi richiamino header.php e sidebar.php da un percorso differente? o modificati come dicevo io nel mio post iniziale (tipo sidebarBIS)?
-
23 Marzo 2008 alle 14:42 #51722SteveAglAmministratore del forum
Creare pagine che comprendono tutto = creare pagine che hanno il codice di testata pieè di pagina etc nel solo template di pagina, potendo richiamare un foglio stile diverso. La struttura “spezzata” dei temi WP è per comodità ma non un obbligo! Nulla mi vieta di fare un template di pagina che ha tutto il codice html e php che serve.
Per l’ultima domanda… non serve una funzione, basta usare la funzione PHP include
-
25 Marzo 2008 alle 10:41 #51760essezetaPartecipante
Ciao SteveAgl,
grazie ancora, sei stato abbastanza chiaro… con l’include riesco a fare molto…
Volevo consultarmi con te (e chiunque altro legga) su questa soluzione per avere diversi temi per diverse pagina (ci sono arrivato incrociando altre soluzioni ideate per altre cose: a partire da quella che mi hai segnalato tu):
Se io metto nel mio page.php il codice che segue dovrebbe andare no? (ora lo testo, ma intanto volevo un consulto…)
<?php
$post = $wp_query->post;
if ( is_page('Sezione_A') ) {
include(TEMPLATEPATH . '/pageA.php');
elseif ( is_page('Sezione_B') ) {
include(TEMPLATEPATH . '/pageB.php');
elseif ( is_page('Sezione_C') ) {
include(TEMPLATEPATH . '/pageC.php');
} else {
include(TEMPLATEPATH . '/pageD.php');
}
?>
Naturalmente provvedendo alle modifiche anche agli altri file, ad esempio single.php, ecc.
Che ne pensi, vado nella direzione giusta?
Un saluto
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.