WordPress.org

Ready to get started?Download WordPress

Forums

Types - Custom Fields and Custom Post Types Management
[resolved] Can't display checkboxes on we (8 posts)

  1. lazy by nature
    Member
    Posted 1 year ago #

    Hello.

    I have a problem showing checkboxes on my website.

    echo types_render_field("program-zile");

    doesn't echo anything.

    print_r(types_render_field("program-zile", array('raw' => 'true')));

    prints Array on my html.

    $zileLista = types_render_field("program-zile", array('raw' => 'true'));
    foreach ($zileLista as $i => $value) {
    echo $zileLista[$i];
    }

    doesn't echo anything.

    $zileLista = types_render_field("program-zile");
    foreach ($zileLista as $i => $value) {
    echo $zileLista[$i];
    }

    doesn't echo anything.

    What am i doing wrong ?
    (i verified slug, and i have the boxes checked on my custom posts)

    http://wordpress.org/extend/plugins/types/

  2. AmirHelzer
    Member
    Plugin Author

    Posted 1 year ago #

    Are other fields outputting correctly?

    Types will output a message in the debug console if you pass the wrong name of the field. You should enable debugging to see that:
    http://wp-types.com/documentation/user-guides/debugging-types-and-views/

  3. lazy by nature
    Member
    Posted 1 year ago #

    yes, the other fields output ok.

    i've activated debugging and i don't get any error in console.

    [No bumping, thank you.]

  4. SamusFairchild
    Member
    Posted 1 year ago #

    Having the exact same problem here.

  5. SamusFairchild
    Member
    Posted 1 year ago #

    Try this->
    echo types_render_field("program-zile", array("option"=>1);
    echo types_render_field("program-zile", array("option"=>2);

    ....etc.

  6. lazy by nature
    Member
    Posted 1 year ago #

    thank you, that worked.

    still, types_render_field should output an array by default (in checkboxes case).

  7. SamusFairchild
    Member
    Posted 1 year ago #

    Agreed. At least if it doesn't, it would be nice to have it in the documentation somewhere.

  8. nancyeb01
    Member
    Posted 1 year ago #

    I have a similar problem. The Custom Post shows the Custom Field for my checkboxes; and the output includes the correct values, but the Post display surrounds it with Array code.

    Array
    (
    [wpcf-fields-checkboxes-option-1310960586] => Connecticut
    [wpcf-fields-checkboxes-option-1885827021] => Maine
    [wpcf-fields-checkboxes-option-1748639191] => Massachusetts
    )

    I am using Loopbuddy by iThemes for the layout. It works with other custom fields. Any thoughts on this would be most appreciated.
    Thank you, Nancy

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags