advanced custom fields - ACF Query meta_values don't work with 'offset'

admin2025-06-04  1

I am currently building a featured posts section and I'm using ACF to set which posts will be featured. As they're appear in another section, I want them to start in this query on the third post. However, if I use the query below, it doesn't return anything:

<?php query_posts(
  array(
    'post_type'      => 'custom',
    'posts_per_page' => '5',
    'offset'         => '2'
    'meta_query'     => array(
      array(
        'key'     => 'featured',
        'compare' => '==',
        'value'   => '1'
      )
    )
  )
); ?>

It works with the offset or the meta_query, but not with both of them. Does anyone know how to address this issue?

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749000316a315506.html

最新回复(0)