Your query returns only one result because you have enclosed both values into the single quotes. So your query looks like this
SELECT * FROM post WHERE id IN ('1, 2') ORDER BY date DESC
And it should look like this
SELECT * FROM post WHERE id IN (1,2) ORDER BY date DESC
If you run your initial query in mysql console, it'll probably show you a warning
mysql> select cast('1,2' as unsigned);
+-------------------------+
| cast('1,2' as unsigned) |
+-------------------------+
| 1 |
+-------------------------+
1 row in set, 1 warning (0.01 sec)
mysql> show warnings;
+---------+------+------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------+
| Warning | 1292 | Truncated incorrect INTEGER value: '1,2' |
+---------+------+------------------------------------------+
1 row in set (0.00 sec)
mysql>
To fix it, I suggest the following code
$ids = [1,2];
$ids_string = implode(',',$ids);
$sql="SELECT * FROM post WHERE id IN ($ids_string) ORDER BY date DESC";
1,2— but I guess MySQL's lax type conversion strikes again.