Okay, so I have this confusing problem with a string. I'm using a loop to construct the string, and I use print_r($exclude)
to see the result. The output of the string is:
101,102,135
... which is correct. Then I'm trying to use $exclude
in an argument-array for a WordPress-query:
'terms' => array($exclude),
In short this should exclude posts from the categories with ID's mentioned above. But this does not work as intended. Unless if I write the numbers directly like this, it works:
'terms' => array(101,102,135),
So what is the difference between the $exclude
-string and writing the numbers manually...!?