Multiselect Preview

This topic contains 5 replies, has 2 voices, and was last updated by  brandtastic 9 years, 1 month ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #37748

    brandtastic
    Buyer
    Post count: 8

    Hi there,

    Am working on a very custom site using WP Geodirectory. I’ve added a few multiselect fields, and on a published place, they work absolutely fine, but on the preview page, they’re just outputting ‘array’.

    The code I’m using is just

    <?php echo $post->geodir_age_group; ?>

    As I say, this outputs all the values (i.e. 6-10, 11-15) on a published page, but on the preview (i.e. when a user fills out the form and goes to publish their place) only ‘array’ is output

    Any help is more than welcome!

    #37776

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    if you add that code, the preview page won’t be able to show them, cause they are not saved yet in the db… but in a session.

    Why not adding them to detail page using default options?

    Let us know,

    Thanks

    #37781

    brandtastic
    Buyer
    Post count: 8

    Hi Paolo,

    How would I go about doing that?

    Thanks
    Ben

    #37800

    Paolo
    Site Admin
    Post count: 31206

    In every custom field you create you have options to show them in either the sidebar of the detail page or in the more info tab or even in their own tab.

    see image attached…

    #37859

    brandtastic
    Buyer
    Post count: 8

    Hi Paolo,

    Ah, I get you now! Sorry, but I’m not using the Geodirectory tab system. I’ve built a completely bespoke child theme. All I need is the code to pull in the data.

    Cheers
    Ben

    #37872

    brandtastic
    Buyer
    Post count: 8

    Hi Paolo,

    Just to let you know that I’ve worked this out now!
    For anyone interested:

    
    
    <?php 
        $ages = $post->geodir_age_group;
        foreach($ages as $age) {
            echo '' . $age . ' ';
        }
    ?>
Viewing 6 posts - 1 through 6 (of 6 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket