Home › Forum › Plugin e temi di WP › Sostituzione slider in tema CHILD
-
AutorePost
-
-
21 Settembre 2017 alle 14:00 #31561SpartacusPartecipante
Buongiorno, grazie per l’aiuto che potrete darmi.
Ho iniziato ad usare WordPress da pochissimo e sto imparando un pò alla volta.
Sto creando un sito con il tema Appointment Green (versione free).
Ho installato WP vers. 4.8.2
Ho letto che:
I temi non si modificano direttamente, è preferibile fare un CHILD THEME e che se modificassi un tema esistente e poi lo andassi ad aggiornare, tutte le modifiche andrebbero perse.
Con un tema Child, invece, potrei aggiornare il tema genitore e continuare a mantenere le modifiche.
Ora illustro il mio problema:
Ho la necessità di sostituire lo slider, già presente nel tema che ho installato, perché mi è stato richiesto.
Alcune premesse:
1) Il tema è già di per se un CHILD THEME.
2) Ho notato che nel PARENT THEME (tema padre) è presente un file home.php che si occupa di “montare†insieme la homepage del sito tramite l’uso di una sequenza di funzioni del tipo:
get_template_part(‘index’, ‘slide’);.
3) Nel CHILD THEME invece il file home.php non è presente.
Siccome il plugin che ho installato per il nuovo slider mi dà uno shortcode da dover collocare dove voglio fare apparire lo slider, l’unico posto che sono riuscito ad individuare è proprio in questo file home.php.
Ora vi chiedo:
se io copiassi il file home.php presente nella cartella del PARENT THEME nella cartella del CHILD THEME e li lo modificassi commentando la funzione get_template_part(‘index’, ‘slide’); ed inserendo lo shortcode cosa accadrebbe al primo aggiornamento del TEMA?
perderei le modifiche? oppure ha sempre la prevalenza (a livello gerarchico) il file home.php presente nella cartella del CHILD THEME per cui verrebbe sempre ignorato il file home.php del tema genitore?
Ad ogni aggiornamento che farò del tema padre dovrò andare a controllare se il file home.php ha subito variazioni?
Grazie
-
21 Settembre 2017 alle 14:12 #121887TittiModeratore
àˆ proprio cosଠche funziona il tema figlio, mediante copiatura dal tema padre del file che si intende modificare e, una volta modificato, inserendolo nel tema figlio; tale file sarà chiamato al posto di quello nel padre.
Il tema padre non dovrai toccarlo mai e quindi non ci sarà bisogno di controllare niente, solo aggiornarlo da bacheca quando ci saranno aggiornamenti.
-
21 Settembre 2017 alle 14:18 #121888SpartacusPartecipante
1000 grazie.
Anche per la celerità
-
21 Settembre 2017 alle 14:22 #121889TittiModeratore
Eventualmente l’unica cosa che potrai o dovrai fare, se ti rendi conto che l’aggiornamento ha portato importanti cambiamenti in certi file del tema padre che GIA’ stai usando nel tema figlio, controllare se è il caso di aggiornare anche lo stesso file modificato nel tema figlio. Ma è un’operazione che si fa o per un’occorrenza di cui si è certi perché lo si è letto nel changelog o altro, oppure molto saltuariamente se si ritiene che ce ne sia bisogno.
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.