Risposte nei forum create
-
AutorePost
-
MarcoRM69Partecipante
Ok, come detto sono nuovo di WP, quindi perdonate le mancanze.
Intanto grazie per il chiarimento sul post_type, pensavo fossero oggetti diversi, cosଠcome non pensavo fosse importante conoscere il tema usato sul risultato di una funzione di WP.
Nel frattempo, smadonnando a destra e manca ho capito il mio errore. Inserivo le due chiamate che mi servivano:
get_post_type();
get_page_template();
Prima della wp_reset_query(), come nell’esempio ‘semplificato’ qui sotto.
Spostandole dopo le funzioni mi restituiscono quanto atteso.
$wp_query = new WP_Query( $args );
if ($wp_query->have_posts()) : while ($wp_query->have_posts()) : $wp_query->the_post();
get_template_part('templates/content', 'blogfullwidth'); ?>
<?php endwhile;
echo get_post_type();
echo get_page_template();
wp_reset_query();
In ogni caso grazie per l'aiuto e scusate il disturbo.
Marco.MarcoRM69PartecipantePerdonami, temo di non capire.
Ho letto (e l’ho rifatto anche ora) gli avvisi e gli elenchi di cosa fare e non fare.
Non credo di aver “violato” questo regolamento.
Se l’aver letto era riferito alle guide di wordpress, ho letto anche quelle, ma i miei dubbi sono rimasti.
Ho semplicemente chiesto, visto che la cosa mi sembra strana, perché una PAGINA (creata come tale) viene “vista” come post. Immaginavo, da neofita di WP, che una pagina fosse sempre una pagina ed un post sempre un post.
Se servono altre informazioni ditemi quali, non conoscendo, ripeto, WP, mi risulta difficile sapere quali altre informazioni possano essere necessarie.
Grazie,
Marco
MarcoRM69PartecipanteScusate il ritardo, sono stato un po’ impegnato in questi giorni.
Ok, datemi pure dell’idiota non funzionava perché avevo scritto male il nome del file!!!
Avevo creato il function.php invece del functions.php!!!! Non lo vedevo perché mi concentravo sul codice!
Ora funziona.
Ho un altro dubbio/problema, ma apro un altro topic visto che l’argomento è diverso.
Grazie a tutti!
MarcoRM69PartecipanteCiao.
Si ho trovato questa possibilità girando in rete.
In realtà ho provato creando un child theme (considerando anche che ho apportato modifiche al tema principale) e aggiunto, come consigliato da diversi blog, la deregistrazione nel functions.php del child, ma sembra non funzionare, i css e i js continuano ad essere caricati ovunque.
Sbaglio sicuramente qualcosa da qualche parte.
Continuo a provare.
Ciao,
Marco
MarcoRM69PartecipantePiccolo aggiornamento, magari può interessare qualche neofita come me.
Ho scoperto che i plugin vengono “caricati” da loro stessi attraverso la funzione wp register script.
Quindi o si modifica il plugin stesso o si può fare poco a quanto ho capito, sia per il caricamento, sia per la posizione di caricamento, diversi tool infatti indicano un problema sulla posizione dei javascript presenti nella pagina, consigliando di caricarli in fondo in quanto rischiano di bloccare il cosidetto above-the-fold.
Il rischio di modificare il plugin stesso è che (molto probabilmente) le modifiche si perdono al primo aggiornamento del plugin e andrebbero reinserite. Una scocciatura.
Comunque continuo a cercare metodi alternativi
Saluti.
Marco
MarcoRM69PartecipanteAh, ok. qualcuno lo conoscevo e l’ho usato per modificare alcuni template del tema.
Quindi devo capire dove è la parte di codice dove vengono inserite le righe di caricamento per i vari oggetti del plugin ed aggiungere i vari tag condizionali per decidere cosa e dove caricare.
Niente metodi meno “invasivi” o più automatici insomma
Thanks.
Marco
-
AutorePost