I'm facing a weird issue trying to do what I'm going to explain now.
Context
Plugins I'm using: Custom Post Type UI / Advanced Custom Fields Functionality: I have a custom post type called "vendors". Within this post type I have several custom fields made on ACF. One of these fields is Called "Promote to Homepage" which is set as a checkbox. So the idea is simple, if that checkbox is checked show that post on the homepage.
So this seemed to work fine, but when I tried to change that "Highlighted Vendor" to another one (unchecked current, checked desired to avoid conflicts I found that the post I was setting as featured wasn't showing, nothing was shown.
I started testing then trying with other vendor posts, to find that this behavior is completely random, some of them published correctly to homepage, some others not. I tried to find out a pattern to identify what might be causing it and failed. Also tried to replicate the settings of a vendor that was failing to publish within a vendor that was publishing fine, and even setting the exact same things the vendor was still publishing.
Finally I should mention that I have a page where I'm listing some kind of "directory" where all vendors are being shown. I added a simple code to check if the "promote_to_homepage" output was correct, something like "if the checkbox is checked, say hi" and found that the posts that aren't showing on homepage, pass the test on directory page.
I'm running out of ideas about what this could be, that's why I'm trying here if someone can bring me some help.
The code I'm using in the homepage is simple:
<?php query_posts('post_type=vendors');
while (have_posts()):the_post();
$featured = get_field('promote_to_homepage', $post -> ID, true);
if ($featured){?><!-- show the content here -->
<?php }; endwhile; ?>
That's all.
Thanks in advance to anyone that can help me on this.
Juan.-