I need to put an advanced custom field value (category number) from page to query_posts array. Is it somehow possible?
On a single page I’m trying to show posts from category, which number is value of this custom field.
Ideal and of course non-functional case:
query_posts(array('category__and'=>array( the_field("category"); ,99), 'posts_per_page'=>6));
the_field()
displays a meta value. You’ll want to useget_field()
(which returns a meta value) instead:In somewhat unrelated news, you should really consider avoiding the use of
query_posts
.