WordPress.org

Ready to get started?Download WordPress

Forums

convert 0 into meta_key - custom field (1 post)

  1. nitin044
    Member
    Posted 2 years ago #

    Hello guys,

    I have a product page, where i wants to display custom fields in tabular format. I inserted below code in single.php to get my custom fields for the same.

    <?php
    echo '<table id="cf">';
       $mykey_values = get_post_custom_values('my_key');
      foreach ( $mykey_values as $key => $value ) {
       echo '<tr>';
        echo "<td>$key  </td><td> $value<br /></td>";
       echo '</tr>';
      }
    echo '</table>';
    
    ?>

    The result was good but not great as the meta key was displaying 0 , 1, 2 etc. like array. check the link for reference.

    http://mmjewels.com.au/products/test-2

    Now i just want a code which will change this values (0,1) to my custom field's meta key, which i will entered.

    plz guys help me.

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic