Home › Forum › Plugin e temi di WP › Modifica plugin free
-
AutorePost
-
-
2 Agosto 2017 alle 22:45 #31514serenabillyPartecipante
Salve sono nuovo e non ho trovato topic al riguardo.
Non sono pro ma mi diletto da qualche tempo all’uso di WordPress con temi e plugin tutti non a a pagamento. Ho imparato a modificare il CSS del tema copiandomi piccole sezioni di codice dalla funzione “ispeziona” di Chrome.
MA, utilizzando la stessa procedura per i plugin le modifiche non avvengono.
Potreste dirmi per favore come mai? Ho provato sia dal custom CSS editor del tema, sia dall’editor plugin ma niente. Se poi torno nella modalità ispeziona sul browser mi trovo scritto il codice originale e subito dopo il mio codice aggiunto tutto con le righe nere di disabilitazione. Ho tentato di localizzare il codice principale per cancellarlo supponendo che abbia dei privilegi ma non lo trovo.
-
3 Agosto 2017 alle 12:12 #121800TittiModeratore
Temi e plugin non si modificano nei file originali, né tanto meno si devono cancellare parti di codice (e il discorso ovviamente vale anche per WP), ma occorre dapprima creare un child theme, il quale conterrà il foglio stile con le modifiche CSS del caso che andranno a sovrascrivere le regole originali corrispondenti.
Dovrai quindi rimettere tutti i file originali (scaricando di nuovo temi e plugin originali e caricandoli via FTP, o cancellandoli e reinstallandoli da bacheca) e poi, una volta creato il child-theme, imparare a usarlo nelle sue varie possibilità .
Le modifiche che non funzionano… che ti si può dire, se non funzionano è evidente che sono sbagliate. Anche usando gli strumenti offerti dai vari browser è chiaro che devi sapere quello che stai facendo: se vuoi mettere mano al codice dovrai imparare in generale un po’ di CSS, HTML e PHP – materie che esulano da WordPress e da questo supporto – e in particolare le parti di codice che ti interessano.
-
3 Agosto 2017 alle 15:25 #121802serenabillyPartecipante
Il child l’ho fatto. Come può essere sbagliato il codice se faccio sempre copia e incolla dalla modalità ispeziona? Ho aggiunto 150 righe di codice nuovo al CSS del tema con questo sistema e funziona tutto. Solo sui plugin ho questo problema. Grazie comunque.
-
3 Agosto 2017 alle 17:11 #121803TittiModeratore
àˆ vero che il CSS di un plugin può esser più difficoltoso da sovrascrivere rispetto a quello di un tema, e ciò può dipendere da vari motivi tra cui la posizione dei file, la maggior complessità della struttura e/o da quanto e come certi selettori debbano essere specificati, o da qualsiasi altra cosa che sbagli; che c’entra il copia incolla, non è che è sempre cosଠsemplice, e anche gli strumenti di analisi devono saper esser usati e letti nella loro completezza.
Puoi aver aggiunto anche 1500 righe, ma se ce n’è una sbagliata quella non funzionerà , oppure tu stesso hai inserito regole che vanno in conflitto, chi lo sa, rimane un discorso astratto non sapendo di cosa parli nello specifico. Il fatto che l’ispeziona non faccia vedere la tua modifica valida (con la riga sopra) significa appunto che non sovrascrive nulla perché è errata, se fosse giusta funzionerebbe (e poi, ancora, potrebbe anche funzionare ma non esser proprio tanto giusta o esser ridondante): non ti si può dire altro non vedendo niente (e comunque questo forum non è un forum di CSS).
L’unica è cercare informazioni nella documentazione o nei commenti al codice del plugin, nel supporto diretto del plugin o nel web in particolare a riguardo della cosa che vuoi modificare in quel determinato plugin, ognuno è un caso a sé aldilà dei selettori universali.
Se hai fatto il child allora perché cerchi di usare l’editor da bacheca (i non-esperti dovrebbero proprio dimenticare che esiste) o, peggio, perché vuoi cancellare parti del codice originale (come se questo fatto, poi, servisse a far funzionare il tuo codice), usando queste metodiche fai dei danni e ciò fa sospettare che non sai del tutto come e perché funziona un child theme. Studialo meglio e usa quello quando saprai come fare le modifiche, e ricordati di ripristinare tutti i file originali.
-
3 Agosto 2017 alle 23:20 #121805serenabillyPartecipante
ok grazie. Come ogni neofita speravo una strada semplice ma devo scoprire ancora tante cose. Buon lavoro
-
4 Agosto 2017 alle 11:04 #121806serenabillyPartecipante
Ci sono riuscito senza troppi giri scovando la soluzione in altro forum (dopo ore ed ore). Lo riporto quଠin modo che possa essere utile anche ad altri.
Aggiungendo !important alla fine di ogni regola si dà la priorità al codice scritto in custom CSS.
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.