Home › Forum › Problemi Vari con WP › Inserire php in articoli o pagine
-
AutorePost
-
-
20 Giugno 2007 alle 9:27 #4001runenPartecipante
Ciao a tutti,
gestisco alcuni blog con wp 2.2. Sapete indicarmi se sia possibile inserire all’interno di singoli articoli e/o pagine del codice PHP? Ho tentato di farlo ma wp non lo interpreta. Come posso fare ad aggirare questo problema?
(Nel caso specifico volevo semplicemente stampare il contenuto di una variabile globale).
-
20 Giugno 2007 alle 17:16 #45265UncinoPartecipante
Dovrebbe bastare, da quello che mi ricordo, scrivere i tag < e > usando rispettivamente i codici < e >
-
21 Giugno 2007 alle 7:40 #45272runenPartecipante
No, purtroppo non funziona nemmeno scrivendo i tag cosà¬, sia facendolo lato “visuale” sia lato “codice”. (p.s.: uso wp 2.2).
-
22 Giugno 2007 alle 9:17 #45289runenPartecipante
Non c’è proprio nessuno che abbia idea… nemmeno gli amministratori? Credo che qualcuno che metta mano sul codice dovrebbe essere in grado di darmi una risposta…
-
22 Giugno 2007 alle 10:22 #45291UncinoPartecipante
Purtroppo io non ho ancora testato la 2.2 (anche se non credo ci siano differenze da questo punto di vista), ma ti garantisco che per la 2.1.3 se metti il codice nella maniera che ti ho detto io, ovvero usando le entità < e > per aprire e per chiudere, esso viene visualizzato senza che venga visto come codice da interpretare.
Per sicurezza ho appena fatto delle prove anche da me, per questo ne sono certo
-
22 Giugno 2007 alle 10:27 #45293wollyAmministratore del forum
-
25 Giugno 2007 alle 13:59 #45331TraffykPartecipante
Devi modificare la template pagina in questo modo:
Dopo o prima di the_content(); metti
<?php //require('./tuacartella/ispage.php'); ?>
Successivamente nel file ispage.php scrivi questo :
<?php
if (eregi(\"ispage.php\",$_SERVER['PHP_SELF'])) {
Header(\"Location: ../index.php\"); die();
}
if (is_page('67')) require('pagina.php');
if (is_page('72')) require('pagina2.php');
if (is_page('73')) require('ciao.php');
?>
é semplicissimo per ogni pagina che vuoi aggiungere basta mettere il suo id e viene fatto tutto automaticamente.
-
27 Dicembre 2007 alle 14:32 #48860peppespePartecipante
Premetto di aver installato solo oggi wordpress Versione 2.3.1 e sarei interessato anche io ad inserire condice php all’interno delle mie pagine, ma non conosco dove è il link che mi permette di modificare questo tamplete di pagina, qualcuno sa dirmelo?
-
27 Dicembre 2007 alle 14:39 #48861wollyAmministratore del forum
non esiste un link per modificare i template.
ti suggerisco la lettura nel wiki del capitolo “dissezione di un tema” dove ti spiega tutto lo scibile sui temi di wp (dove crei i template di pagina)
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.