This topic contains 11 reply and 2 voices, and was last updated by DGIT DGIT 3 years, 11 months ago
Viewing 11 Posts - 1 through 11 (of 11 total)
Author Posts
September 17, 2015 at 4:44 pm 72249
DGIT DGIT Hi guys, 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. thanks
September 17, 2015 at 4:49 pm 72253
DGIT DGIT DGIT DGIT

by LABEL I mean the custom field label not the value one.

Also the code above shows the value not the value’s label.

eg:

custom field label: University
custom field value label: Oxford

I want to show something like:

University: Oxford

September 17, 2015 at 7:18 pm 72311
Nayem Nayem

Hello DGIT,

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
DGIT DGIT DGIT DGIT

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.

thanks

September 17, 2015 at 8:39 pm 72321
DGIT DGIT DGIT DGIT

with the code you provide I can print the VALUE but I want to print the label.

Eg:

value: cplusplus
label: C++

September 18, 2015 at 4:36 pm 72364
DGIT DGIT DGIT DGIT

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 value

September 19, 2015 at 7:01 pm 72506
Nayem Nayem

Hello DGIT,

Yes, you are right. It will show the value not the label’s value.

September 20, 2015 at 3:15 pm 72567
DGIT DGIT DGIT DGIT

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

University: Harward

?

thanks

September 21, 2015 at 5:38 pm 72744
Nayem Nayem

Hello DGIT,

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
DGIT DGIT DGIT DGIT

So basically your plugin shows values not labels.

if someone has a value 1234 and a label RED you show 1234

kinda strange

September 22, 2015 at 11:48 am 72814
Nayem Nayem

Hello DGIT.

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
DGIT DGIT DGIT DGIT

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.

Viewing 11 Posts - 1 through 11 (of 11 total)