I managed to solve the problem in another way, the one you gave me did not work.
I noticed that the filter problem was related to the website URL, since it always had “index.php” to work, but the filters did not apply this value.
So I went to “settings” then “permalinks” and under “permalink structure” I changed it from “custom” to “standard” and it fixed it.