Risposte nei forum create
-
AutorePost
-
TremisferoPartecipante
Capito.
ho capito il problema e ci avevo pensato di fare un’esclusione fuori dal loop. Ma avevo anche pensato a questa inconveniente consenza.
Quindi come risolvo la cosa?
Mi servono 5 posts… mmmm
3 Aprile 2008 alle 14:27 in risposta a: Modificare categoria relazionata a un articolo/pagina tramite DATABASE #52126TremisferoPartecipanteMa a me serve usare un tag condizionale per le pagine. Ehehe l’ho imposto io! Ho sia pagine associate al template standard page.php che a template che ho fatto io. E ti assicuro che se metto delle condizioni di categoria le pagine è coem se appartenessero a delle categorie.
TremisferoPartecipanteAllora… mi rendo conto di essermi speigato decisamente male.
Devo creare una pagina che abbia contenuto php e contenuto da database (ossia una Pagina di WP).
Non voglio usare un plugin che permetta di inserire php nel codice della pagina perchè il sito non sarà gestito da me e non posso permettere che questi facciano casini.
Quindi vorrei che i futuri amministratori del sito possano modificare solo un blocco di testo della pagina, che sarà quello contenuto del database, mentre la parte in php deve restare inalterata.
TITOLO
Corpo della pagina in
wp, corpo della pagina
in wp, corpo della
pagina in wp.
Roba tirata fuori con
php e che non deve
essere modificabile.
Come fare?!?
TremisferoPartecipanteHai ragione eheh… ma quindi il contenuto della pagina che si inserisce tramite interfaccia WP (ossia quello che finisce nel database) come lo tiro fuori nel template con la pagina associata?
Immagino dovrò usare the_content, ma per la query che mi deve estrarre la pagina giusta?
Quindi:
– creo un template
– creo la pagina sul database tramite WP
– associo a suddetta pagina il template
– Come esraggo nel template il contenuto della pagina da database? Con quale query?
TremisferoPartecipanteUrgh… vabè.
Grazie…
TremisferoPartecipantePurtroppo ho provato ad usare questo if
<?php if(is_tag(‘speciale’)) : ?>
ma non viene rispettato. Se lo applico ad un articolo che contiene il tag ‘speciale’ non va.
Ma infatti mi pare di aver capito dalla guida inglese che questo if non fa al caso mio. Devo forse ricorrere a una query di puro php?
TremisferoPartecipanteGrazie risolto come dici
TremisferoPartecipanteOk ho risolto per il single.php. Ma se voglio visualizzare una lista articoli che contiene tutti gli articoli di tutte le categorie in ordine di data, come faccio a dare un if che mi permetta di colorare (ad esempio) il testo del titolo dei singoli articoli estratti di un colore diverso a seconda della categoria?
Porre:
style=”background-color: #<?php if(is_category(12)){print”ff0099″;}?>;”
non va…
TremisferoPartecipanteGrazie Spero funzioni.
TremisferoPartecipantecapisco; i problemi che mi facevo erano relativi al cambio server che dovrò fare per pubblicare il mio sito. Sarò quindi costetto a copiare la trusttura del database usato per la beta di test che mi è servita per creare il sito poichè se ricreo le categorie sul nuovo server mi si sfalzeranno gli ID…
-
AutorePost