• Resolved mohamed.belhassen

    (@mohamedbelhassen)


    Hi,

    I created a cusom post field called “niveau-universaitaire” to which I added two options:

    option1: displayedtext: 2014-2015 value: 1
    option2: displayedtext: 2015-2016 value: 2

    I succeded to display the value of this field by executing the following instruction:
    echo get_post_meta($post->ID, “wpcf-niveau-universaitaire”);

    But, I don’t know how to display the associated text (e.g: 2014-2015 instead of the value: 1)

    Please help me to get such information.

    Cordially,
    M.B

    https://www.ads-software.com/plugins/types/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Anonymous User 14808221

    (@anonymized-14808221)

    Please use either the Types API or the Plugin Views to display your Types Fields.

    The API is to consult here:
    https://wp-types.com/documentation/functions/

    meta_values displayed for a Post Field always are what you store in the Database.

    You can adjust your values or call the Labels given a value (with conditionals)

    The Labels are mainly intended to be for the Backend when you choose a certain option.

    You can follow our API DOC to see how to use the different attributes of the Fields.

    Thread Starter mohamed.belhassen

    (@mohamedbelhassen)

    thank you very much, problem is resolved using:

    echo “Année universitaire: “.do_shortcode(“[types field=’annee-universitaire’][/types]”);

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How show displayed Text of a given post field’ is closed to new replies.