• Hi chaps,

    In Custom Field Template I have this set up:

    [Colors]
    type = checkbox
    value = Blue # Yellow # Black # White

    A post can have multiple colors, so how can I display those?

    For instance: Color: Blue, Black, White

    Thx ahead guys ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • You should edit your template.
    Add some element, div for example, in template. Assign background-color for in with custom field value.

    Insert this code in your theme
    <div style="width:50px; height:50px; background-color: [INSERT HERE cft code];"></div>

    Further to Alexey’s solution:

    <?php
    $colour = 'White'; // set a default
    $colour =  get_post_meta( $post->ID, 'Colors', true ); ?>
    <div style="width:50px; height:50px; background-color:<?php echo $colour ?>"></div>

    Thanks for sharing this.

    How is it possible to get the title as well? For example, in the above mentioned example, displaying the following (if the colors are selected):

    Colors: Blue, Yellow, Black, White

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Custom Field Template ] Display all values of’ is closed to new replies.