Home › Forum › Amministrazione WP › widget solo in home
-
AutorePost
-
-
1 Settembre 2010 alle 20:15 #14910liraanPartecipante
Salve a tutti,
è la prima volta che scrivo in questo forum e per prima cosa vorrei ringraziarvi per il lavoro di assistenza che fate.
Passo al punto della questione, ho installato wordpress da non molto in un portale, ho installato il mio bel tema (mystique), ho composto i miei begli articolini e fin qui nessun problema, l’unica cosa che vorrei cambiare è la visualizzazione dei widget, che vorrei mantenere attiva soltanto nella home, non sono sicuro ma mi sembra di aver visto questa opzione in wordpress, (magari era un plugin particolare… o un altro cms…) ma nonostante tutti i miei arrovellamenti non sono riuscito a ritrovarla, se mi poteste dare un suggerimento ve ne sarei molto grato, grazie ancora per aver letto questo post e spero veramente che mi possiate aiutare
-
1 Settembre 2010 alle 21:25 #76785reallocPartecipante
Ho scritto pochi giorni fa un articolo su un argomento simile:
http://lloc.de/wp-standard-widgets-pimpen.html
Per adesso c’è soltanto la versione tedesca. Ma forse ti aiuta il codice che fa vedere il Link-Widget in tutte le pagine ma non la home.
-
2 Settembre 2010 alle 8:22 #76789liraanPartecipante
Ti ringrazio infinitamente realloc,
avevo omesso di dire che sono piuttosto digiuno di php (e di tedesco ) ma in ogni caso il tuo codice mi è molto di aiuto e vedrò di modificarlo per la mia esigenza, grazie ancora
-
2 Settembre 2010 alle 17:27 #76815liraanPartecipante
Ho qualche problemino a modificare il codice nell’ottimo articolo da te linkato, il problema è che non mastico benissimo il php e ben che meno il php ad oggetti, quindi sto un attimino andando in panico, se qualche anima pia mi potesse postare il codice necessario per la modifca che vorrei fare magari anche commentandolo, sarebbe per me una manna del cielo, spero che qualcuno risponda all’appello di un moribondo (ok sto esagerando) e ringrazio ancora realloc per la veloce risposta
-
2 Settembre 2010 alle 18:14 #76816reallocPartecipante
Adesso mi viene il dubbio se tu vuoi magari lasciare attiva tutta la sidebar solo nella homepage. In questo caso dovresti fare una modifica nel file sidebar.php del tema. Là si trova qualcosa tipo
if (!function_exists(‘dynamic_sidebar’))
che è il punto giusto per inserire tag condizionali tipo is_home() e is_front_page() …
-
3 Settembre 2010 alle 14:35 #76846liraanPartecipante
Si in effetti è la sidebar che vorrei tenere attiva solo in home, in modo da avere lo spazio tutto per la lettura degli articoli ogni qual’volta un utente mi clicca su uno dei titoli che li linkano.
Ora, il tema che uso per il sito (mystique) ha diverse opzioni interessanti, eliminare la sidebar, raggrupparle entrambe da una stessa parte o averne due da parti opposte, visto che non mi servono a nulla due sidebar io ne uso una ma non vortrei eliminarla da tutto il sito quindi, nella root della cartella del tema ci sono diversi file un sidebar.php e un sidebar2.php (presumendo che sia il primo), ho trovato questa funzione anche se un po diversa da come me l’avevi messa tu:
<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar()): ?>
Partendo dal presupposto che c’è un if ma non un else, e che ci sono quei due punti ( finali che non so cosa vogliano da me, mi trovo un po impantanato perchè non so dove inserirle le condizioni che mi hai suggerito… non è che mi daresti un altro suggerimento? (certa gente oh! gli dai la mano e si prendono tutto il braccio!)
Mi spiace darti noie ma sto veramente boccheggiando…
-
3 Settembre 2010 alle 15:09 #76855reallocPartecipante
<?php if (!is_home() && !is_front_page() && function_exists(‘dynamic_sidebar’) && dynamic_sidebar()) : else : ?>
dovrebbe funzionare.
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.