Risposte nei forum create
-
AutorePost
-
dalzianiPartecipante
Ciao,
la soluzione in effetti era semplice: inserire in comments.php tra i campi nascosti del form sotto il pulsante Invia una stringa che crea un campo nascosto il cui valore è la stessa funzione che genera il valore della variabile in comment-template.php
<input type=”hidden” name=”comment_parent” id=”comment_parent” value=”<?php echo isset($_GET) ? (int) $_GET : 0; ?>” />
Poi il valore del campo viene richiamato in una variabile $replytoid nella pagina “inerte” sendmail.php con il metodo
$replytoid=$_REQUEST;
attraverso il nome del campo nascosto, poi inviato a wp-comments-post.php allo stesso modo, un campo nascosto il cui valore è la variabile $replytoid
<input type=”hidden” name=”comment_parent” value=”$replytoid”/>
dalzianiPartecipanteCiao SteveAgl,
ho creato un tema accessibile per WordPress, puoi visualizzare il risultato a http://opere.4elementi.info
Per ottemperare al criterio 3.3.6 della linee guida Wcag 2.0 ho inserito una pagina (sendmail.php) che – con un form – acquisisce i dati inseriri dall’utente in comments.php, gli permette di rvisualizzarli e correggerli prima di inviarli e (al click) li invia a wp-comments-post.php.
Non fa parte della hierarchy di WordPress, per cui è “inerte” nel senso che non può gestire le funzioni, può solo ricevere dati, inserirli in variabili e inviarli.
Tutto ha funzionato sinchè ho deciso di aggiungere al tema l’opzione dei commenti annidati (threaded comments), per cui comments.php deve utilizzare la funzione
<?php comment_id_fields(); ?>
Non potendo usarla nella pagina inerte sendmail.php devo acquisire i valori che genera, uno lo ho già
<input type=”hidden” name=”comment_post_ID” value=”<?php echo $id; ?>” />
vorrei ricavare
“<input type=’hidden’ name=’comment_parent’ id=’comment_parent’ value=’$replytoid’ />,
magari richiamandola da comment-template.php, forse utilizzando functions.php del tema.
Come faccio?
Grazie in anticipo, Francesco
dalzianiPartecipanteHo risolto il problema per quanto riguarda l’indicazione della lingua nell’intestazione delle nuove pagine: la funzione da usare è <?php bloginfo(‘language’); ?>, cosଠin header.php: lang=”<?php bloginfo(‘language’); ?>”.
(Grazie a http://wordpress.org/support/topic/336079).
Per far comparire l’informazione in una nuova pagina che riceve un’informazione tramite metodo post si può:
1) partire dal formulario di invio (comments.php) con una input nascosto
<input type=”hidden” name=”lingua” value=”<?php bloginfo(‘language’); ?>” />;
2) creare una variabile nella pagina che riceve l’input tramite il metodo post:
$lingua=$_REQUEST;;
3) richiamarla nell’intestazione: lang=”<?php echo $lingua; ?>”.
Francesco
dalzianiPartecipanteHo inserito il richiamo al template nelle nuove pagine, ma le funzioni di WordPress continuano a non … funzionare.
Torno a studiare
Francesco
dalzianiPartecipanteGrazie,
solo oggi ho visto le risposte, ero convinto erroneamente che mi arrivasse un messaggio di posta elettronica a ogni post.
Le nuove pagine che ho creato sono intermedie tra comments.php e wp-comments-post.php e ricevono il contenuto delle variabili tramite il metodo post del formulario di comments.php.
Vado a sperimentare i vostri consigli e a ripassare la template hierarchy.
Francesco
dalzianiPartecipanteCiao SteveAgl,
e grazie, ma non riesco a richiamare la costante, ad esempio dal file comments.php del tema.
Come faccio?
Grazie e buon Anno
Francesco
dalzianiPartecipanteBuongiorno a tutti, dopo aver realizzato due blog accessibili a norma della Legge 4/2004 e (credo) al livello tripla A della linee guida Wcag 2.0 ho voluto mettere mano anch’io al frontend di WordPress e ho creato un tema che ho chiamato “Accessibile”. Si tratta di una modifica del tema Classic.
Si trova all’indirizzo
http://wordpress.4elementi.info
Due apetti interessanti: la pagina di revisione emodifica dei dati inseriti nel formulario in osservanza del criterio 3.3.6 delle linee guida Wcag 2.0 e l’attribuzione del template alle pagine create da comments.php.
Un caro saluto
Francesco
dalzianiPartecipanteCiao,
Risolto anche questo.
Ho strutturato la sequenza dei commenti come lista non ordinata e ho proceduto cosଠnel file comments.php del tema: dopo la stringa
<?php if ( have_comments() ) : ?>
– ho fatto precedere <li class=”unopuntouno”> a <?php comment_text() ?>
– <p class=”commenti”> al blocco <?php comment_type(_x(‘Comment’, ‘noun’), __(‘Trackback’), __(‘Pingback’)); ?> <?php _e(‘by’); ?> <?php comment_author_link() ?> — <?php comment_date() ?> @ <?php comment_time() ?><?php edit_comment_link(__(“Edit This”), ‘ – ‘); ?>
– chiusi i tag p e li
e il risultato è pulito e accessibile.
Salutone
Francesco
dalzianiPartecipanteCiao,
mi rispondo da solo.
Ho risolto il problema creando due pagine di revisione dati:
sendmail.php e
sendmail2.php
Ho poi inserito una condizione nel ciclo If del file comments.php:
– se l’utente è loggato echo i primi tre tag del form che invia s sendmail2.php,
– else (l’utente non è loggato) echo i primi tre tag del form che invia s sendmail.php.
Entrambe sendmail.php e sendmail2.php puntano a wp-comments-post.php.
Spero sia utile.
Un caro saluto
Francesco
dalzianiPartecipanteCiao Ovi,
scusa se rispondo con soli due anni di ritardo a questo thread.
Sto lavorando sulla personalizzazione dei temi di WordPress da non molto.
Il file in cui inserire i tag del template è functions.php contenuto nella cartella wp-includes.
Vai alla riga
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
e procedi.
Contattami per ogni evenienza.
Salutone
Francesco
-
AutorePost