" . $year . "
";
- }
-
- // Now that your year has been printed, assign it to the $year_check variable
- $year_check = $year;
+ // Assign the year to a variable
+ $year = get_the_date('Y', '', '', FALSE);
+ $year_link = get_year_link($year);
+
+ // If your year hasn't been echoed earlier in the loop, echo it now
+ if (! isset($year_check) || $year !== $year_check) {
+ echo "
" . $year . "
";
+ }
+
+ // Now that your year has been printed, assign it to the $year_check variable
+ $year_check = $year;
?>
+ (int) $suggested_posts_count,
+ 'orderby' => 'rand'
+ ));
+
+ if ( !empty($random_posts) ) :
+ foreach ( $random_posts as $post ) :
+ setup_postdata( $post );
+ ?>
+
+
+
+
+ No suggestions available.';
+ endif;
+ ?>
+