Hi Miz.Michele,
Ok, I see why this is confusing. In my modified version of the plugin, I’ve combined all the foreach statements into one, thus deleting the whole breakdown into sections by date.
Now that I’m looking at the original code more closely, I realize that my “simple” instructions are not so simple.
The first foreach that starts on line 280 foreach ( $items as $item ):
is used just to define the names and date ranges of each statement. Skip down to the next one at line 299 that begins foreach ( $items_today as $item ) {
That’s what interests us.
Ok, now that we know where we are, let me start over. At this point you should be able to see the series of 4 loops, embedded within an “if” statement :
if ( !empty( $items_today ) ) {
echo $date_before . 'Today' . $date_after;
echo $links_before;
foreach ( $items_today as $item ) {
if ( !empty( $items_yesterday ) ) {
echo $date_before . 'Yesterday' . $date_after;
echo $links_before;
foreach ( $items_yesterday as $item ) {
if ( !empty( $items_two_days_ago ) ) {
echo $date_before . '2 days ago' . $date_after;
echo $links_before;
foreach ( $items_two_days_ago as $item ) {
if ( !empty( $items_older ) ) {
echo $date_before . 'More than 2 days ago' . $date_after;
echo $links_before;
foreach ( $items_older as $item ) {
BEFORE the foreach line for all 4, ADD $feedlimit = $limit; //call variable
AFTER the foreach line for all 4, ADD $counter++; //add counter
At the end of each of the 4, AFTER the line echo $link_after;
, ADD if($counter >= $feedlimit) break; //break if count is met
HOWEVER, keep in mind that with this set up, there is only one variable, which means each section has to have the same limit. You could only define some of the sections, or you could add variables, like LIMIT2days, LIMITyesterday, etc.
Or, like me, you could get rid of the sections and have one solid feed. Up to you ??
Hope that helps!
-jennyb