Home › Forum › Problemi Vari con WP › Mostrare articoli solo di una determinata categoria tramite un pulsante
-
AutorePost
-
-
13 Agosto 2011 alle 13:09 #18864smartmousePartecipante
Salve, nel mio sito c’è nell’header una barra di navigazione, in cui c’è un pulsante “Home” e altri che si possono inserire creando pagine in WordPress.
Ecco il codice del file header.php
<div id="navbar">
<ul class="menu">
<li class="<?php if ( is_home() ) { ?>current_page_item<?php } else { ?>page_item<?php } ?>"><a href="<?php echo get_settings('home'); ?>"><?php _e('Home'); ?></a></li>
<?php wp_list_pages('sort_column=id&depth=1&title_li='); ?>
</ul>Quello che vorrei fare è aggiungere 2 pulsanti dopo quello “Home” e prima delle pagine (chiamate dalla funziona wp_list_pages).
Il primo pulsante dovra visualizzare tutti gli articoli del blog, cosଠcome compaiono nella home, solo che deve escludere i post di una determinata categoria.
Il secondo pulsante dovrà invece visualizzare solo gli articoli della categoria esclusa con il primo pulsante.
Non ho proprio idea di come si possa fare, spero nel vostro aiuto.
Grazie.
-
17 Agosto 2011 alle 23:05 #87618smartmousePartecipante
Magari posso farlo da solo, siete in grado di dirmi cosa fa esattamente questa riga di codice:
<li class="<?php if ( is_home() ) { ?>current_page_item<?php } else { ?>page_item<?php } ?>"><a href="<?php echo get_settings('home'); ?>"><?php _e('Home'); ?></a></li>
Grazie.
-
17 Agosto 2011 alle 23:25 #87620HotWutPartecipante
scusa ma che tpl hai?
link del sito?
-
18 Agosto 2011 alle 13:59 #87633smartmousePartecipante
Il link al sito è mym*viesbl*g.it (* = o).
Grazie.
-
22 Agosto 2011 alle 23:33 #87723smartmousePartecipante
Cos’ha il template che non ha? E per via della funzione get_settings che risulta essere non più utilizzata da WordPress?
-
2 Settembre 2011 alle 23:40 #87920smartmousePartecipante
Salve di nuovo, ho risolto il mio problema con questo http://codex.wordpress.org/Navigation_Menus.
Ho creato un menu nell’header con i seguenti pulsanti:
– Home
– News
– Info
Il primo bottone l’ho creato aggiungendo un link alla home page del sito. Il secondo pulsante l’ho creato aggiungendo la categoria “News”. Infine il testo l’ho linkato alla pagina “Info”.
Ora vorrei creare un altro pulsante che mostri tutti i post di tutte le categorie, eccetto quelli della categoria “News”.
Come posso fare?
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.