web/wp-content/themes/IRI-Theme/functions.php
changeset 180 d8780eeb2607
parent 170 8e3a5a6fc63e
child 192 ad0cebafc06f
equal deleted inserted replaced
179:cd4c37c65a2c 180:d8780eeb2607
   375 			} else {
   375 			} else {
   376 				echo ('<a href="'.get_category_link($category->cat_ID).'">'.__($category->name,'IriTheme').' </a>');
   376 				echo ('<a href="'.get_category_link($category->cat_ID).'">'.__($category->name,'IriTheme').' </a>');
   377 			}
   377 			}
   378 			echo '<ul>';
   378 			echo '<ul>';
   379 			
   379 			
   380 			$category_posts = get_posts('numberposts=15&order=ASC&orderby=parent&category='.$category->cat_ID);
   380 			$category_posts = get_posts('numberposts=30&order=DSC&orderby=date&category='.$category->cat_ID);//
   381 			$count2 = 0;
   381 			$count2 = 0;
   382 			/*$categoryN2 = get_category_link($category->cat_ID);
   382 			/*$categoryN2 = get_category_link($category->cat_ID);
   383 			
   383 			
   384 					foreach($categoryN2 as $catN2) {
   384 					foreach($categoryN2 as $catN2) {
   385 						
   385 						
   393 						
   393 						
   394 						if (class_exists('xili_language')) {
   394 						if (class_exists('xili_language')) {
   395 								// Affiche les posts de la langue courante + les indéfinis 
   395 								// Affiche les posts de la langue courante + les indéfinis 
   396 								//if (get_cur_language($post->ID)==$current_lang['lang'] or get_cur_language($post->ID)==""){
   396 								//if (get_cur_language($post->ID)==$current_lang['lang'] or get_cur_language($post->ID)==""){
   397 								// Affiche seulement les posts  de la langue courante + les indéfinis 
   397 								// Affiche seulement les posts  de la langue courante + les indéfinis 
       
   398 								//echo ("<div> ID = ".$post->ID." : ".get_cur_language($post->ID)."</div>");
   398 							if (get_cur_language($post->ID)==$current_lang['lang']){
   399 							if (get_cur_language($post->ID)==$current_lang['lang']){
   399 								
   400 								
   400 								// gestion des niv 2 ajout de class si nécessaire
   401 								// gestion des niv 2 ajout de class si nécessaire
   401 								$MyCategoryPost = get_the_category($post->ID);
   402 								$MyCategoryPost = get_the_category($post->ID);
   402 								//var_dump($MyCategoryPost);
   403 								//var_dump($MyCategoryPost);
   403 
   404 								
       
   405 								//echo ("<div> MyC:".count($MyCategoryPost)."</div>");
   404 								$MoreStyle="";
   406 								$MoreStyle="";
   405 								$title ="";
   407 								$title ="";
   406 								if (count($MyCategoryPost)>1){
   408 								if (count($MyCategoryPost)>1){
   407 										foreach($MyCategoryPost as $MyCategory) { 
   409 										foreach($MyCategoryPost as $MyCategory) { 
   408 											$MoreStyle.= " ".$MyCategory->category_nicename;
   410 												$MoreStyle.= $MyCategory->category_nicename." ";
   409 											$title.= " ".$MyCategory->category_nicename;
   411 												$title.= $MyCategory->category_nicename." ";
   410 											//category_parent!=0
   412 											//category_parent!=0
   411 										} 							
   413 										} 							
   412 								} else {
   414 								} else {
   413 								$MoreStyle ="menu-h-li2";
   415 									$MoreStyle ="menu-h-li2";
   414 								}
   416 								}
   415 								
   417 								
   416 								echo '<li class="'.$MoreStyle.'" title="'.cache_cutter($post->post_title)." : ".$MoreStyle.'"><a href="'.get_permalink($post->ID).'">'.text_cutter($post->post_title,200).'</a></li>';
   418 								echo '<li class="'.$MoreStyle.'" title="'.cache_cutter($post->post_title)." : ".$MoreStyle.'"><a href="'.get_permalink($post->ID).'" class="'.$MoreStyle.'" >'.text_cutter($post->post_title,200).'</a></li>';
   417 								$count2++; //if ($count2>6) break;
   419 								$count2++; //if ($count2>6) break;
   418 							}
   420 							}
   419 							
   421 							
   420 						} else {
   422 						} else {
   421 						
   423