Home › Forum › Problemi Vari con WP › inserire articolo nella colonna destra
-
AutorePost
-
-
17 Maggio 2011 alle 14:49 #17918pppppaoloPartecipante
Ciao a tutti, un’informazione. Nel mio blog avrei la necessità di inserire un articolo sulla colonna di destra. Mi spiego meglio: devo creare un evento e voglio mettere la locandina sulla colonna di destra e fare in modo che quando ci si clicchi sopra si venga reindirizzati sulla pagina dell’articolo completo. Allo stesso tempo non vorrei però che l’articolo comparisse nella prima pagina dove ci sono tutti gli altri.
Non posso usare le pagine in quanto ho impostato il template perchè crei automaticamente delle voci di menu per ogni pagina creata.
Grazie
-
17 Maggio 2011 alle 17:15 #84669TittiModeratore
Per la locandina nella sidebar, apri un widget di testo e dentro ci scrivi il link all’immagine racchiuso dentro il tag per il collegamento ipertestuale, cosà¬:
< a href=”link articolo” target=”_blank” >< img src=”link locandina” alt=”” title=”” width=”” height=”” > Collegamento< /a>
(Togli gli spazi in corrispondenza dei < >)
Per la pagina nel menu può essere che dandole il valore di sotto-pagina (child) non appaia nel menu, questo però dipende dal tema, prova.
-
17 Maggio 2011 alle 22:15 #84684pppppaoloPartecipante
grazie adesso provo
-
18 Maggio 2011 alle 5:00 #84685EmmePartecipante
Ma in ogni caso escludere una pagina dal menù è molto facile.
-
19 Maggio 2011 alle 14:28 #84767LaPadovaBenePartecipante
Ciao, anch’io ho lo stesso problema che creando una nuova pagina va direttamente ad aggiugnersi a quelle già presenti nel menù, scombinando la grafica…
Se ho ben capito, la funzione
-
<?php wp_list_pages(‘exclude=17,38’ ); ?>
Dovrebbe escludere una pagina dal menù, ma non essendo ferrato in php e in editing di codice non saprei ne dove metterla ne che parametro passarle…
Mi dareste una mano?
Grazie mille.
-
19 Maggio 2011 alle 15:21 #84771EmmePartecipante
Devi trovare wp_list_pages all’interno del tuo tema (presumo nell’header) e aggiungere exclude etc.
-
20 Maggio 2011 alle 13:53 #84806LaPadovaBenePartecipante
Nei vari file inerenti all’header del tema non compare nessuna dicitura con wp_list_pages…
Se non c’è devo aggiungerla?! è che non saprei dove!
-
20 Maggio 2011 alle 16:05 #84813TittiModeratore
Guarda bene, se hai usato il trova del browser magari hai aggiunto segni o lettere che non ci sono e non lo trova
La riga potrebbe essere cosà¬: `<br />
<pre><code>`
<?php wp_list_pages(‘title_li=&depth=2’); ?>`<br />
<pre><code>`
Cerca solo “list”
Se proprio non c’è, aggiungilo tu in header.php (quali altri file hai per l’header?), va bene anche in fondo, dopo l’ultimo
<?php endif;?>
Non importa se non hai il “depth=2”, la riga è quella… se ce l’hai diventa `<br />
<pre><code>`
<?php wp_list_pages(‘title_li=&depth=2&exclude=….′);?>`<br />
<pre><code>`
-
20 Maggio 2011 alle 16:41 #84819LaPadovaBenePartecipante
Allora, la ricerca l’avevo fatta con varie parole… i file che ho sono header.php, header-blank.php, header-custom.php.
Io ho provato ad inserire la funzione… ma mi sballa tutto! Mi fa vedere l’elenco delle pagine e sotto-pagine esistenti tra il menù ed il primo post!
Che fastidio… per caso se vi facessi vedere l’header riuscireste a dirmi dove infilare la funzione?
Tra l’altro non ho capito cosa devo passargli nel campo exclude… il permalink?
-
20 Maggio 2011 alle 17:36 #84820TittiModeratore
1) si vede che non hai scritto correttamente
2) nel campo exclude devi mettere gli ID delle pagine che vuoi escludere dal menu (vai in “Pagine” appoggia il mouse sul titolo e nella barra inferiore dove appare l’URL c’è l’ID, è il numero dopo post=)
3) quando si scrive del codice basta anche solo un apice sbagliato o una mancata chiusura per sballare tutto, o un copia-incolla su un editor non adatto che aggiunge formattazione
Inoltre quegli altri file (ad es. header-custom.php, che direi serve per personalizzare l’header) possono in qualche modo contare con quella funzione
Se vuoi mettere il pezzo di codice fallo qua: http://pastebin.com/ e poi qui inserisci solo il link, però prima magari riprova editando il codice sul blocco note con attenzione e completo di tutte le cose che sono state dette
P.S. spero che tu prima faccia copia del file che vai a modificare
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.