September 17, 2015 at 4:44 pm #72249
I' adding the custom fields to my single.php page.
It works great with this code:
ID, ‘address', true ); ?>
but I want also to show the custom field label.
How can I do it?
I need the label to be showed JUST when there's the custom field in that post.
thanksSeptember 17, 2015 at 4:49 pm #72253
by LABEL I mean the custom field label not the value one.
Also the code above shows the value not the value's label.
custom field label: University
custom field value label: Oxford
I want to show something like:
University: OxfordSeptember 17, 2015 at 7:18 pm #72311
If I am clear then- You have printed the custom field value but you are not able to print the label of the field. I have to discuss with my developer about this. Please allow me some time.September 17, 2015 at 8:10 pm #72317
Thanks Nayem yes.
I was using code like this:
<div class="custom-fields-show"> <span><?php echo get_post_meta( $post->ID, 'project_type', true ); ?></span> <span><?php echo get_post_meta( $post->ID, 'programming_language', true ); ?></span> <span><?php echo get_post_meta( $post->ID, 'physical_computing', true ); ?></span> <span><?php echo get_post_meta( $post->ID, 'university', true ); ?></span> </div>
1 – I would like to show the value's LABEL instead of the value
2 – I would like to hide the span when no value is present
All this is obviously cause we changed our values accordingly to the ‘ issue we found.
thanksSeptember 17, 2015 at 8:39 pm #72321
with the code you provide I can print the VALUE but I want to print the label.
label: C++September 18, 2015 at 4:36 pm #72364
Hy Nayem, just noticed that your option to show custom fields on the post does the same.
Basically it shows value and not label's valueSeptember 19, 2015 at 7:01 pm #72506
Yes, you are right. It will show the value not the label's value.September 20, 2015 at 3:15 pm #72567
So how can I solve it?
Let's say I got something like this:
<div><?php echo get_post_meta( $post->ID, 'project_type', true ); ?></div>
this will show the value ok
but how I hide the div if there's no value?
how can I put the label like
thanksSeptember 21, 2015 at 5:38 pm #72744
You have to customize the plugin codes but I am really sorry to say that we do not provide support for customization. We only provide support for our built-in features, configuration and installation.
Thanks.September 21, 2015 at 7:11 pm #72781
So basically your plugin shows values not labels.
if someone has a value 1234 and a label RED you show 1234
kinda strangeSeptember 22, 2015 at 11:48 am #72814
If your dropdown field has value and you have checked show values then it will print the value. I will suggest you to allow me some time. We are now in vacation. Our office will start from 29th sept. I will be able to help you about this tweak after opening our office.
Please kee patience. Thanks.September 22, 2015 at 1:57 pm #72830
The show value flag is to show values in the backend but it doesn't stay flagged.
OK meanwhile I'll try to find a workaround, thanks.
The topic ‘Show custom fields on post with LABEL’ is closed to new replies.