Support

Account

Home Forums General Issues Need help placing get_field inside an array Reply To: Need help placing get_field inside an array

  • Hi @greghoffman

    You can store the field value in a variable and then pass this variable in your query like so:

    <?php 
    $value = get_field('field_name');
    $the_query = new WP_Query( 
    array( 
    ‘tag’ => $value,
    ’posts_per_page’ => 5 
    ) 
    ); 
    ?>