Home › Forum › Problemi Vari con WP › Child Theme – tanti css
-
AutorePost
-
-
19 Settembre 2012 alle 16:12 #22612WoodyPartecipante
Ciao a tutti,
come scritto in qualche altro post sono nuovo di wordpress, e nonostante le info cercate e i video visti ho sempre qualche dubbio.
Quello di oggi riguarda i Child Theme, ho capito tutti i passaggi, ma ho una domanda
io utilizzo un template che ho acquistato, che ha vari css
nel tema figlio devo inserire i collegamenti a tutti? o soltanto quelli che voglio modificare?
Tutto il resto viene preso in automatico dal padre anche nel caso di aggiornamenti?
grazie
-
19 Settembre 2012 alle 17:41 #97587TittiModeratore
Importi solo i CSS che vuoi modificare. Il child theme si fa proprio perché in caso di aggiornamenti sia aggiornato solo il padre e non si perdano le modifiche.
-
20 Settembre 2012 alle 14:20 #97597WoodyPartecipante
Grazie,
ho creato la cartella il collegamento al file Style.css, vedo il tema lo installo, tutto bene,
mah inserendo sotto la modifica non succede nulla.
La modifica l’ho provata prima con firebug, poi ho copiato il codice css modificato ed incollato nel nuovo file Style.css
Preciso che la modifica che voglio apportare è presente in Style.css
Altra domanda, se il file css sono diversi, si deve fare un file per ogni foglio di stile oppure basta lincare all’interno di Style.css?
-
20 Settembre 2012 alle 14:20 #97598WoodyPartecipante
Grazie,
ho creato la cartella il collegamento al file Style.css, vedo il tema lo installo, tutto bene,
mah inserendo sotto la modifica non succede nulla.
La modifica l’ho provata prima con firebug, poi ho copiato il codice css modificato ed incollato nel nuovo file Style.css
Preciso che la modifica che voglio apportare è presente in Style.css
Altra domanda, se il file css sono diversi, si deve fare un file per ogni foglio di stile oppure basta lincare all’interno di Style.css?
-
20 Settembre 2012 alle 14:21 #97599WoodyPartecipante
non capisco perchè si sia pubblicata due volte, mah
-
20 Settembre 2012 alle 14:39 #97600TittiModeratore
Almeno vedere come hai compilato la prima parte del css del child theme fino a @import url… e poi, hai attivato il tema child dall’amministrazione?
Non conta che la regola o la proprietà sia già presente o no nel css del tema padre, se ho capito che intendi.
L’importazione dei diversi css la fai sotto all’altra nell’unico css del tema figlio, ma dato che ora hai problemi parti con uno.
-
20 Settembre 2012 alle 15:50 #97603WoodyPartecipante
Si certo il tema è attivo è funziona.
la parte che non funziona è la modifica che aggiungo come css.
/ *
Theme Name: nome sito
Description: descrizione sito
Author: autore sito
Template: titolo tema padre
* /
@ Import url ("/padre/css/style.css..");
header {
height:50px;
left:0;
line-height:50px;
top:20px;
} -
20 Settembre 2012 alle 15:51 #97604WoodyPartecipante
aveva pubblicato nuovamente due post, lo cancello con questo
-
20 Settembre 2012 alle 16:33 #97605TittiModeratore
Theme Name: nome del tema figlio, non nome sito
T’avevo chiesto di vedere quello vero, come facciamo a capire se l’hai compilato bene guardando un esempio.
Che ne so se non hai anche sbagliato il nome del template, che dev’essere con le giuste maiuscole e minuscole.
Anche l’URL… stesso discorso, e poi cosa sono quei due punti dopo css?
Potrei dirti di provare anche con l’URL assoluto, ma prima sistema quelle cose, poi disattiva il tema e riattivalo.
Un’altra cosa sbagliata è la regola che hai scritto, da dove lo hai preso quell'”header”?
Non conosco perfettamente il css di 2011, ma non credo esista. Quando ho detto che puoi anche aggiungere cose nuove intendevo dire che puoi creare classi o proprietà nuove, ma la classe o l’ID devono essere poi chiamate nel template…
-
21 Settembre 2012 alle 8:58 #97612WoodyPartecipante
Scusa Titti,
il codice inserito è quello vero, solo che poi qui ho cambiato i nomi dopo i due punti.
/ *
Theme Name: ablazefiglio
Description: tema ablaze modificato
Author: autore
Template: ablaze
* /
@ Import url (“/ablaze/css/style.css”);
header {
height:50px;
left:0;
line-height:50px;
top:20px;
}
header è presente nel file Style.css padre, che mi gestisce il posizionamento del menu, io vorrei modificare questa posizione è perciò ho reinserito, con sole le parti che devono essere modificate.
Ripeto il tema Child lo vedo ed è anche installato e funziona.
Sono che non si vedono le modifiche che cerco di fare, che invece funzionano perfettamente con firebug.
-
21 Settembre 2012 alle 9:19 #97613TittiModeratore
OK, ero convinta che usassi 2011, ti ho confuso con un altro utente (se non mettete il link al sito per dare un’occhiata…)
Un’altra possibilità è che il tag link per lo style.css nel file che gestisce la chiamata all’header, verosimilmente header.php, sia del tipo get_template_directory_uri() invece che get_stylesheet_directory_uri().
In questo modo, il child theme non ha il suo foglio stile caricato perché viene chiamato l’URL del template padre.
Se è cosà¬, aggiungi quel file al child, di modo da poter cambiare quel riferimento, e poi magari disattiva/riattiva.
-
21 Settembre 2012 alle 10:17 #97614WoodyPartecipante
Nel file header.php sembra essere giusto
var themeURL = "<?php echo get_stylesheet_directory_uri(); ?>";
Il sito al momento è in locale quindi non posso inserire link. -
21 Settembre 2012 alle 12:32 #97616TittiModeratore
Hai la cache da svuotare per caso? Hai provato a mettere l’URL assoluto?
Un’altra cosa, prova a cambiare solo l’height, e invece che 50 metti 40 o qualsiasi altra cosa ma non 50, cioè scrivi solo cosà¬:
header {
height: 40px;
}
Pulisci tutto, disattiva e attiva e vedi se funziona. Sinceramente non so che altro pensare.
-
21 Settembre 2012 alle 12:54 #97617WoodyPartecipante
Nulla non va,
avevo provato ed ho riprovato a svuotare le cache, attivare e disattivare, ad aprirlo con più browser, nulla.
Mi viene in mente una cosa, potrebbe essere perché nel template che sto usando c’è una opzione “Custom CSS” e “Custom JS”
dove ti permette di scrivere modifiche, da li se le applico ho visto che funziona tutto, ma preferirei inserire tutto nel child.
-
21 Settembre 2012 alle 13:21 #97618TittiModeratore
Sଠpuò essere, ma visto che il tema l’hai pagato hai diritto all’assistenza, quindi chiedilo a loro.
Comunque, se personalizzi con le opzioni del tema, non perdi le modifiche con gli aggiornamenti.
-
21 Settembre 2012 alle 14:30 #97619WoodyPartecipante
grazie,
un ultima domanda, poi ti faccio sapere come è andata,
Ho trovato uno slider che vorrei implementare in Wp, ci sono delle parti che vanno inserite prima del head.
Devo creare un file php ed inserirlo in child con solo questa intestazione?
grazie
-
21 Settembre 2012 alle 14:30 #97620WoodyPartecipante
grazie,
un ultima domanda, poi ti faccio sapere come è andata,
Ho trovato uno slider –ww.flowslider.com/for-developers/setup-html–
che vorrei implementare in Wp, ci sono delle parti che vanno inserite prima del head.
Devo creare un file php ed inserirlo in child con solo questa intestazione?
grazie
-
21 Settembre 2012 alle 14:53 #97621TittiModeratore
No, devi creare una copia esatta del file originale del template in cui quel codice andrebbe inserito.
Metti la copia del file nella cartella del tuo child theme, e da lଠlo modifichi inserendo il codice.
-
24 Settembre 2012 alle 13:47 #97647
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.