Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter mehdi-w

    (@mehdi-w)

    thanks a lot.

    Hi there,
    Posting here because the other thread was closed…

    I tried the patch suggested above and it works great, EXCEPT that I’m having the same issues as the other posters: the final (right-most) column of meta data is generated with the correct title (<th>), but containing the data from the previous custom field.

    https://pdx.patientphysiciancoop.com/primary-care-directory/

    If I change
    if( $opt_meta ) : foreach( $opt_meta as &$key ) {
    to
    if( $opt_meta ) : foreach( $opt_meta as $key ) {
    then the data is now correct, but the custom field columns with $title definitions are now empty.

    I have been unable to find a fix.

    Thread Starter mehdi-w

    (@mehdi-w)

    @infinitecreature
    Hi,
    you can change your code(sorttablepost.php file) to this:

    //if( $opt_meta ) : foreach( $opt_meta  as $key) {
    		//echo '<th>' . $key. '</th>';
    //} endif;
    
    if( $opt_meta ): foreach( $opt_meta  as $key)  {
    if($key == 'customfield1' ) { echo '<th>lable1</th>'; }
    if($key == 'customfield2' ) { echo '<th>lable2</th>'; }
    if($key == 'customfield3' ) { echo '<th>lable3</th>'; }
    } endif;

    YESSSSS!
    Figured out the bug in the fields.

    after (line 113)
    } endif;

    add
    unset($key);

    Whooooo!

    Thanks Fyod! Can you post a more complete chunk of the code for me? I’ve made some additional modifications to the plugin, and my line numbers don’t match anymore. ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘show lable of custom fields instead of their names’ is closed to new replies.