Skip to main content
deleted 6 characters in body
Source Link
fuxia
  • 107.1k
  • 38
  • 255
  • 459
$gear = get_post_meta( $post_id, 'gear', true );

… will return the last value only, because you told it do that with the last parameter. Drop it, and you will get an array of all values:

$gear = get_post_meta( $post_id, 'gear', true );

Then print it with:

print join( $gear, ', ' );

And as Chip has pointed out: Do not use the translation function for values that are not translatable. And even translatable values need a text domain.

$gear = get_post_meta( $post_id, 'gear', true );

… will return the last value only, because you told it do that with the last parameter. Drop it, and you will get an array of all values:

$gear = get_post_meta( $post_id, 'gear', true );

Then print it with:

print join( $gear, ', ' );

And as Chip has pointed out: Do not use the translation function for values that are not translatable. And even translatable values need a text domain.

$gear = get_post_meta( $post_id, 'gear', true );

… will return the last value only, because you told it do that with the last parameter. Drop it, and you will get an array of all values:

$gear = get_post_meta( $post_id, 'gear' );

Then print it with:

print join( $gear, ', ' );

And as Chip has pointed out: Do not use the translation function for values that are not translatable. And even translatable values need a text domain.

Source Link
fuxia
  • 107.1k
  • 38
  • 255
  • 459

$gear = get_post_meta( $post_id, 'gear', true );

… will return the last value only, because you told it do that with the last parameter. Drop it, and you will get an array of all values:

$gear = get_post_meta( $post_id, 'gear', true );

Then print it with:

print join( $gear, ', ' );

And as Chip has pointed out: Do not use the translation function for values that are not translatable. And even translatable values need a text domain.