Forums

[Plugin: Custom Field Template] sort text results (4 posts)

  1. scope22
    Member
    Posted 1 year ago #

    I can add multiple text fields and get the results but they aren't in order.

    This is the code I use in Template Content
    [fast_facts]
    type = text
    size = 54
    multiple = true
    multipleButton = true
    label = Fast Facts:

    and this is the code I use in my page to retrieve the results
    <?php
    // Get fast_facts fields
    $fast_facts = get_post_custom_values('fast_facts', $post->ID);
    foreach ( $fast_facts as $key => $value ) {
    echo '

  2. ' . $value . '
  3. ';
    }
    ?>

    I have tried the sort option but they don't seem to effect the results
    (sort = asc, sort = desc, sort = order)

    Any help is appreciated.

  • scope22
    Member
    Posted 1 year ago #

    Still struggling on this.

    Any ideas for sorting?

  • proximity2008
    Member
    Posted 1 year ago #

    Hi Scope,

    I've had a go at this before, and Kevin Leary has written it up here:
    http://www.kevinleary.net/multiple-fields-groups-wordpress-custom-field-template-plugin/

    It does work but beware, you can lose data. If you find it isn't working for you try the Magic Fields Plugin. That supports repeating data.

  • scope22
    Member
    Posted 1 year ago #

    Hi proximity2008.

    Thanks for your reply. I have found your posts on this plugin very helpful.

    I have read through the page and use the code from the first section 'Creating & Parsing Multiple Single Fields'.

    I just want to sort a single field. It looks like the code is for multiple groups.

    Cheers

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags