Home Forums Plugin Support WP User Frontend Pro Show custom fields on post with LABEL

This topic is: not resolved

This topic contains 11 replies, has 2 voices, and was last updated by  DGIT DGIT 3 years, 7 months ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #72249

    DGIT DGIT
    Member
    Post count: 58

    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

    #72253

    DGIT DGIT
    Member
    Post count: 58

    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

    #72311

    Nayem
    Moderator
    Post count: 6480

    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.

    #72317

    DGIT DGIT
    Member
    Post count: 58

    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

    #72321

    DGIT DGIT
    Member
    Post count: 58

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

    Eg:

    value: cplusplus
    label: C++

    #72364

    DGIT DGIT
    Member
    Post count: 58

    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

    #72506

    Nayem
    Moderator
    Post count: 6480

    Hello DGIT,

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

    #72567

    DGIT DGIT
    Member
    Post count: 58

    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

    #72744

    Nayem
    Moderator
    Post count: 6480

    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.

    #72781

    DGIT DGIT
    Member
    Post count: 58

    So basically your plugin shows values not labels.

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

    kinda strange

    #72814

    Nayem
    Moderator
    Post count: 6480

    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.

    #72830

    DGIT DGIT
    Member
    Post count: 58

    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 12 posts - 1 through 12 (of 12 total)

The topic ‘Show custom fields on post with LABEL’ is closed to new replies.