Order results of a view by a custom field then random with all the post with the custom field == true appears first, than all posts random and limit 8 results.
1 : custom field == true
2 : custom field == true
3 : custom field == false / Random ID
4 : custom field == false / Random ID
5 : custom field == false / Random ID
6 : custom field == false / Random ID
7 : custom field == false / Random ID
8 : custom field == false / Random ID
When I try it in views settings, only the custom field == true shows
When you write "custom field==true" and "custom field==false", what exactly do you mean?
That the custom field is a string and either has the string value "true" or the string value "false"?
If instead you mean that for custom field==false the custom field has no value, then it is expected that such results are excluded from the results (screenshot).
That is how WordPress queries work (it's actually how the underlying mySQL query works).
If you order by some field, then only posts that actually have a value for that field will be returned. If you want them to be included in the results, you must give them some value.
"custom field==true" and "custom field==false"
was an example, in my case it's :
wpcf-f-promote
this field is a checkbox 1 if check / 0 if not
If instead you mean that for custom field==false the custom field has no value, then it is expected that such results are excluded from the results (screenshot).
>>> Meaning, 0 seems not to be stored ?
>>> Ok right ! That's a new field, so the old post don't have a value for that field. I have to update all post.
I will try to update all post and keep you informed
Checking on this ticket here, happy to see that it is now working, however no we do not have a method for you to be able to update all your posts with a 0 value.
You will need to go through the posts and update them individually so that the custom field meta is stored in the database.