SHOW:
|
|
- or go back to the newest paste.
| 1 | <div id="rightsidebar" class="column"> | |
| 2 | <ul> | |
| 3 | <li> | |
| 4 | <h2 class="motore">Motore di ricerca interno</h2> | |
| 5 | <form method="get" id="searchform" action='<?php echo bloginfo("home");?>' >
| |
| 6 | <div><label class="screen-reader-text" for="s">Cerca:</label> | |
| 7 | <input type="text" value="" name="s" id="s" /> | |
| 8 | <input type="submit" id="searchsubmit" value="Cerca" /> | |
| 9 | </div> | |
| 10 | </form> | |
| 11 | </li> | |
| 12 | <?php | |
| 13 | ||
| 14 | if (is_single ()) {
| |
| 15 | ||
| 16 | $tags = wp_get_post_tags($post->ID); | |
| 17 | if ($tags) {
| |
| 18 | $tag_ids = array(); | |
| 19 | foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id; | |
| 20 | $args=array('tag__in' => $tag_ids,
| |
| 21 | 'post__not_in' => array($post->ID), | |
| 22 | 'showposts'=>3, // Number of related posts that will be shown. | |
| 23 | 'caller_get_posts'=>1); | |
| 24 | $my_query = new wp_query($args); | |
| 25 | if( $my_query->have_posts() ) {
| |
| 26 | echo '<li><h2 class="widgettitle">Articoli correlati</h2><ul>'; | |
| 27 | while ($my_query->have_posts()) {
| |
| 28 | $my_query->the_post(); | |
| 29 | ?> | |
| 30 | <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li> | |
| 31 | <?php | |
| 32 | } | |
| 33 | echo '</ul></li>'; | |
| 34 | } | |
| 35 | } | |
| 36 | } | |
| 37 | ||
| 38 | if (is_front_page ()||is_home ()) {
| |
| 39 | ?> | |
| 40 | <li> | |
| 41 | <h2>Calendario eventi</h2> | |
| 42 | <?php ec3_get_calendar() ?> | |
| 43 | </li> | |
| 44 | <?php | |
| 45 | if ( function_exists('dynamic_sidebar') && dynamic_sidebar(2) ) : endif;
| |
| 46 | } | |
| 47 | ||
| 48 | if (is_page () and !is_front_page ()){
| |
| 49 | $post->ID=$IdPagina; | |
| 50 | $post->post_title=$TitoloPagina; | |
| 51 | if ( function_exists('dynamic_sidebar') && dynamic_sidebar(2) ) : endif;
| |
| 52 | } | |
| 53 | if (is_category ()||is_archive () || is_page() ) {
| |
| 54 | //verifica se � una categoria | |
| 55 | if (isset($_GET['catid']) && !empty($_GET['catid'])) {
| |
| 56 | $catid = $_GET['catid']; | |
| 57 | }else{
| |
| 58 | $catid = $categoria_pagina; | |
| 59 | } | |
| 60 | if (!isset($catid)) {
| |
| 61 | $categoria = get_the_category(); | |
| 62 | $catid1 = $categoria[0]->cat_ID; | |
| 63 | $catid = get_query_var('cat');
| |
| 64 | } | |
| 65 | //echo($catid); | |
| 66 | $categoryname = get_cat_name($catid) . " "; | |
| 67 | $category = "catid=".$catid; | |
| 68 | $obj_cat = get_category ($catid); | |
| 69 | //echo(is_archive()?'è archivio':'non è archivio'); | |
| 70 | if (is_category()||is_archive()||is_tag()||is_page_template('page4miur.php')) {
| |
| 71 | if(isset($catid)) {
| |
| 72 | $cat = get_category($catid); | |
| 73 | $parent = $cat->category_parent; | |
| 74 | //echo('cat is: ' . $catid . ' parent is: ' . $parent.'<br />');
| |
| 75 | $querystr = "SELECT wpostmeta.post_id | |
| 76 | FROM $wpdb->postmeta wpostmeta | |
| 77 | WHERE wpostmeta.meta_key = 'categoria' | |
| 78 | AND wpostmeta.meta_value = '". $catid ."'"; | |
| 79 | $name = $wpdb->get_var($querystr); | |
| 80 | //echo $querystr . " --> "; | |
| 81 | //echo $name; | |
| 82 | $post_id = get_post($name); | |
| 83 | $title = $post_id->post_title; | |
| 84 | $url = get_permalink($name); | |
| 85 | //echo(is_category()?' E una categoria':'non E una categoria'); | |
| 86 | //echo(is_tag()?' E un TAG':'non E un TAG'); | |
| 87 | if(!is_category() and !is_archive()){
| |
| 88 | echo '<li><h2 class="widgettitle"><a href="'.$url. '">'.$title.'</a></h2><ul>'; | |
| 89 | wp_list_pages('&title_li=&child_of='.$name);
| |
| 90 | // qui dobbiamo aggiungere la chiusura del ul e del li aggiunto due righe sopra :) -- ronny | |
| 91 | // 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 | |
| 92 | echo '</ul></li>'; | |
| 93 | } | |
| 94 | } | |
| 95 | } | |
| 96 | } | |
| 97 | ||
| 98 | if (!empty($catid)) {
| |
| 99 | ?> | |
| 100 | <!-- Inizio Modifica Tutti gli articoli della categoria --> | |
| 101 | <li> | |
| 102 | <h2 class="widgettitle">Categoria <?php echo $categoryname?></h2> | |
| 103 | <ul> | |
| 104 | <li> | |
| 105 | MODIFICA----->>>> <a href="<?php echo bloginfo( "url" )."/index.php/".$obj_cat->slug.'/?q=tutti';?>" >Tutti gli articoli</a> | |
| 106 | - | TRA LE VIRGOLETTE AL POSTO DEL SOLO "/" HO AGGIUNTO "/index.php/" |
| 106 | + | TRA LE VIRGOLETTE AL POSTO DEL SOLO "/" HO MODIFICATO IN "/index.php/" |
| 107 | </li> | |
| 108 | </ul> | |
| 109 | </li> | |
| 110 | <!--Fine Modifica tutti gli articoli della categoria --> | |
| 111 | ||
| 112 | ||
| 113 | ||
| 114 | ||
| 115 | ||
| 116 | <li> | |
| 117 | ||
| 118 | ||
| 119 | <h2 class="widgettitle">Archivio <?php echo date('Y')?></h2>
| |
| 120 | ||
| 121 | ||
| 122 | <ul> | |
| 123 | ||
| 124 | ||
| 125 | <?php | |
| 126 | ||
| 127 | ||
| 128 | //echo $category.'&limit='.date("m");
| |
| 129 | ||
| 130 | ||
| 131 | //wp_get_archives($category.'&limit='.date("m"));
| |
| 132 | ||
| 133 | $archivio_anno = wpit_archivio_anno_corrente ( $category ); | |
| 134 | ||
| 135 | echo $archivio_anno; | |
| 136 | ||
| 137 | //add_filter ('getarchives_where','archivi_anno_corrente');
| |
| 138 | // | |
| 139 | // | |
| 140 | //wp_get_archives($category); | |
| 141 | // | |
| 142 | // | |
| 143 | //remove_filter ('getarchives_where','archivi_anno_corrente');
| |
| 144 | // | |
| 145 | ||
| 146 | ?> | |
| 147 | ||
| 148 | ||
| 149 | </ul> | |
| 150 | ||
| 151 | ||
| 152 | </li> | |
| 153 | <?php $archivio_anni = wpit_archivio_anni ( $category ); | |
| 154 | ||
| 155 | if (!empty($archivio_anni)) { ?>
| |
| 156 | ||
| 157 | <li> | |
| 158 | ||
| 159 | ||
| 160 | <h2 class="widgettitle">Archivio per anni</h2> | |
| 161 | ||
| 162 | ||
| 163 | <ul> | |
| 164 | ||
| 165 | ||
| 166 | <?php | |
| 167 | ||
| 168 | ||
| 169 | echo $archivio_anni ; | |
| 170 | ||
| 171 | //add_filter ('getarchives_where','escludi_archivi_anno_corrente');
| |
| 172 | // | |
| 173 | // | |
| 174 | //wp_get_archives($category.'&type=yearly'); | |
| 175 | // | |
| 176 | // | |
| 177 | // remove_filter ('getarchives_where','escludi_archivi_anno_corrente');
| |
| 178 | ||
| 179 | ||
| 180 | ?> | |
| 181 | ||
| 182 | ||
| 183 | </ul> | |
| 184 | ||
| 185 | ||
| 186 | </li> | |
| 187 | ||
| 188 | <?php } ?> | |
| 189 | <?php | |
| 190 | } | |
| 191 | //echo 'orderby=id&show_count=1&use_desc_for_title=0&child_of='.$_GET['catid']; | |
| 192 | if (!empty($catid)) {
| |
| 193 | wp_list_categories('title_li=<h2 class="widgettitle">Categorie</h2>&orderby=id&child_of='.$catid);
| |
| 194 | } | |
| 195 | if (!empty($blogroll)) {
| |
| 196 | wp_list_bookmarks('&categorize=0&category='.$blogroll. '&orderby=order&category_orderby=order');
| |
| 197 | } | |
| 198 | if (!empty($boxdestra)) {
| |
| 199 | echo $boxdestra; | |
| 200 | } | |
| 201 | ||
| 202 | if (is_front_page ()||is_home ()) {
| |
| 203 | if ( function_exists('wp_tag_cloud') ) :
| |
| 204 | ?> | |
| 205 | <li> | |
| 206 | <h2>Argomenti più popolari</h2> | |
| 207 | <?php wp_tag_cloud('smallest=8&largest=12&number=14&format=list'); ?>
| |
| 208 | </li> | |
| 209 | <?php | |
| 210 | endif; | |
| 211 | } | |
| 212 | ?> | |
| 213 | </ul> | |
| 214 | </div> |