Home › Forum › Plugin e temi di WP › problema con supporto widgets
-
AutorePost
-
-
14 Novembre 2007 alle 17:39 #5060IomePartecipante
Uso WordPress v. 2.3
Il tema che ho scelto è questo: http://themes.wordpress.net/columns/2-columns/2321/classic-beauty-10/
Come spiegato in questo thread (il secondo messaggio): http://www.wpitaly.it/forum/topic/4379?replies=15
ho modificato il file function.php e tutto ok. Ora però non riesco a capire dove inserire nel file sidebar.php la riga:
<?php if ( !function_exists(‘dynamic_sidebar’)
|| !dynamic_sidebar() ) : ?>
Credo, forse in errore, che manchi la parte nella quale vada inserita questa riga. Infatti in questo blog pare che dica di inserire la riga in una parte del file che però a me manca:
Dato che sono veramente a digiuno con queste cose, se avete la soluzione al problema vi prego di spiegarmela tenendo presente che non ho mai meso mano su queste cose. Ad esempio, nella riga sopra, i due segni:
||
fanno parte del codice da inserire oppure indicano ad esempio di lasciare due “spazi” dal bordo e non vanno inseriti?
Scusate la banalità e grazie…
-
16 Novembre 2007 alle 16:49 #47958IomePartecipante
Ho risolto in parte il problema. Ho inserito tutto il secondo blocco di codice che vedete qui: http://automattic.com/code/widgets/themes/
Ora però mi trovo nella barra tutte le sezioni che ho scelto tramite i widgets, ma sotto queste mi ritrovo anche le sezioni di default, quindi anche delle sezioni “doppioni”. Sapete aiutarmi?
Inoltre, nel pannello di comando, nella gestione dei widgets, ho visto che se trascino una sezione nella barra, poi non posso però toglierla. Come posso fare?
Grazie e scusate ancora.
-
16 Novembre 2007 alle 17:17 #47960SteveAglAmministratore del forum
Direi che sarebbe meglio vedere il codice, per evitare problemi di paste qua e per una iglior interazione (se fosse necessaria) pubblica il codice della sidebar su http://pastebin.com/ e poi dacci il link per vederlo.
Se aggiungi qualche widget per rimuoverlo basta ritrascinarlo dalla barra all’elenco dei “pezzi” disponibili.
-
16 Novembre 2007 alle 21:45 #47968IomePartecipante
Questo è il codice:
Le righe 8-22 sono quelle che ho aggiunto io copiate dal sito http://automattic.com/code/widgets/themes/
I widgets purtroppo non vogliono saperne di ritornare tra i “pezzi” disponibili. In ogni caso vi riporto anche il mio functions.php, dove – come detto sopra – ho aggiunto le righe 2-3:
ciao grazie non sapevo si potesse far vedere il codice cosଅ
-
17 Novembre 2007 alle 13:01 #47977SteveAglAmministratore del forum
Come immaginavo… tu hai incollato il codice in cima prima del codice che genera la sidebar statica, invece devi inserire fra l’if e l’endif tutto il codice della sidebar “fissa” se non vi sono widgets apparirà la sidebar fissa se no quella variabile. se vuoi comunque degli elementi fissi prima o dopo la parte sostituibile dai widget lascerai il codice corrispondente fuori.
Anche la pagina su Automattic se letta con attenzione era chiara, il primo pezzo di codice mostrato è una sidebar non widget ed il secondo pezzo mostra come viene modificata per renderla widget.
Il codice inserito in function.php invece è ok e non dovrebbe dare il problema da te indicato.
-
17 Novembre 2007 alle 17:28 #47986IomePartecipante
Ok grazie perfetto ho risolto! Ora che ho aggiustato il codice anche i widgets li posso togliere e poi rimetterli
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.