- Home
- Categorie
- Coding e Sistemistica
- CMS & Piattaforme Self-Hosted
- Menu a Discesa
- 
							
							
							
							
							Menu a DiscesaCiao a Tutti... uso WordPress 2.9.2, ma non ho ancora abbastanza confidenza.:x Ho creato delle **categorie **con sottocategorie, ma quando vado a controllare e chiedo la visualizzazione lato utente della **categoria, **mi viene visualizzato il contenuto (i vari post) delle varie sottocategorie inserite nella **categoria **tutte insieme. E' possibile visualizzare solo i nomi delle sottocategorie, e poi quando si fa il **click **sulla sottocategoria, gli eventuali **post **inseriti dentro la **sottocategoria **? Esempio: Categoria - sottocategoria
- sottocategoria 1
 
- sottocategoria 2
- sottocategoria 3
 
 In altre parole, volevo creare (oppure installare qualche plugin) per un **menù a discesa **della categoria. Il menù creato dal mio template è **verticale **a sinistra. Spero di aver reso l'idea.  è ringrazio per il prezioso aiuto. è ringrazio per il prezioso aiuto.Giorgio. 
 
- sottocategoria
- 
							
							
							
							
							
Intendi una cosa del genere http://www.w3cgallery.com/w3c-blog/wordpress-hack/wordpress-subcategories-as-dropdown-menu-by-css-help ? 
 
- 
							
							
							
							
							Grazie1000 geggiot per la risposta .... scusa ma mi sono spiegato male (:x): quando apro la ***categoria ***mi vengono elencati tutti i post presenti nelle sottocategorie. Io vorrei che mi venisse elencato solo il ***nome delle *****sottocategorie **e basta. Dopo con il link sul nome della sottocategoria è possibile visualizzare eventualmente i vari post. Ringrazio ancora dell'aiuto.  
 
- 
							
							
							
							
							
Ok ora ho capito allora devi modificare il codice del tuo template e inserire > <?php 
 if (is_category()) {
 $this_category = get_category($cat);
 }
 ?>
 <?php
 if($this_category->category_parent)
 $this_category = wp_list_categories('orderby=id&show_count=0
 &title_li=&use_desc_for_title=1&child_of='.$this_category->category_parent.
 "&echo=0"); else
 $this_category = wp_list_categories('orderby=id&depth=1&show_count=0
 &title_li=&use_desc_for_title=1&child_of='.$this_category->cat_ID.
 "&echo=0");
 if ($this_category) { ?>per mostrare la lista di sottocategorie dopo aver cliccato sulla categoria principale. 
 
- 
							
							
							
							
							Grazie **geggiot **..... perdona la mia ignoranza: a quale file devo effettuare la modifica ? Il file Archive.php del template è questo: <?php get_header(); ?> 
 <div class="art-content-layout">
 <div class="art-content-layout-row">
 <?php include (TEMPLATEPATH . '/sidebar1.php'); ?><div class="art-layout-cell art-content">
 <?php is_tag(); ?>
 <?php if (have_posts()) : ?>
 <div class="art-post">
 <div class="art-post-body">
 <div class="art-post-inner art-article">
 <div class="art-postcontent">
 <!-- article-content -->
 <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
 <?php /* If this is a category archive / if (is_category()) { ?>
 <h2 class="pagetitle"><?php printf(__('Categoria ?%s?', 'kubrick'), single_cat_title('', false)); ?></h2>
 <?php / If this is a tag archive / } elseif( is_tag() ) { ?>
 <h2 class="pagetitle"><?php printf(__('Posts Tagged ?%s?', 'kubrick'), single_tag_title('', false) ); ?></h2>
 <?php / If this is a daily archive / } elseif (is_day()) { ?>
 <h2 class="pagetitle"><?php printf(_c('Archive for %s|Daily archive page', 'kubrick'), get_the_time(__('F jS, Y', 'kubrick'))); ?></h2>
 <?php / If this is a monthly archive / } elseif (is_month()) { ?>
 <h2 class="pagetitle"><?php printf(_c('Archive for %s|Monthly archive page', 'kubrick'), get_the_time(__('F, Y', 'kubrick'))); ?></h2>
 <?php / If this is a yearly archive / } elseif (is_year()) { ?>
 <h2 class="pagetitle"><?php printf(_c('Archive for %s|Yearly archive page', 'kubrick'), get_the_time(__('Y', 'kubrick'))); ?></h2>
 <?php / If this is an author archive / } elseif (is_author()) { ?>
 <h2 class="pagetitle"><?php _e('Author Archive', 'kubrick'); ?></h2>
 <?php / If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
 <h2 class="pagetitle"><?php _e('Blog Archives', 'kubrick'); ?></h2>
 <?php } ?>
 <?php
 $prev_link = get_previous_posts_link(('Newer Entries »', 'kubrick'));
 $next_link = get_next_posts_link(('« Older Entries', 'kubrick'));
 ?>
 <?php if ($prev_link || $next_link): ?>
 <?php endif; ?>
 <!-- /article-content -->
 </div>
 <div class="cleared"></div>
 </div>
 <div class="cleared"></div>
 </div>
 </div>
 <?php while (have_posts()) : the_post(); ?>
 <div class="art-post">
 <div class="art-post-body">
 <div class="art-post-inner art-article">
 <h4 class="art-postheader">
 <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'kubrick'), the_title_attribute('echo=0')); ?>">
 <?php the_title(); ?>
 </a>
 </h4>
 <div class="art-postcontent">
 <!-- article-content --><?php if (is_page() or is_single()) wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> <!-- /article-content --></div> 
 <div class="cleared"></div>
 </div>
 <div class="cleared"></div>
 </div>
 </div>
 <?php endwhile; ?>
 <?php if ($prev_link || $next_link): ?>
 <div class="art-post">
 <div class="art-post-body">
 <div class="art-post-inner art-article">
 <div class="art-postcontent">
 <!-- article-content -->
 <div class="navigation">
 </div>
 <!-- /article-content -->
 </div>
 <div class="cleared"></div>
 </div>
 <div class="cleared"></div>
 </div>
 </div>
 <?php endif; ?>
 <?php else : ?>
 <div class="art-post">
 <div class="art-post-body">
 <div class="art-post-inner art-article">
 <div class="art-postcontent">
 <!-- article-content -->
 <?php
 if ( is_category() ) { // If this is a category archive
 printf("<h2 class='center'>".("Sorry, but there aren't any posts in the %s category yet.", "kubrick").'</h2>', single_cat_title('',false));
 } else if ( is_date() ) { // If this is a date archive
 echo('<h2>'.("Sorry, but there aren't any posts with this date.", "kubrick").'</h2>');
 } else if ( is_author() ) { // If this is a category archive
 $userdata = get_userdatabylogin(get_query_var('author_name'));
 printf("<h2 class='center'>".("Sorry, but there aren't any posts by %s yet.", "kubrick")."</h2>", $userdata->display_name);
 } else {
 echo("<h2 class='center'>".('No posts found.', 'kubrick').'</h2>');
 }
 if(function_exists('get_search_form')) get_search_form();
 ?>
 <!-- /article-content -->
 </div>
 <div class="cleared"></div>
 </div>
 <div class="cleared"></div>
 </div>
 </div>
 <?php endif; ?>
 </div>
 <?php include (TEMPLATEPATH . '/sidebar2.php'); ?>
 </div>
 </div>
 <div class="cleared"></div>
 <?php get_footer(); ?>Devo inserirlo in questo **file **? Sinceramente non ho proprio idea su come muovermi.  e grazie ancora .... e grazie ancora ....