Support

Account

Home Forums Front-end Issues Front end show Taxonomies IDs instead of terms/name

Solving

Front end show Taxonomies IDs instead of terms/name

  • Hello everybody,
    I am using ACF 6.2 and I don’t understand why on the front end it displays the ID of the taxonomies and not the terms.
    In field type I correctly checked as “return value” “terms” and not “ID”.
    https://prnt.sc/M7RZ5d6ohGtw

    I saw couple of old posts that were suggesting code but the option should work ?

    Thank you for your lights 🙂

  • Salut! Can you share a screenshot of your PHP that outputs your field?

  • Salut aussi !
    Au cas où d’autres personnes rencontrent le meme problème on continue en Anglais ? 🙂

    I am definitely not a coder/dev and since the latest release of ACF what I am trying, or anyway, achieved so far, has been done without a single bit of code.

    My bad, I forgot to specify that I am also using Elementor.

    But here is what I have done:
    I have created a new taxonomy:
    https://prnt.sc/SblxWOHBmACi
    https://prnt.sc/QpWKI3Qa41-S
    https://prnt.sc/A8kIAtrZXW6m

  • Salut aussi !
    Au cas où d’autres personnes rencontrent le meme problème on continue en Anglais ? 🙂

    I am definitely not a coder/dev and since the latest release of ACF what I am trying, or anyway, achieved so far, has been done without a single bit of code.

    My bad, I forgot to specify that I am also using Elementor.

    But here is what I have done:
    I have created a new taxonomy:
    https://prnt.sc/SblxWOHBmACi
    https://prnt.sc/QpWKI3Qa41-S
    https://prnt.sc/A8kIAtrZXW6m

  • Un grand salut aussi 🙂
    I’ll try to change the content of my post so i can actually post it
    Au cas où d’autres personnes rencontrent le meme problème on continue en Anglais ? 🙂

    I am definitely not a coder/dev and since the latest release of ACF what I am trying, or anyway, achieved so far, has been done without a single bit of code.

    My bad, I forgot to specify that I am also using Elementor.

    But here is what I have done:
    I have created a new taxonomy:

  • And here is what I did in Elementor:
    (attached file01)

    So it definitely loads something correct, which is the ID of the taxonomy:
    (attached file02)
    In this case 59
    But even if I switch the value as showed in my original post this is still the ID and not the value/term that is showing up.

  • It works fine with “normal” fields:
    (attached files)
    But I know this is not the same thing as Taxonomies.

    And I am a bit stuck :-/

  • Bon matin! Well I tried on my end and it’s working fine using JetEngine and their “Dynamic Field” widget (and call back). Using the “Heading” widget like you did there’s no option to output the term’s name, it only shows the ID 🙁

  • Merci de ta réponse !

    I’d like to try that, this is the plugin that you are using ?

    https://crocoblock.com/plugins/jetengine/

  • De rien! Yes that is the one, I think it is more complete for advanced tasks like these 🙂

  • I am getting this error but you were talking about a call back ?

  • Ho !
    I got it, it was on your screenshot a bit further down !

    I am finally getting a value ! 🙂

    Un grand merci pour ton aide ! 🙂

  • Fait plaisir, bonne journée du Québec! 😛

    You can do a lot with JetEngine, so enjoy!

  • Salut aussi !
    Au cas où d’autres personnes rencontrent le meme problème on continue en Anglais ? 🙂

    I am definitely not a coder/dev and since the latest release of ACF what I am trying, or anyway, achieved so far, has been done without a single bit of code.

    My bad, I forgot to specify that I am also using Elementor.

    But here is what I have done:
    I have created a new taxonomy:
    https://prnt.sc/SblxWOHBmACi
    https://prnt.sc/QpWKI3Qa41-S
    https://prnt.sc/A8kIAtrZXW6m

    And here is what I did in Elementor:
    https://prnt.sc/kQmfuTbvomh1

    So it definitely loads something correct, which is the ID of the taxonomy:
    https://prnt.sc/2gf4eFlbn8tv
    In this case 59
    But even if I switch the value as showed in my original post this is still the ID and not the value/term that is showing up.

    It works fine with “normal” fields:
    https://prnt.sc/X–0v2gyJDCc
    https://prnt.sc/GwSsYtf4DpfC
    But I know this is not the same thing as Taxonomies.

    And I am a bit stuck :-/

    I even asked chatgpt to write me a code snippet which looks that it could have done something (I even asked the function to check on a specific url) but it still doesn’t work 🙁

    function convert_taxonomy_ids_to_terms( $value, $post_id, $field ) {
    if ( ! $value ) {
    return $value;
    }
    if ( strpos( $_SERVER[‘REQUEST_URI’], ‘/listing-des-animaux/’ ) !== false ) {
    $taxonomies = get_object_taxonomies( ‘animaux’ );
    if ( is_array( $value ) ) {
    $text_values = array();
    foreach ( $value as $id ) {
    foreach ( $taxonomies as $taxonomy ) {
    $term = get_term_by( ‘id’, $id, $taxonomy );
    if ( $term ) {
    $text_values[] = $term->name;
    }
    }
    }
    return implode( ‘, ‘, $text_values );
    } else {
    foreach ( $taxonomies as $taxonomy ) {
    $term = get_term_by( ‘id’, $value, $taxonomy );
    if ( $term ) {
    return $term->name;
    }
    }
    return $value;
    }
    } else {
    return $value;
    }
    }
    add_filter( ‘acf/format_value/type=taxonomy’, ‘convert_taxonomy_ids_to_terms’, 10, 3 );

  • Salut aussi !
    Au cas où d’autres personnes rencontrent le meme problème on continue en Anglais ? 🙂

    I am definitely not a coder/dev and since the latest release of ACF what I am trying, or anyway, achieved so far, has been done without a single bit of code.

    My bad, I forgot to specify that I am also using Elementor.

    But here is what I have done:
    I have created a new taxonomy:
    https://prnt.sc/SblxWOHBmACi
    https://prnt.sc/QpWKI3Qa41-S
    https://prnt.sc/A8kIAtrZXW6m

    And here is what I did in Elementor:
    https://prnt.sc/kQmfuTbvomh1

    So it definitely loads something correct, which is the ID of the taxonomy:
    https://prnt.sc/2gf4eFlbn8tv
    In this case 59
    But even if I switch the value as showed in my original post this is still the ID and not the value/term that is showing up.

    It works fine with “normal” fields:
    https://prnt.sc/X–0v2gyJDCc
    https://prnt.sc/GwSsYtf4DpfC
    But I know this is not the same thing as Taxonomies.

    And I am a bit stuck :-/

    I even asked chatgpt to write me a code snippet which looks that it could have done something (I even asked the function to check on a specific url) but it still doesn’t work 🙁

  • Salut aussi !
    Au cas où d’autres personnes rencontrent le meme problème on continue en Anglais ? 🙂

    I am definitely not a coder/dev and since the latest release of ACF what I am trying, or anyway, achieved so far, has been done without a single bit of code.

    My bad, I forgot to specify that I am also using Elementor.

    But here is what I have done:
    I have created a new taxonomy:
    https://prnt.sc/SblxWOHBmACi
    https://prnt.sc/QpWKI3Qa41-S
    https://prnt.sc/A8kIAtrZXW6m

    And here is what I did in Elementor:
    https://prnt.sc/kQmfuTbvomh1

    So it definitely loads something correct, which is the ID of the taxonomy:
    https://prnt.sc/2gf4eFlbn8tv
    In this case 59
    But even if I switch the value as showed in my original post this is still the ID and not the value/term that is showing up.

    It works fine with “normal” fields:
    https://prnt.sc/X–0v2gyJDCc
    https://prnt.sc/GwSsYtf4DpfC
    But I know this is not the same thing as Taxonomies.

    And I am a bit stuck :-/

  • Salut aussi !
    Au cas où d’autres personnes rencontrent le meme problème on continue en Anglais ? 🙂

    I am definitely not a coder/dev and since the latest release of ACF what I am trying, or anyway, achieved so far, has been done without a single bit of code.

    My bad, I forgot to specify that I am also using Elementor.

    But here is what I have done:
    I have created a new taxonomy:
    https://prnt.sc/SblxWOHBmACi
    https://prnt.sc/QpWKI3Qa41-S
    https://prnt.sc/A8kIAtrZXW6m

  • Salut aussi !
    Au cas où d’autres personnes rencontrent le meme problème on continue en Anglais ? 🙂

    I am definitely not a coder/dev and since the latest release of ACF what I am trying, or anyway, achieved so far, has been done without a single bit of code.

    My bad, I forgot to specify that I am also using Elementor.

    But here is what I have done:
    I have created a new taxonomy:

    https://prnt.sc/SblxWOHBmACi

  • Un grand salut aussi 🙂
    Au cas où d’autres personnes rencontrent le meme problème on continue en Anglais ? 🙂

    I am definitely not a coder/dev and since the latest release of ACF what I am trying, or anyway, achieved so far, has been done without a single bit of code.

    My bad, I forgot to specify that I am also using Elementor.

    But here is what I have done:
    I have created a new taxonomy:
    https://prnt.sc/SblxWOHBmACi
    https://prnt.sc/QpWKI3Qa41-S
    https://prnt.sc/A8kIAtrZXW6m

Viewing 19 posts - 1 through 19 (of 19 total)

You must be logged in to reply to this topic.