Home › Forum › Plugin e temi di WP › jquery non viene letto
-
AutorePost
-
-
4 Marzo 2016 alle 15:16 #30670apache72Partecipante
buonasera a tutti, probabilmente non è un problema sostyanziale con wordpress, diciamo che se ci fosse stata una sezione “chiacchiere” sarebbe stato il posto giusto per inserire questa. Comunque, vi spiego inbreve. Ho una homepage http://psicologaonlinesalerno.it/ costruita con pagebuilder plugin, in cui ci sono diverse sezioni richiamate da anchor text (ad es. #percorso che viene richiamato dal top menu). Sto cercando di monitorare con analytics anche i “cambi di sezione” degli utenti che rimangono in homepage, ma che cambiano “sezioni” rilevate dagli anchor. Quindi sono riuscito ad inserire un codice di monitoraggio di analytics in grado di tracciare anche le anchor, però questo funziona solo se si arriva da pagine diverse, non se si rimane nella stessa, e si cambia sezione. Nella community di analytics (https://www.it.advertisercommunity.com/t5/Principiante-Google-Analytics/pagine-con-ancor-text/m-p/42295#M7100) mi hanno suggerito di usare anche uno script jquery (da inserire nel footer) che però non mi dà i risultati sperati. Quindi ho cercato un altro forum (http://www.giorgiotave.it/forum/scripting-lato-client/241445-jquery-non-va.html) e neanche sono riuscito, credo per mia incapacità . Mi chiedo quindi se può essere un problema legato all’utilizzo di uno di questi 2 plugin w3tcache e https://it.wordpress.org/plugins/speed-booster-pack/ . Mi scuso in anticipo per la prolissità e per il fatto che probabilmente non c’entra con l’utilizzo di wp. Saluti e grazie a chi mi darà delle indicazioni (anche solo un forum adatto alla mia richiesta).
-
4 Marzo 2016 alle 15:43 #119960nickPartecipante
Ciao, se non disattivi i plugin di cache e ti assicuri di aver cancellato la cache usando gli strumenti di questi, nessuno potrà mai aiutarti.
Ma a parte questo il tuo sito ha un po’ di errori, non carica alcuni file, puoi constatarlo tu stesso aprendo l’inspector di Chrome.
-
4 Marzo 2016 alle 16:02 #119963apache72Partecipante
ciao nick, grazie innanzitutto. Ho disattivato w3tcache e cancellato cache. Per quanto riguarda gli errori, ho visto che bootstrap.js non viene caricato, secondo te può deipendere dal settaggio di w3tc o l’altro plugin che ho citato prima?
edit: ho visto che in sppeed booster pack c’è la possibilità di escludere bootstrap.js (anche se devo leggere bene come fare) dall’essere inviato nel footer, può essere una cosas ensata secondo te?
-
4 Marzo 2016 alle 16:13 #119965nickPartecipante
Certamente l’uso di W3 total cache non correttamente configurato crea più danni che benefici.
Comunque non hai svuotato completamente la cache.
-
4 Marzo 2016 alle 16:56 #119966apache72Partecipante
la cache l’ho svuotata più volte, non so perchè mi dici che non è cosଠ(ovviamnente non è un rimprovero )dalle voci di w3 tc
performance>empty all cache
e di questo “ho visto che in sppeed booster pack c’è la possibilità di escludere bootstrap.js (anche se devo leggere bene come fare) dall’essere inviato nel footer, può essere una cosa sensata secondo te?” che ne pensi?
-
4 Marzo 2016 alle 19:37 #119968nickPartecipante
può essere una cosa sensata secondo te?
Secondo me no, non è una cosa sensata e gli errori che hai te lo dimostrano cosଠcome tutte le recensioni negative su Speed Booster.
Disattiva tutti questi plugins e risolverai un sacco di problemi.
Al momento il tuo sito funziona male a causa del mancato caricamento di bootstrap.js e in alcune pagine gli errori si vedono.
Stesso discorso su W3 total cache che già di suo è un vero abominio però se configurato come si deve qualche piccola miglioria senza compromettere il regolare funzionamento del tema si potrebbe ottenere.
Contatta l’autore del tema, visto che si tratta di un tema commerciale, chiedigli qual è il metodo migliore per ottimizzarlo.
-
4 Marzo 2016 alle 20:27 #119970TittiModeratore
@apache72 A parte il dubbio sul fatto che tu abbia inserito i codici nel posto giusto (oppure l’hai fatto ma il plugin te li ha spostati – e la possibilità di escludere certi script dallo spostamento è invece importante), se usi Speed booster pack insieme a W3TC occorre una configurazione del tutto diversa di quest’ultimo – se la compatibilità è assicurata devi vedere nelle istruzioni di Speed Booster qual è la giusta configurazione. Su questo non ci piove.
Però, anche se non conosco Speed Booster, è un azzardo usare un plugin per manovrare gli script in massa, e tu ne hai tantissimi: mi stupirei al contrario se non avessi nessun errore, e certamente è sbagliato spostarli o minimizzarli anche manualmente se non si sa cosa si fa. Disattiva e cancella (guarda le istruzioni per farlo correttamente) Speed Booster.
W3TC non è un abominio, è il migliore, ha un buon sistema di cache e se ben configurato – ci vuole del tempo e tanti test – dà più che qualche piccola miglioria.
La minimizzazione invece potrebbe dare dei problemi, dipende anche dal tema e dipende anche dalla memoria PHP – W3TC non funziona bene sotto i 128MB, ma se dà dei problemi la si disattiva e si mette a punto quella manuale.
Spostato in > Plugin e temi
-
4 Marzo 2016 alle 20:50 #119971nickPartecipante
W3TC non è un abominio, è il migliore,
Solo a titolo di completezza, ho usato il termine “abominio” dopo aver acquistato WP Rocket, a mio parere l’unico plugin che non promette “sogni irraggiungibili”, tuttavia funziona in modo straordinariamente bene ed efficace.
Visto che stiamo parlando del tentativo, ribadisco tentativo, di ottimizzare temi il più delle volte commerciali inteso come temi sviluppati con l’ultima preoccupazione che è l’ottimizzazione.
Edit:
Aggiungo il link a una tabella comparativa. Certo di solito non si dovrebbe mai chiedere all’oste se il suo vino è buono, però in questo caso le promesse sono garantite: http://wp-rocket.me/features/
-
4 Marzo 2016 alle 21:18 #119972TittiModeratore
Sଠsono già incappata diverse volte in quella tabella, ma io intendevo il migliore tra i plugin gratuiti.
Chiamare abominio W3TC m’è parso eccessivo (Super Cache lo è), e non mi pare d’aver letto mai particolari promesse da parte dell’autore.
-
5 Marzo 2016 alle 10:22 #119973apache72Partecipante
scusa nick
in alcune pagine gli errori si vedono.
io non mi accrgo di nulla dvoe li vedi questi errori e di che tipo sono?
-
5 Marzo 2016 alle 14:24 #119975nickPartecipante
io non mi accrgo di nulla dvoe li vedi questi errori e di che tipo sono?
Qualche post fa ti ho spiegato come rilevare eventuali errori, usa l’inspector di Chrome, ma non solo per gli errori, puoi analizzare completamente il sito, anche simulare la maggior parte dei dispositivi mobile e un’infinità di altri test. In questo momento vedo questo, già meglio rispetto alle prime volte che l’ho visto: http://i.imgur.com/pxfVXWE.jpg
-
5 Marzo 2016 alle 17:31 #119977apache72Partecipante
ma io pensavo a degli errori di visualizzazione, che so impaginazione sbilenca, msncanza di alcuni elemneti, o cose del genere, cioè “visibili”
-
5 Marzo 2016 alle 19:02 #119980nickPartecipante
ma io pensavo a degli errori di visualizzazione, che so impaginazione sbilenca, msncanza di alcuni elemneti, o cose del genere, cioè “visibili”
Pensavi male, se non risolvi i problemi indicati torni al punto di partenza che è nel primo post che hai aperto.
-
8 Marzo 2016 alle 15:07 #119999apache72Partecipante
uso speed booster semplicemente perchè mi ha dato delle migliorie, in gtmetrix passo da 86 a 96 pagespeed e di 6 punti in yslow. Idem con pagespeed di google qualche punto lo guadagno sia su mobiule che desktop e la maggiore velocità (di mezzo secondo circa) la vedo anche ad occhio, perchè carica prima i contenuti e poi immagini…quindi non mi sento di toglierlo. E’ chiaro che vorrei evitare di avere errori grossolani e da quanto poco ho capito bootstrap.js potrebbe essere importante, cosଠcome jquery. Ho provato tra l’altro a disattivare questo plugin e non mi cambia niente per quel che chiedevo al primo post, quindi non so da cosa dipende, se solo da questo plugin, o anche da altro, boh.. In ogni caso ho chiesto anche nel forum di supporto dell’autore ma non ricevo risposta almeno per adersso e forse mi viene il dubbio che mai risponderà …. Quindi sto pensando di inserire bootstrap.js tra quei file che non deve spostare giù, potrebbe essere quindi una soluzione (se riesco afarlo ), mi sembra che Titti mi dia ragione, giusto?
p.s. la configutrazione ottimale con w3tc la indica l’autore in uno dei suoi post ed ho seguito quella.
-
8 Marzo 2016 alle 19:13 #120005TittiModeratore
Se ci sono uno o più file che non devono essere spostati altrimenti non funzionano correttamente quello è l’unico modo da bacheca per far sapere al plugin che non deve spostarli, è stato messo apposta, poi se eventualmente non funziona (cioè se continua a spostarli) puoi solo rivolgerti all’autore.
Ma provare, no? Mica succede niente a passare dal tutti spostati al tutti spostati meno uno o meno tutti, semmai è il contrario.
I plugin di cache e simili vanno sempre testati.
-
9 Marzo 2016 alle 8:27 #120006apache72Partecipante
mi sto un po’ perdendo, ho fatto delle prove ma non mi ci raccapezzo…
allora, innanzitutto il plugin impostazioni ho la possiblità o di non muovere in basso gli script oppure deferred, che ho traddotto con google credo significhi che ritarda lo script. In ogni caso ho provato ad eludere lo script bootstrap.js in entrambe e il risultato è lo stesso ovvero (nell’inspector di chrome):
Uncaught ReferenceError: jQuery is not defined(anonymous function) @ (index):592
bootstrap.js:8 Uncaught Error: Bootstrap’s JavaScript requires jQuery(anonymous function) @ bootstrap.js:8
(index):19 GET http://psicologaonlinesalerno.it/bootstrap.js downloadJSAtOnload @ (index):19
in pratica seguendo questa documentazione http://tiguandesign.com/docs/speed-booster/#exclude-scripts-from-being-moved-to-the-footer-50 ho inserito nel campo “script handle” bootstrap e in “Copy the HTML code of the script from your page source and add it below” questo
<script type='text/javascript' src='http://psicologaonlinesalerno.it/wordpress/wp-content/themes/psychologist/assets/js/bootstrap.js' defer='defer'></script>
Se invece disattivo ilplugin nell’inspector mi esce solo:
GET http://psicologaonlinesalerno.it/bootstrap.js downloadJSAtOnload @ (index):19
ho sempre svuotato la cache.
Sono al punto che mi sento ancora più confuso e non so trarre una conclusione…
-
9 Marzo 2016 alle 18:09 #120011elmaniseroPartecipante
Ma non ti sei accorto che nella versione per i device mobili il menù non appare? Cosa te ne fai di un sito con un pagespeed migliore se poi non si riesce a consultare perchè senza menù?
Togli i codici javascript che hai messo, manco fossi un esperto seo o ne sapessi di javascript, e quei plugin per accelerarlo che non sai settare ed usane solo il minimo indispensabile, poi ti metti in poltrona a leggerti qualche libro, di sicuro farai meno danni e forse ti serviranno a qualcosa.
P.S.
Ho sentito recentemente un tale raccontare che sua moglie, psicologa, lo aveva sposato perchè era stato il suo miglior caso clinico………mi sei venuto in mente tu
-
9 Marzo 2016 alle 20:02 #120013apache72Partecipante
ooppss non me ne ero mica accorto!?! grZie mille… ok, per ora ho disattivato speed booster
Togli i codici javascript che hai messo
ma di quali codici parli? di quello
<script type="text/javascript">
jQuery(document).ready(function () {
jQuery('.menu a').click(function(){
var match = jQuery(this).attr('href').match(/#S+/);
ga('send', 'pageview', location.pathname + match[0]);
});
});
</script>nel footer? io vorrei tentare di farlo funzionare per poter leggere in analytics i cambi di anchor nella home, come posso fare? devo proprio abbandonare l’idea?
p.s.
Ho sentito recentemente un tale raccontare che sua moglie, psicologa, lo aveva sposato perchè era stato il suo miglior caso clinico………mi sei venuto in mente tu
in effetti quel tale potrei essere io
-
9 Marzo 2016 alle 21:14 #120014nickPartecipante
ooppss non me ne ero mica accorto!?! grZie mille… ok, per ora ho disattivato speed booster
Forse mi sbaglio ma ho come la sensazione che tu stia prendendo per i fondelli.
-
9 Marzo 2016 alle 21:30 #120015elmaniseroPartecipante
io vorrei tentare di farlo funzionare per poter leggere in analytics i cambi di anchor nella home, come posso fare? devo proprio abbandonare l’idea?
Fossi in te prima farei correttamente le stranote prove di rito per capire chi chiama un fantomatico bootstrap.js nella root, poi risolto quello continua pure con i tuoi esperimenti.
@nick, apache72 è cosଠveramente, non sta prendendo in giro nessuno.
-
10 Marzo 2016 alle 8:02 #120016
-
10 Marzo 2016 alle 11:03 #120019TittiModeratore
Sà¬, ma ti è stato detto due volte di disattivare Speed Booster, prima da @nick e poi da me – 6° e 7° post:
Disattiva e cancella (guarda le istruzioni per farlo correttamente) Speed Booster.
Come detto, W3TC è più che sufficiente, e funziona bene se hai almeno 128MB di memoria PHP. Se non lo sai configurare lo tieni configurato di default, e nel tempo testi ogni eventuale settaggio, controllando tutti i casi e non solo l’home page (se hai dei plugin che agiscono in altre pagine non controlli? Se hai un tema che carica dei CSS responsive non controlli?) e usando gli strumenti di sviluppo forniti da Firefox o Chrome, e al primo problema di caricamento script disattivi la minimizzazione automatica, solo js o solo CSS a seconda del problema, o tutte e due.
I plugin di cache e simili vanno sempre testati
Ripeto, gli script non si possono spostare/deferire/sfasare/minimizzare in massa senza controllare gli esiti ed è quasi automatico che in un sito come il tuo per il tipo di plugin e tema che utilizzi tu abbia dei problemi. W3TC sa gestire bene la minimizzazione anche con i file già minimizzati (quelli che hanno “min” nell’indirizzo), in altri invece può darsi che tu debba escluderli manualmente e certi plugin già fanno caricare i loro script al momento e al posto giusto, quindi nessuna soluzione di massa è affidabile senza prove.
L’altro giorno ho guardato a caso la pagina “curriculum” e avevi 14 errori. Vuoi un sito che si carichi presto e bene?
Semplifica, solo testo e immagini ottimizzate e avrai un sito che si carica presto e bene. Se invece vuoi slider, banner, box che si muovono, scritte che appaiono, tema e plugin che fanno questo e quello, bé allora devi imparare a ottimizzare e controllare ogni volta che impianti qualcosa di nuovo e sconosciuto come quegli script di cui dicevi in apertura o plugin fatti per gente che li sa mettere a punto.
-
10 Marzo 2016 alle 14:48 #120021apache72Partecipante
vorrei disinstallare spped booster e sto guarfdando la documentation http://tiguandesign.com/docs/speed-booster/ ma nbon c’è scritto niente a riguardo, strano, non è che se lo disintallo nella maniera classica da backend succede un casino?
e poi la penalizzazione più grossa che ho in gtmetrix è (tra le tante) Remove query strings from static resources, pur non avendo spuntato nelle impostazioni w3tc Prevent caching of objects after settings change, come consiglia l’autore e come mi avevi detto tu Titti, non succede niente, mentre con l’opzione in speed boster mi eliminava il problema…può dipendere da qualcos’altro?
-
10 Marzo 2016 alle 15:09 #120022nickPartecipante
la penalizzazione più grossa che ho in gtmetrix è (tra le tante) Remove query strings from static resources
Ti ricordi, tanto tempo fa, quando hai aperto questa discussione? Da allora a me è cresciuta anche la barba, lunghissima perché non risolvi un problema alla volta? Magari proprio quello che hai descritto nel tuo primo post, poi uno alla volta risolvi gli altri.
Alla fine, quando il sito funziona, lo ottimizzi.
Poi “problemi” come “Remove query strings from static resources”, non serve nessun plugin ma lo risolvi appunto dopo. DOPO
-
10 Marzo 2016 alle 15:19 #120023TittiModeratore
Se non ci sono indicazioni particolari, lo disinstalli normalmente da bacheca. Poi puoi sempre guardare se ha lasciato residui sul server (se non sai dove guardare paragoni con un backup precedente).
Per quanto riguarda Remove query strings è piuttosto semplice risolvere. Se nella tua installazione W3TC non riesce a risolverlo, dipende appunto dalla tua installazione, come già detto. Puoi infilare nel file functions del tuo child-theme questa funzione:
// Remove query string from static resources
function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );Altrimenti se non hai già functions nel tema child, non farlo altrimenti rischi di fare casini, ma installi questo semplicissimo plugin, costituito da un unico piccolo file con dentro più o meno la stessa funzione di cui sopra.
-
10 Marzo 2016 alle 19:55 #120025elmaniseroPartecipante
Soffri del disturbo ossessivo compulsivo da gtmetrix, patologia rara, non pericolosa per la tua salute, ma devastante per le uallere di chi ti segue.
Ti ostini a cercare la pagliuzza e non vedi la trave di quella chiamata a quel file inesistente.
-
10 Marzo 2016 alle 20:51 #120027nickPartecipante
Soffri del disturbo ossessivo compulsivo da gtmetrix
Potrebbe rivolgersi a uno studio di psicologia, ho proprio sottomano un sito che potrebbe fare al caso suo: http://psicologaonlinesalerno.it/
@apache72, si scherza, per sdrammatizzare
-
11 Marzo 2016 alle 7:50 #120028apache72Partecipante
ragazzi grazie per i consigli, tra un po’ davvero mi dovrò ricoverare
comunque, risolto i remove query stringg….(grazie Titti)…ho fatto le prove (disattivato plugin e tema standard) e praticamente il warning si presenta quando attivo il tema, solo che non capisco sto cavolo di bootstrap.js dove dovrebbe stare? io ho una struttura cosà¬: /htdocs/wordpress/wp-content/ dovrebbe stare in wpcontent? il file boottrap.js è un file del tema che trovo nel mio tema (lo so è a apagamento, ma vorrei tentare di capire) in >assets>js>qui
Quindi fisicamente è presente ma forse non deve stare là¬? Tutte le pagine che apro mi danno questo errore GET http://psicologaonlinesalerno.it/pagina/bootstrap.js
Prima che passi agli psicofarmaci mi sapreste dire qualcosa?
-
11 Marzo 2016 alle 9:09 #120029TittiModeratore
Mi pareva ovvio che qui nel parlare di file spostati, minimizzati o altro, ci si riferiva ad un fatto non statico ma attuato dinamicamente, al volo.
A meno che tu non abbia corrotto in qualche modo i file del tema, e in questo caso ci dovresti arrivare anche tu che basta ricaricarli correttamente via FTP.
A parte questo, per tutto ciò che è inerente al tema commerciale devi rivolgerti al supporto del tema.
-
11 Marzo 2016 alle 9:54 #120030nickPartecipante
Tutte le pagine che apro mi danno questo errore GET http://psicologaonlinesalerno.it/pagina/bootstrap.js
E’ un errore che puoi vedere anche tu nel sorgente del sito, ci sono 3 chiamate a bootstrap.js, tralasciando la domanda perché ci sono 3 chiamate, quella che genera errore è relativa al seguente script:
<script type="text/javascript">
function downloadJSAtOnload() {
var element = document.createElement("script");
element.src = "bootstrap.js";
document.body.appendChild(element);
}
if (window.addEventListener)
window.addEventListener("load", downloadJSAtOnload, false);
else if (window.attachEvent)
window.attachEvent("onload", downloadJSAtOnload);
else window.onload = downloadJSAtOnload;
</script>
alla riga: element.src = “bootstrap.js”; non lo troverà mai perché non c’è, intendo nella root, il file bootstrap.js è invece presente nel
percorso: http://psicologaonlinesalerno.it/wordpress/wp-content/themes/psychologist/assets/js/bootstrap.js
La funzione function downloadJSAtOnload() l’hai inserita tu o un plugin?
Fai chiarezza su questi punti e automaticamente risolverai il problema.
-
11 Marzo 2016 alle 11:09 #120031apache72Partecipante
ho notato che mettendo il tema padre l’errore scompare. può darsi che c’è qualcosa nel child che non va bene. In effetti un po’ di tempo fà ho creato un function.php (perchè di suo non ce l’ha) nel child, per poter inserire
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style' );
function enqueue_parent_theme_style() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
}
// Carica i file tradotti del tema child
add_action( 'after_setup_theme', 'my_child_theme_setup' );
function my_child_theme_setup() {
load_child_theme_textdomain( 'psy', get_stylesheet_directory() . '/languages' );
}
// Remove query string from static resources
function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );
puyò essere questo il problema ?
La funzione function downloadJSAtOnload() l’hai inserita tu o un plugin?
e chi lo sa, io non ho creato credo niente anche perchè non so cosa significhi questa riga, probab qualche plugin
p.s. poi ci sono anche footer.php, comments.php, header.php, style.css e .less, una page.php mia che uso come template di pagina nella cartella child
-
11 Marzo 2016 alle 13:49 #120032TittiModeratore
io non ho creato credo niente
Dici di non aver creato niente e poi subito dopo dici di aver fatto anche footer, comments, header e un template… non sono niente, sono file modificati da te, altrimenti che ci stanno a fare nel child – e perché ci chiedi se il functions può essere il problema? (che cmq se è cosଠcome dici non è) Basta che via FTP prima fai backup e poi elimini tutti i file del child tranne lo stile e vedi da te se quei file sono un problema! E basta che allo stesso tempo ricarichi via FTP il tema originale come già detto!
function downloadJSAtOnload() è comune e molto usata (consigliata da Google, ad es.) nell’header per deferire script, ad esempio proprio quello di G o Twitter.
Il problema è che l’URL dovrebbe essere:
element.src =”/wp-content/themes/psychologist/assets/js/bootstrap.js”;
Il che non mi stupisce se l’hai inserita tu prendendola dal web, ad esempio qui dopo aver cercato di risolvere le rilevazioni di Page Speed.
Poi dato che non ricordi le cose che fai, la lettura di questo tuo topic ti potrebbe illuminare sul fatto di come può non esser caricato o caricato più volte, date le modifiche nel tema padre e nel child (quelle o altre che noi non possiamo sapere) che hai fatto.
-
11 Marzo 2016 alle 14:13 #120033elmaniseroPartecipante
Farmaci che potrebbero aiutarti non li hanno ancora creati.
Fossi in te prima farei correttamente le stranote prove di rito per capire chi chiama un fantomatico bootstrap.js nella root
Speravo, invano, che quel correttamente scritto in grassetto ti mettesse in allerta dando per scontato che tu conoscessi a menadito le stranote prove di rito ma mi sbagliavo.
Dovevi solo disattivare, come Dio comanda, tutti i plugins, mettere un tema di default e se l’esito fosse stato positivo, mettere il tuo tema originale quindi quello child, proseguendo poi con i plugins, sempre uno alla volta, fino a scoprire il colpevole.
Tu, ovviamente, non hai proceduto in questo modo ma hai mantenuto il tema child che avevi pesantemente modificato con il risultato che il problema persisteva, solamente quando hai avuto il lampo di genio di mettere il tema padre ti sei accorto che dipendeva dal tema child, quindi cosa dovrai mai fare per capire dove hai sbagliato?
Attivare il tema child dopo aver tolto tutti i file, ad eccezione del css e del functions, verificare che l’errore non appaia ed inserirli uno alla volta per scoprire dove hai cannato.
EDIT:
Sorry, Titti ti ha già risposto a dovere.
-
11 Marzo 2016 alle 18:14 #120035apache72Partecipante
sà¬, in effetti potevo arrivarci da solo, cavolo…il prob lema è l’header.php che ho nel child modificato da me, però non so da cosa dipende…all’interno ho
[Nota mod.: codice rimosso]
(spero di non aver sforato con il numero di righe, non l’ho mewsso su pastbin per evidenziare che ho provato anche a modificare la riga in greassetto in /wp-content/themes/psychologist/assets/js/bootstrap.js come suggeriva Titti ma l’errore rimane. Se dovesse servire conoscere le righe di codeice dell’header originale lo posso postare ( su pastebin )
-
11 Marzo 2016 alle 19:37 #120036elmaniseroPartecipante
Considerando che il suo autore ad una tua passata richiesta di aiuto ti ha risposto che te lo dovevi risolvere da solo o vai da un professionista o rinunci perchè vale sempre la regola che qui non si fa supporto ai temi premium.
D’altronde ti sei comprato un tema scadente solo in base al nome non rendendoti conto che in un anno ha venduto una miseria, che per funzionare dipende da una marea di plugins fatti da altri, che è pessimo in performance, ecc. ecc.
Chi è causa del suo mal pianga se stesso….
-
11 Marzo 2016 alle 20:54 #120037nickPartecipante
Sono d’accordo con @elmanisero, forse nella scelta ti ha tratto in inganno il nome del tema “Psychologist”, in realtà per il nostro paese è più un tema aziendale, per fare business. Secondo me l’argomento psicologia dovrebbe essere proposto in modo più minimalista, pulito, sobrio, più adatto alla nostra mentalità .
Se questa situazione attuale ti sta caricando di lavoro potresti considerare la possibilità di usare un tema più leggero, ce ne sono tantissimi ben fatti, moderni, molti addirittura non richiedono quasi nemmeno plugin di ottimizzazione, se non al massimo la minimizzazione di file js e css.
-
11 Marzo 2016 alle 21:43 #120038apache72Partecipante
riguardo al tema, prima di prenderlo non avevo la più pallida idea dell’esistenze di pagebuilder e compagnia bella, anche perchè su envato non c’era la possiblità di una verisone demo, niente di niente, quindi acquistato a scatola chiusa…ci era piaciuto e l’abbiamo preso sperando che fosse ben fatto a livello di codice (altrimenti perchè siu dovrebbe comprare un tema premium?). cosଠnon è stato e vabeh pazienza lasciamo stare…
In ogni caso mi manca l’ultimo step da capire, chiedo scusa se non ho postato su pastebin (se è quello il motivo per cui è stato rimosso il codice (era troppo lungo o altro motivo?). Comunque su pastebin è qui http://pastebin.com/xfJxzCnM e la modifica che ho fatto all’header originale credo che non c’entri niente con il tema, ma che l’errore sia dovuto a qualche riga messa male o qualche cosetta del genere, perciò vi chiedo di darmi un ultimo aiuto in questo senso, vi ringrazio
-
12 Marzo 2016 alle 8:08 #120039elmaniseroPartecipante
A parte il fatto che hai wordpress nella sottocartella e non nella root, perchè vuoi deferire il framework su cui si basa il tuo tema? Tu quando entri in macchina, accendi prima l’aria condizionata, i fari, la radio e poi la metti in moto o fai il contrario?
Ma metterti a fare qualcos’altro, no?
-
12 Marzo 2016 alle 8:31 #120040apache72Partecipante
Ma metterti a fare qualcos’altro, no?
ci sto pensando da tempo, mi sa che ci sono vicino
A parte il fatto che hai wordpress nella sottocartella e non nella root, perchè vuoi deferire il framework su cui si basa il tuo tema?
@elma, devo chiedere se c’è qualche rimedio anche per un’altro disturbo di cui soffro:”incapacità di comprensione della locuzione in forma ermetica”, magari a fine terapia riuscirò a comprendere meglio ciò che mi viene detto, tenendo conto che sono un comune mortale ha ha ha
sul serio cosa significa? si riferisce a qualcosa del codice che ho postato?
EDIT:
forse ho capito! significa che tutta questa parte
<script type="text/javascript">
function downloadJSAtOnload() {
var element = document.createElement("script");
element.src = "/wp-content/themes/psychologist/assets/js/bootstrap.js";
document.body.appendChild(element);
}
if (window.addEventListener)
window.addEventListener("load", downloadJSAtOnload, false);
else if (window.attachEvent)
window.attachEvent("onload", downloadJSAtOnload);
else window.onload = downloadJSAtOnload;
</script>mi fa spostare in basso il bootstrap.js di cui ho bisogno per far funzionare il tema e che quindi è meglio eliminare? Vi prego ditemi che ho avuto un altro lampo di genio!
-
12 Marzo 2016 alle 8:51 #120041elmaniseroPartecipante
Sei veramente un “genio” molto incompreso, comunque un comune mortale non compra una roba a scatola chiusa, non pensa che su themeforest i temi abbiano un codice più pulito e siano più sicuri, basta leggere i report a riguardo.
Se volevi che quel codice funzionasse dovevi metterci anche la sottocartella /wordpress/wp-content/themes/psychologist/assets/js/bootstrap.js
Compara la velocità del tuo sito con il tema padre e con il tuo child e vedrai.
-
14 Marzo 2016 alle 15:54 #120076apache72Partecipante
Se volevi che quel codice funzionasse dovevi metterci anche la sottocartella /wordpress/wp-content/themes/psychologist/assets/js/bootstrap.js
Compara la velocità del tuo sito con il tema padre e con il tuo child e vedrai.
ok fatto, è vero l’errore è scomparso!
ho comparato i 2 temi e hanno la stessa velocità .
Ora che mi avete risolto questo problema mi ritrovvo però di nuovo punto e accapo per quanto ho chiesto nel primo post, nonostante abbia eliminato il plugimn speed booster e nonostante non abbia spuntato il minify in w3tc, quindi non ho capito perchè non mi funziona , vabeh…non voirrei tirare troppo la corda qui, vi ho già fatto perdere tanto tempo e vi ringrazio tutti, se qualcuno ha ancora voglia di rispondermi lo ringrazio in anticipo
-
15 Marzo 2016 alle 9:25 #120077nickPartecipante
Nelle tue ricerche hai già letto questo articolo? http://mediacause.org/track-anchor-tags-google-analytics-2/
L’articolo non è recente, il metodo non l’ho mai provato ma credo dovrebbe funzionare.
-
15 Marzo 2016 alle 10:47 #120079apache72Partecipante
Nelle tue ricerche hai già letto questo articolo? http://mediacause.org/track-anchor-tags-google-analytics-2/
L’articolo non è recente, il metodo non l’ho mai provato ma credo dovrebbe funzionare.
sà¬, certo nick, è il codice che mi hanno suggerito qui ma non mi funziona, ne prima del </footer> nè prima del <?php wp_footer(); ?> dove è attualmente, non riesco a capire il perchè
-
15 Marzo 2016 alle 12:16 #120081TittiModeratore
Attualmente il secondo codice l’hai dopo la fine del footer e non va bene, dev’esser cosà¬:
<?php wp_footer(); ?>
<script type="text/javascript">...</script>
</footer>Poi, altra cosa importante, nel primo codice (quello universale di GA) hai inserito qualcosa in più:
ga('set', 'anonymizeIp', true);
per l’anonimato dell’IP e questo potrebbe essere influente sul tuo tipo di navigazione o alcuni bot non esser rilevati… prima di metterlo avresti dovuto testarlo, quindi toglilo.
Terza e ultima cosa, il secondo non è uno script universale, ciò significa che potrebbe anche non funzionare dipendendo anche da come combaciano gli URL, cioè se prima di aggiungere quell’ancora (#) è necessario il percorso assoluto ad esempio.
-
15 Marzo 2016 alle 14:51 #120084apache72Partecipante
Attualmente il secondo codice l’hai dopo la fine del footer e non va bene, dev’esser cosà¬:
<?php wp_footer(); ?>
<script type="text/javascript">...</script>
</footer>strano perchè anche nel footer del tema padre originale sono disposti cosଠcioè prima </footer> e poi <?php wp_footer(); ?>, e anche in uno dei temi standard so disposti cosà¬
</footer><!-- .site-footer -->
</div><!-- .site -->
<?php wp_footer(); ?>
</body>
</html>comunque ho provato a mettelro come dici tu Titti, ma anche cosଠdopo aver svuotato la cahce non ho effetti, attualmente ho questo
<?php wp_footer(); ?>
<script type="text/javascript">
jQuery(document).ready(function () {
jQuery('.menu a').click(function(){
var match = jQuery(this).attr('href').match(/#S+/);
ga('send', 'pageview', location.pathname + match[0]);
});
});
</script>
</footer>
</body>
</html>e ho tolto quella riga anonymize dall’header
-
15 Marzo 2016 alle 15:55 #120085TittiModeratore
Bè io mi sono basata sul sorgente, però tu no non devi spostarli, lasciali come sono e sarà
</footer><!– .site-footer –>
</div><!– .site –>
<?php wp_footer(); ?>
<script type=”text/javascript”>script</script>
</body>
</html>
Comunque sarà allora la terza ipotesi oppure bisogna capire come deduci che non funziona.
Io personalmente non so dirti altro.
-
16 Marzo 2016 alle 14:19 #120095apache72Partecipante
credo anch’io che sarà la terza ipotesi, quel codice non funziona e basta, quindi rinuncio
io controllo il funzionamento da analytics, se clicco sulle voci del menu della home, non succede niente, nesuun cambio di slug quindi non va.
Grazie a te Titti, a nick ed elma che anche questa volta mi avete date un grande aiuto.
Saluti a tutti!
-
16 Marzo 2016 alle 14:41 #120096nickPartecipante
quel codice non funziona e basta, quindi rinuncio
Eppure su questo sito funziona: http://safe-e.ca/
Il link è nella discussione / tutorial che hai seguito anche tu, prova a confrontare il codice sorgente con il tuo sito.
Secondo me potresti anche provare a postare direttamente la domanda all’autore del tutorial, non è passato tantissimo tempo dall’ultimo messaggio postato, mi sembra 7 mesi, ma tentare non ti costa nulla: http://mediacause.org/track-anchor-tags-google-analytics-2/
-
17 Marzo 2016 alle 15:27 #120134apache72Partecipante
quel codice non funziona e basta, quindi rinuncio
Eppure su questo sito funziona: http://safe-e.ca/
Il link è nella discussione / tutorial che hai seguito anche tu, prova a confrontare il codice sorgente con il tuo sito.
Secondo me potresti anche provare a postare direttamente la domanda all’autore del tutorial, non è passato tantissimo tempo dall’ultimo messaggio postato, mi sembra 7 mesi, ma tentare non ti costa nulla: http://mediacause.org/track-anchor-tags-google-analytics-2/
grazie nick, ho inserito un commetno su quel sito, vedremo….intanto ho controllato il sito che mi hai indicato e ho letto la discussione che dicevi, il codice è lo stesso che uso io, e ho provato anche a inserire nel fioooter quel codice “testing” che indica l’autore , ama me non legge neanche quello, eppure la console di chrome non riporta nessuno errore, bah…sarà
ma per far funzionare sto cavolo di jquery c’è bisogno di qualche “caratteristica” particolare o che so, attivare qualcosa perchè funzioni, scusatemi ma ne sono proprio all’oscuro
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.