Home › Forum › Plugin e temi di WP › Inserire un bannerino a seconda di quale categorie si trova l’articolo
-
AutorePost
-
-
14 Marzo 2010 alle 9:24 #13308Mk3000Partecipante
Esistono plugin che permettono l’inserimento di un bannerino/immagine a capo di un articolo, in base alla categoria?
-
14 Marzo 2010 alle 12:07 #72137ondapiPartecipante
oppure usa nel loop qualcosa del genere:
<?php if ( in_category('3' )==true) {echo "inserisci qui il codice html";} ?>
-
14 Marzo 2010 alle 12:15 #72138loopPartecipante
credo basti solo in_category(‘3’) senza ==TRUE o sbaglio?
-
14 Marzo 2010 alle 12:19 #72139Mk3000Partecipante
Grazie ondapi!
Ho provato ad inserirlo ma quando carico una pagina/articolo la pagina è bianca. ci dovrebbe essere uno sbaglio nel codice
<?php if ( in_category(‘3’ )==true) {echo “codicehtml”;} ?>
-
14 Marzo 2010 alle 14:54 #72144loopPartecipante
prova cosà¬
<?php
if (in_category(‘ID’)) { html per la categoria 1 }
elseif (in_category(‘ID’)) { html per la categoria 2 }
else { html di default }
?>
-
9 Settembre 2010 alle 12:03 #76992Mk3000Partecipante
sempre tutto bianco
ma dove deve posizionarsi quel codice esattamente?
-
9 Settembre 2010 alle 15:08 #76996SteveAglAmministratore del forum
Se hai pagina bianca ha degli errori fatali in PHP… o hai acceso al log degli errori sul tuo server o devi andare a tentativi… attenzione alle parentesi, gli apici e i ; ovvio che il codice che ti hanno idnicato se lo completi cosi mettendo del codice HTML al posto della frasetta codice HTML farà morire il tutto… si suppone che tu conosca PHP + HTML
-
9 Settembre 2010 alle 16:17 #76997Mk3000Partecipante
-
9 Settembre 2010 alle 16:28 #76998reallocPartecipante
Forse è meglio se usi un plugin. Con l’Advertising Manager puoi scegliere anche la categoria dove deve comparire un banner.
-
15 Settembre 2010 alle 15:06 #77099Mk3000Partecipante
Alternative?
-
16 Settembre 2010 alle 21:06 #77122zhenyaPartecipante
Usa wp-bannerize senza fare come dicevano 6 mesi fa. Leggi per bene le istruzioni; vedrai che è possibile utilizzare nelle pagine e nei post il codice per mostrare i banner. Oppure nelle sidebar con il widget.. ovvero anche con una specifica query in base alla categoria/e ove il/i banner deve essere visibile. E’ molto personalizzabile e fa al tuo caso.
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.