Home Forums Front-end Issues Select – multiple but with word before


Select – multiple but with word before

  • I am using select field and have multiple.

    I’ve used the implode to show all that’s been selected;

    $cat = get_field('categories', $post_id);
    <?php echo implode(' ', $cat); ?>

    and I want to add “category-” in front of each outputted select field, but can’t work out how?????

    <?php echo 'category-',implode(' category-', $cat); ?>
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.