Home › Forum › WP e Accessibilità › Nuove pagine nel tema
-
AutorePost
-
-
16 Dicembre 2009 alle 13:10 #12456dalzianiPartecipante
Non trovo risposta a un quesito elementare: se creo delle nuove pagine per il tema (ad esempio 404.php, nome esistente nel tema Default) le funzioni di WordPress non funzionano, mi riferisco ad esempio a <?php language_attributes(); ?>.
Posso spedire il risultato delle funzioni contenuto in una variabile con il metodo post da un input type=â€hiddenâ€, ma non sempre è possibile.
Possono soccorrermi le funzioni ‘include’ o ‘require_once’?
Grazie
Francesco
-
16 Dicembre 2009 alle 16:25 #70126SteveAglAmministratore del forum
Le crei come devono essere create le pagine dei temi? Il resto che hai scritto non l’ho capito neanche dopo tre letture…
-
16 Dicembre 2009 alle 18:50 #70129ondapiPartecipante
non è che intendi aggiungere file di template nel tema come lo è la pagina archivi, ricerca, single e cosଠvia…
hai dato un occhio alla gerarchia del template e tag condiz… nel wiki
poer includere nuovi file non previsti nel tema io uso
<?php include (TEMPLATEPATH . '/nomefile.php'); ?>
che guarda caso lo trovi nella sidebar di default.
-
9 Gennaio 2010 alle 7:25 #70533dalzianiPartecipante
Grazie,
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
-
10 Gennaio 2010 alle 17:59 #70565loopPartecipante
E’ una questione che interesserebbe anche me.
Allora sto creando un template da zero e ho necessità di aggiungere ai soliti file, una nuova pagina che supponiamo si chiami pagina.php. Ecco questa nuova pagina voglio venga visualizzata includendo header e footer del tema, cioè ne mantenga lo stesso struttura/stile.
Ho provato inserendo in testa di pagina
<?php
require('./header.php');
include $_SERVER."/wp-content/themes/nometema/header.php";
?>
ma naturalmente come diceva anche dalziani non carica le varibili e mi restituisce errore. Come posso risolvere? grazie.`
-
10 Gennaio 2010 alle 18:32 #70570SteveAglAmministratore del forum
Creare un template di pagina.. info nel wiki
-
11 Gennaio 2010 alle 12:52 #70589loopPartecipante
grazie
-
12 Gennaio 2010 alle 7:26 #70611dalzianiPartecipante
Ho inserito il richiamo al template nelle nuove pagine, ma le funzioni di WordPress continuano a non … funzionare.
Torno a studiare
Francesco
-
23 Gennaio 2010 alle 10:09 #70879dalzianiPartecipante
Ho 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
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.