Support

Account

Home Forums General Issues the_field not working in a template Reply To: the_field not working in a template

  • Try this:

    <?php
    $cat = get_the_field('artist_news');
    $recentposts=get_posts('showposts=3&category=$cat');
    ?>

    Not exactly sure how WordPress functions handle variables inside of strings like that so you might need to do this:

    <?php
    $cat = get_the_field('artist_news');
    $recentposts=get_posts('showposts=3&category=' . $cat);
    ?>