views:

12

answers:

1

hi guys, today i solve the problem, how to show posts categories by month

like as following url:

http://www.onlinescratchcards.me.uk/blog/

A: 

just copy it to your php page and,

Have Fun !

the script:

for($year1=$current_date;$year1>=2005;$year1--){ $arr_years[]=$year1; }

$tags = get_categories('orderby=id&exclude=1'); foreach ($tags as $tag) { $i=0; echo " " . 'term_id) . '> ' . $tag->cat_name . ' ';

foreach ((array) $arr_years as $years ) {

$posts2 = get_posts('category='. $tag->cat_ID . '&numberposts=400' . '&year=' . $years . 'orderby=date&order=asc' );

//----get years---- if($years!=null && $posts2 ){ foreach ((array) $mounts as $mon ) { $posts = get_posts('category='. $tag->cat_ID . '&numberposts=400' . '&monthnum=' . $mon . '&year=' . $years . '&order=asc' ); if($mon!=null && $posts){ echo " "; if($mon==1) echo " January"; if($mon==2) echo " February" ; if($mon==3) echo " March" ; if($mon==4) echo " April" ; if($mon==5) echo "May" ; if($mon==6) echo " June" ; if($mon==7) echo "July" ;

if($mon==8) echo " August" ;

if($mon==9) echo "September" ;

if($mon==10) echo " October" ;

if($mon==11) echo "November" ;

if($mon==12) echo "December" ; echo " " . $years . " " ;

foreach ($posts as $post ) { ?>

" rel="bookmark" title="">

}//end foreach posts

}//the check posts

}//end foreach array }//end foreach for dates }//end (if date) }//begin first foreach echo "made Byy Roi Sabahhh !!! "; the_post();

// madeeee Byy Roi Sabahhh !!! ! // for comment and qustions you can send me email to: [email protected] ?>

Thanks

ROI