Green Living Articles

[insert_php] global $wpdb; $years = array(); $items = $wpdb->get_results(“SELECT DISTINCT(YEAR(`date`)) as year FROM `green_articles` WHERE `show`=’y’ ORDER BY year desc”); foreach($items as $year) { print “year\”>$year->year
“; array_push($years, $year->year); } [/insert_php]

[insert_php] for($i=0; $i“; print ‘‘; $items = $wpdb->get_results(“SELECT subject,author,`date`,url,media FROM green_articles WHERE YEAR(`date`)=$year AND `show`=’y’ ORDER BY `date` desc”); foreach($items as $item) { $arr = preg_split(“/-/”, $item->date); $date = date(“F d, Y”, mktime(0, 0, 0, $arr[1], $arr[2], $arr[0])); print ““; print ““; print ““; print ““; print ““; print ‘‘; } } [/insert_php]
$year [ top ]
 
url\” target=_blank>$item->subject
$item->author, $item->media, $date