• Resolved andywillers

    (@andywillers)


    I am using the shortcode to pull the data for a taxonomy (tags) – however it returns the ID rather than the name. Is there a way round this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jose Vega

    (@josevega)

    What shortcode are you using?

    Because I just tested this shortcode, copied from our documentation, and it works fine:
    [vg_display_data key="category" data_source="post_terms" template="<b>Categories:</b> {{var}}" joiner=", "]

    It displays the category names. You can replace “category” key with your taxonomy key.

    Thread Starter andywillers

    (@andywillers)

    I’m actually using a little more unusal use case – I have the custom field linked to post taxonomy but saving to user data? I’m currently using:

    [vg_display_data key=”accent” data_source=”user_meta” object_id_type=”find” template=”Categories: {{var}}” joiner=”, “]

    Thread Starter andywillers

    (@andywillers)

    And sorry 1 more thing – does this plugin have the ability to display queried user data rather than current user data? I;m trying to get the fields working with Jet Engine Listings plugin

    Plugin Author Jose Vega

    (@josevega)

    I see the problem.

    1- You can use the parameter flag=”term_name” to convert the id from the user meta into term names before the output.

    2- You’re quering the user incorrectly.
    object_id_type=”find” is used for finding a user through a meta query and you must also use the object_id=”field:value” to find the user. If you use the first parameter, you’re telling it to find a user, but without the later the plugin doesn’t have any parameters for the search.

    For example:
    [vg_display_data object_id_type=”find” object_id=”phone:1234″ key=”user_email” data_source=”user_data”]

    Will find a user where the meta field phone=1234 and display the email of that user.

    Note, we can only make a search based on one meta parameter.

    ==

    In general, your use case is probably more advanced than what this plugin allows. You’ll probably need to code your own shortcode.

    Thread Starter andywillers

    (@andywillers)

    Thank you for this much appreciated. I have tweaked the fields to make this easier. Is there a flag type to output a pretty date format? Currently it outputs as 20220512 rather than a readable date

    Plugin Author Jose Vega

    (@josevega)

    Hi. This has been fixed in today’s update.

    The dates will be formatted automatically based on the ACF settings, and the taxonomy fields will automatically display the term name.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Return Taxonomy name rather than ID’ is closed to new replies.