I need to wrap every 2 divs with another div for a project (a row) so it will look like:
Item
-
You should open and close your
in the books loop, and add a late check for odd books:
";
}
$book_name = $book['tag_name'];
$book_name_trim = str_replace(' ', '-', $book_name);
?>
";
$count = 0;
}
}
}
if ($count > 0)
{
echo "
";
}
?>
Doing so, your $count
variable will be incremented only when foreach($books AS $book)
loop is run (thus you have at least one book to print)