Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="rightsidebar" class="column">
- <ul>
- <li>
- <h2 class="motore">Motore di ricerca interno</h2>
- <form method="get" id="searchform" action='<?php echo bloginfo("home");?>' >
- <div><label class="screen-reader-text" for="s">Cerca:</label>
- <input type="text" value="" name="s" id="s" />
- <input type="submit" id="searchsubmit" value="Cerca" />
- </div>
- </form>
- </li>
- <?php
- if (is_single ()) {
- $tags = wp_get_post_tags($post->ID);
- if ($tags) {
- $tag_ids = array();
- foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
- $args=array('tag__in' => $tag_ids,
- 'post__not_in' => array($post->ID),
- 'showposts'=>3, // Number of related posts that will be shown.
- 'caller_get_posts'=>1);
- $my_query = new wp_query($args);
- if( $my_query->have_posts() ) {
- echo '<li><h2 class="widgettitle">Articoli correlati</h2><ul>';
- while ($my_query->have_posts()) {
- $my_query->the_post();
- ?>
- <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
- <?php
- }
- echo '</ul></li>';
- }
- }
- }
- if (is_front_page ()||is_home ()) {
- ?>
- <li>
- <h2>Calendario eventi</h2>
- <?php ec3_get_calendar() ?>
- </li>
- <?php
- if ( function_exists('dynamic_sidebar') && dynamic_sidebar(2) ) : endif;
- }
- if (is_page () and !is_front_page ()){
- $post->ID=$IdPagina;
- $post->post_title=$TitoloPagina;
- if ( function_exists('dynamic_sidebar') && dynamic_sidebar(2) ) : endif;
- }
- if (is_category ()||is_archive () || is_page() ) {
- //verifica se � una categoria
- if (isset($_GET['catid']) && !empty($_GET['catid'])) {
- $catid = $_GET['catid'];
- }else{
- $catid = $categoria_pagina;
- }
- if (!isset($catid)) {
- $categoria = get_the_category();
- $catid1 = $categoria[0]->cat_ID;
- $catid = get_query_var('cat');
- }
- //echo($catid);
- $categoryname = get_cat_name($catid) . " ";
- $category = "catid=".$catid;
- $obj_cat = get_category ($catid);
- //echo(is_archive()?'è archivio':'non è archivio');
- if (is_category()||is_archive()||is_tag()||is_page_template('page4miur.php')) {
- if(isset($catid)) {
- $cat = get_category($catid);
- $parent = $cat->category_parent;
- //echo('cat is: ' . $catid . ' parent is: ' . $parent.'<br />');
- $querystr = "SELECT wpostmeta.post_id
- FROM $wpdb->postmeta wpostmeta
- WHERE wpostmeta.meta_key = 'categoria'
- AND wpostmeta.meta_value = '". $catid ."'";
- $name = $wpdb->get_var($querystr);
- //echo $querystr . " --> ";
- //echo $name;
- $post_id = get_post($name);
- $title = $post_id->post_title;
- $url = get_permalink($name);
- //echo(is_category()?' E una categoria':'non E una categoria');
- //echo(is_tag()?' E un TAG':'non E un TAG');
- if(!is_category() and !is_archive()){
- echo '<li><h2 class="widgettitle"><a href="'.$url. '">'.$title.'</a></h2><ul>';
- wp_list_pages('&title_li=&child_of='.$name);
- // qui dobbiamo aggiungere la chiusura del ul e del li aggiunto due righe sopra :) -- ronny
- // da notare che qui se fai la validazione ti da errore se non ci sono pagine listate perche apre e chiude un ul senza metterci dentro nulla -- ronny
- echo '</ul></li>';
- }
- }
- }
- }
- if (!empty($catid)) {
- ?>
- <!-- Inizio Modifica Tutti gli articoli della categoria -->
- <li>
- <h2 class="widgettitle">Categoria <?php echo $categoryname?></h2>
- <ul>
- <li>
- MODIFICA----->>>> <a href="<?php echo bloginfo( "url" )."/index.php/".$obj_cat->slug.'/?q=tutti';?>" >Tutti gli articoli</a>
- TRA LE VIRGOLETTE AL POSTO DEL SOLO "/" HO MODIFICATO IN "/index.php/"
- </li>
- </ul>
- </li>
- <!--Fine Modifica tutti gli articoli della categoria -->
- <li>
- <h2 class="widgettitle">Archivio <?php echo date('Y')?></h2>
- <ul>
- <?php
- //echo $category.'&limit='.date("m");
- //wp_get_archives($category.'&limit='.date("m"));
- $archivio_anno = wpit_archivio_anno_corrente ( $category );
- echo $archivio_anno;
- //add_filter ('getarchives_where','archivi_anno_corrente');
- //
- //
- //wp_get_archives($category);
- //
- //
- //remove_filter ('getarchives_where','archivi_anno_corrente');
- //
- ?>
- </ul>
- </li>
- <?php $archivio_anni = wpit_archivio_anni ( $category );
- if (!empty($archivio_anni)) { ?>
- <li>
- <h2 class="widgettitle">Archivio per anni</h2>
- <ul>
- <?php
- echo $archivio_anni ;
- //add_filter ('getarchives_where','escludi_archivi_anno_corrente');
- //
- //
- //wp_get_archives($category.'&type=yearly');
- //
- //
- // remove_filter ('getarchives_where','escludi_archivi_anno_corrente');
- ?>
- </ul>
- </li>
- <?php } ?>
- <?php
- }
- //echo 'orderby=id&show_count=1&use_desc_for_title=0&child_of='.$_GET['catid'];
- if (!empty($catid)) {
- wp_list_categories('title_li=<h2 class="widgettitle">Categorie</h2>&orderby=id&child_of='.$catid);
- }
- if (!empty($blogroll)) {
- wp_list_bookmarks('&categorize=0&category='.$blogroll. '&orderby=order&category_orderby=order');
- }
- if (!empty($boxdestra)) {
- echo $boxdestra;
- }
- if (is_front_page ()||is_home ()) {
- if ( function_exists('wp_tag_cloud') ) :
- ?>
- <li>
- <h2>Argomenti più popolari</h2>
- <?php wp_tag_cloud('smallest=8&largest=12&number=14&format=list'); ?>
- </li>
- <?php
- endif;
- }
- ?>
- </ul>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement