web/wp-content/themes/IRI-Theme/functions.php
changeset 194 32102edaa81b
parent 192 ad0cebafc06f
equal deleted inserted replaced
193:2f6f6f7551ca 194:32102edaa81b
     1 <?php
     1 <?php
     2 
       
     3 function theme_init(){
     2 function theme_init(){
     4 	if (class_exists('xili_language')) {
     3 	   load_theme_textdomain('IriTheme', get_template_directory() . '/language');	
     5 		define('THEME_TEXTDOMAIN','IriTheme');
     4 }
     6 		define('THEME_LANGS_FOLDER','/language');
     5 
     7 	} else {
       
     8 	   load_theme_textdomain('IriTheme', get_template_directory() . '/languages');	
       
     9 	}	
       
    10 }
       
    11 add_action ('init', 'theme_init');
     6 add_action ('init', 'theme_init');
    12 
     7 
    13 
     8 
    14 //
     9 //
    15 define('THEME_TEXTDOMAIN','IriTheme');
    10 define('THEME_TEXTDOMAIN','IriTheme');
   357 function dp_list_categories($Eparam='') {
   352 function dp_list_categories($Eparam='') {
   358 
   353 
   359 	if (class_exists('xili_language')) {
   354 	if (class_exists('xili_language')) {
   360 		$current_lang = the_cur_lang_dir();
   355 		$current_lang = the_cur_lang_dir();
   361 	}
   356 	}
   362 	
   357 	$args=array(
   363 	$categories = get_categories('hide_empty=1'.$Eparam);
   358 	  'orderby' => 'name',
       
   359 	  'order' => 'ASC',
       
   360 	  'hide_empty'=>'1',
       
   361 	  'exclude'=>'1,8,16,17,38,171,169,170'
       
   362 	  );
       
   363 	$categories = get_categories($args);
   364 	$first = true;
   364 	$first = true;
   365 	$count = 0;
   365 	$count = 0;
   366 	
   366 	
   367 	foreach ($categories as $category) {
   367 	foreach ($categories as $category) {
   368 
   368 
   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=30&order=DSC&orderby=date&category='.$category->cat_ID);//
   380 			$category_posts = get_posts('numberposts=30&order=ASC&orderby=title&category='.$category->cat_ID);//
   381 			$count2 = 0;
   381 			$count2 = 0;
   382 			
   382 			
   383 			//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   383 			//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   384 			// A REECRIRE PAS PROPRE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   384 			// A REECRIRE PAS PROPRE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   385 			
   385 			
   810 	else :
   810 	else :
   811 		$img_arr = false;
   811 		$img_arr = false;
   812 	endif;
   812 	endif;
   813 	return $img_arr;
   813 	return $img_arr;
   814 }
   814 }
   815 
       
   816 ?>
   815 ?>